AlexPaterson Posted November 24, 2021 Share Posted November 24, 2021 Hi, I've recently downloaded the Commander X16 emulator and had a go at trying to program it with CC65. However, I can't work out how to make a sound, and there's no documentation on it (that I could find). Does anyone know how to do this? Thanks, Alex Paterson Quote Link to comment Share on other sites More sharing options...
0 SlithyMatt Posted November 24, 2021 Share Posted November 24, 2021 It all depends on what kind of sound you want to make. I have videos showing you how to use the Programmable Sound Generator (PSG): and then another for using the YM2151 FM Synthesizer chip: If you want to playback PCM sound samples, I have example code but no video yet. Quote Link to comment Share on other sites More sharing options...
0 AlexPaterson Posted November 24, 2021 Author Share Posted November 24, 2021 On 11/24/2021 at 2:49 PM, SlithyMatt said: It all depends on what kind of sound you want to make. I have videos showing you how to use the Programmable Sound Generator (PSG): and then another for using the YM2151 FM Synthesizer chip: If you want to playback PCM sound samples, I have example code but no video yet. Thanks @SlithyMatt, but I managed to adapt a BASIC program from here (https://www.8bitcoding.com/p/sound-in-basic-i-programmable-sound.html) to play a simple sound using vpoke statements. I've attached the .c file I used to this post in case anyone asks the same question I did. However, it's very quiet - way quieter than the rest of the sounds on my PC - even though I've set the volume bits set to all 1's. Is this an emulator thing, or have I done something wrong? beepboop.c Quote Link to comment Share on other sites More sharing options...
0 SlithyMatt Posted November 24, 2021 Share Posted November 24, 2021 On 11/24/2021 at 12:54 PM, AlexPaterson said: However, it's very quiet Well, you did pick a very low frequency: about 265 Hz. Maybe try a higher frequency by poking 4 instead of 2 in the high frequency byte. Also, I don't imagine that the for loop gives you a very long tone. At 8MHz, the X16 should plow through that pretty quick. Quote Link to comment Share on other sites More sharing options...
0 kliepatsch Posted November 24, 2021 Share Posted November 24, 2021 (edited) You are right: the overall volume of the emulator is very low. There's nothing you can do about it from inside a program that runs on the X16. (One could, however, recompile the emulator with increased output volume) Edited November 24, 2021 by kliepatsch Quote Link to comment Share on other sites More sharing options...
0 AlexPaterson Posted November 24, 2021 Author Share Posted November 24, 2021 On 11/24/2021 at 6:16 PM, SlithyMatt said: Well, you did pick a very low frequency: about 265 Hz. Maybe try a higher frequency by poking 4 instead of 2 in the high frequency byte. Also, I don't imagine that the for loop gives you a very long tone. At 8MHz, the X16 should plow through that pretty quick. I've increased the frequency, but that doesn't seem to make much difference to the volume. I've also increased the length of the tone too. On 11/24/2021 at 6:40 PM, kliepatsch said: I didn't check your source, but you are right: The overall volume of the emulator is very low. That explains why changing the frequency and duration doesn't change much. Thanks for the help @SlithyMatt and @kliepatsch Quote Link to comment Share on other sites More sharing options...
Question
AlexPaterson
Hi,
I've recently downloaded the Commander X16 emulator and had a go at trying to program it with CC65. However, I can't work out how to make a sound, and there's no documentation on it (that I could find). Does anyone know how to do this?
Thanks,
Alex Paterson
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.