Startsidan  ▸  Texter  ▸  Teknikblogg

Anders Hesselbom

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

The oddities: GO64 and sound

2010-05-29

GO64
In some ways, GO64 behaves as a command (GO) with one argument (64). For example, you can type GO64, GO 64 or even GO 70-6 and all will set the C128 in C64 mode. But in some ways, GO64 behaves as a command on its own. For example, from the fact that GO 60+4 does the job, you would perhaps expect GO 65 to generate a ?ILLEGAL QUANTITY ERROR, but it generates a ?SYNTAX ERROR. The fact that typing GO 8*8 sets the machine in C64 mode is strange enough.

Sound
The PLAY command plays notes and the SOUND command audio in any frequency. PLAY can deal with notes and volume envelopes but not pitch bending. SOUND can pitch bend but not deal with volume envelopes. This plays three notes, C, D and E, with a volume envelope that emulates a piano:

PLAY "CDE"

This plays a C-maj chord:

PLAY "V1 C V2 E V3 G"

This plays a pitch bending sound without a volume envelope:

SOUND 1, 8000, 40, 2, 7000, 100

The arguments are channel, frequency, duration, direction (2 means oscillate) and stepvalue.

If I make a program with a PLAY command that is directly followed by a SOUND command that plays a sound in the same voice channel, they are combined! This gives a pitch bending sound with a volume envelope! T5 means that I use the predefined guitar volume envelope, and HC means half note of C (two quarters long C).

10 SOUND 1, 8000, 50, 7000, 100
20 PLAY "V1 T5 HC"

Categories: Geeky

Tags: C128

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