X16 Synth (on-system audio from the keyboard)
Posted: Mon Jun 03, 2024 9:05 am
Done in BASIC just as a concept to show what BASLOAD can do. Multi-voice is supported, but seems either the SMC or the PS/2 interface itself is limited to 3-6 keys pressed at the same time (or maybe it varies by keyboard).
VSYNTH-FMFREQ.BASL.TXT / VSYNTH-FMFREQ.PRG original non-multivoice version, but supports more than 16 keys (middle row is arranged about like an octave and a half of a typical piano keyboard, upper row is the black keys)
VSYNTH-PSG.PRG (and VSYNTH.BASL.TXT / KBDHANDLER.BASL.TXT) is the multi-voice version, and also switched over to using PSGFREQ instead. FMFREQ wasn't giving me as much control over the duration as PSGFREQ does.
FMNOTE/FMCHORD is are all neat, but sometimes it is hard to coordinate using this as background audio in your own BASIC programs. If you know the frequency and approximate tempo, then you can just store those in a DATA sequence and control the playing of the next note(s) inline with your BASIC program main loop. And unless you have a lot of experience in composing, it's hard to come up with chords and music in your head - it helps to hear them a bit in real time on the system, or just doodle around the keyboard and experiment with combinations.
But even at 8MHz, BASIC does struggle a bit to process this in its interpreted form. Maybe someday a Blitz build of this will smooth that out. IMO this runs a bit smoother and better on the actual hardware.
So while this does function, there is lots of room for improvement too. But the main intent was it would buffer up sequences, then have an option to export them back out to DATA sequence or BASIC code - so once you had a tune you like to incorporate into your main program, this would generate a snippet of that audio for you (hence why the FMFREQ version pay attentions to jiffies between notes).
VSYNTH-FMFREQ.BASL.TXT / VSYNTH-FMFREQ.PRG original non-multivoice version, but supports more than 16 keys (middle row is arranged about like an octave and a half of a typical piano keyboard, upper row is the black keys)
VSYNTH-PSG.PRG (and VSYNTH.BASL.TXT / KBDHANDLER.BASL.TXT) is the multi-voice version, and also switched over to using PSGFREQ instead. FMFREQ wasn't giving me as much control over the duration as PSGFREQ does.
FMNOTE/FMCHORD is are all neat, but sometimes it is hard to coordinate using this as background audio in your own BASIC programs. If you know the frequency and approximate tempo, then you can just store those in a DATA sequence and control the playing of the next note(s) inline with your BASIC program main loop. And unless you have a lot of experience in composing, it's hard to come up with chords and music in your head - it helps to hear them a bit in real time on the system, or just doodle around the keyboard and experiment with combinations.
But even at 8MHz, BASIC does struggle a bit to process this in its interpreted form. Maybe someday a Blitz build of this will smooth that out. IMO this runs a bit smoother and better on the actual hardware.
So while this does function, there is lots of room for improvement too. But the main intent was it would buffer up sequences, then have an option to export them back out to DATA sequence or BASIC code - so once you had a tune you like to incorporate into your main program, this would generate a snippet of that audio for you (hence why the FMFREQ version pay attentions to jiffies between notes).