Jump to content
  • 0

How to play sounds with CC65?


AlexPaterson
 Share

Question

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

  • 0

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.

Link to comment
Share on other sites

  • 0
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

Link to comment
Share on other sites

  • 0
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.

Link to comment
Share on other sites

  • 0
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use