Startsidan  ▸  Texter  ▸  Teknikblogg

Anders Hesselbom

Programmerare, skeptiker, sekulärhumanist, antirasist.
Författare till bok om C64 och senbliven lantis.
Röstar pirat.

Making music in Basic 7.0 part 5

2012-04-14

You can add pitch bending using the SOUND command. By itself, you cannot use envelopes, just flat sounds in any given pitch. The arguments are voice (1, 2 or 3), frequency (0 to 65535), duration (16 = one second), pitch bend direction (0 = up, 1 = down, 2 sine up and down), minimum frequency, pitch bend speed, waveform (0 = triangle, 1 = saw tooth, 2 = square, 3 = noise) and finally pulse width (if waveform is 2).

This will make a straight beep, that will play for two seconds:

SOUND 1, 4000, 32

And now for something completely different, a hysterical vibrato!

SOUND 1, 5000, 32, 2, 3000, 800, 1

To add an envelope to the sound, you use what you know on the PLAY command, and add the SOUND command immediatly before. Make sure you trigger them on the same voice.

Both the SOUND command and the PLAY command (in combination with the ENVELOPE command and the T synthesize control character) allows you to control the waveform that is being used. When combining them, PLAY decides, not SOUND. Type in this in your Commodore 128. You might want to reset your machine first, to set all parameters to default.

10 SOUND 1, 5000, 32, 2, 3000, 800, 1
20 PLAY "V1T5C"

Cool, right? Click here to listen.

Categories: Geeky

Tags: C128, SID Music

Leave a Reply

Your email address will not be published. Required fields are marked *



En kopp kaffe!

Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!

Bjud på en kopp kaffe!

Om...

Kontaktuppgifter, med mera, finns här.

Följ mig

Twitter Instagram
GitHub RSS

Public Service

Folkbildning om public service.

Hem   |   linktr.ee/hesselbom   |   winsoft.se   |   80tal.se   |   Filmtips