okay this is a shot in the dark but do any #DOS folks know anything about where one would start with actually authoring PC speaker sound effects?
@eniko I couldn't find a tool, so I ended up:
- writing a parser for Apogee IFS format PC speaker audio
- seeing what kind of number patterns were used for each kind of sound
- made some Python scripts to generate numbers
- Lua hotloaded the numbers into my engine with to hear them
@moralrecordings I'm kinda limited to qbasic's PLAY command so I don't think I can do that >_>
@eniko I believe QBASIC supports OUT for writing to the hardware ports, you could write some code that directly programs PIT2?

https://github.com/moralrecordings/perentie/blob/main/src/dos.c#L489
https://github.com/moralrecordings/perentie/blob/main/src/pcspeak.c
perentie/src/dos.c at main · moralrecordings/perentie

Lua-based adventure game engine for DOS. Contribute to moralrecordings/perentie development by creating an account on GitHub.

GitHub
@moralrecordings it might be possible to reprogram PIT channel 2 but i can't get interrupt requests
@eniko ahhh apologies, I forgot that the default timer in DOS is 18.2Hz. You need at least 140Hz for IFS... wonder how much of the QBASIC internals would explode on impact if the PIT0 clock got changed

@moralrecordings i'm afraid of trying, so i don't know :'D

but testing in dosbox tells me i can get 57 notes per second out of the PLAY command which is enough for crude sound effects

speaking of 18.2Hz you wouldn't believe the day i had trying to lock framerate to 30/35 for slower machines

@eniko Solidarity, I believe it. It was plenty of a struggle to get the screen to draw on real VGA without tearing, let alone adding a fixed half framerate mode in QBASIC.

@moralrecordings well one thing i learned is that everyone is wrong about the raw channel0 PIT value when set to defaults. everywhere claims it goes 65535 to 0 then fires an irq when it underflows, and that's what sets the 18.2Hz clock

but it actually underflows *twice* per clock because it's a square wave and the irq only fires on the rising edge