Tag: SID Music

  • Making music in Basic 7.0 part 5

    Making music in Basic 7.0 part 5

    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.

  • Making music in Basic 7.0 part 4

    Making music in Basic 7.0 part 4

    Apart from PLAY, the commands that are available for making sounds and music are TEMPO, ENVELOPE, SOUND and FILTER.

    TEMPO lets you control playback speed. The slowest is 1 and the fastest is 255.

    ENVELOPE lets you modify the ten predefined instruments. You set the instruments using the T control character (0 to 9). The arguments are:

    – The instrument you want to overwrite (0 to 9)
    – Attack rate (0 to 15)
    – Decay rate (0 to 15)
    – Sustain level (0 to 15)
    – Release rate (0 to 15)
    – Waveform (0=triangle, 1=sawtooth, 2=square with adjustable pulse width, 3=noise, 4=ring modulation)
    – Pulse width (0 to 4095) – only relevant if waveform is set to 2.

    This program creates 5 similar instruments that differ in pulse width, and uses them in a simple riff.

    10 ENVELOPE 0,0,5,0,0,2,100
    20 ENVELOPE 1,0,5,0,0,2,300
    30 ENVELOPE 2,0,5,0,0,2,500
    40 ENVELOPE 3,0,5,0,0,2,700
    50 ENVELOPE 4,0,5,0,0,2,900
    60 TEMPO 40
    70 PLAY "V1O2Q"
    80 FOR I=1 TO 2
    90 PLAY "T0CCT1CCT2CCT3CCT4CCT3CCT2CCT1CC"
    100 NEXT

    Click here to listen.

  • Making music in Basic 7.0 part 3

    Making music in Basic 7.0 part 3

    When you use the other synthesizer control characters (O, T, U and X), they apply no matter of what voice (V) you have chosen. So when you for example use O to set the octave (0 to 6), all the following notes, regardless of voice, will be played in that octave. This example will play the notes C, D and E in voice 1, octave one. C, D E in voice 1, octave 2, and finally C (at the same time as the previous E), D and E in voice 2, octave 2.

    PLAY "V1O1 CDE O2 CDE V2 CDE"

    T (0 to 9) lets you chose from 10 predefined envelopes. The predefined envelopes emulates different instruments (0 is piano, 1 is accordion and so on). Envelopes differ in attack rate, decay rate, sustain level, release rate and waveform. This song uses a harpsichord bass (T6), a drum (T3) and some xylophone (T9).

    10 FOR I=1 TO 4
    20 PLAY "V1O2T6QCCT3O5CO2T6C"
    30 PLAY "V2O5T9CV3G"
    40 NEXT

    U (0 to 15) controls the volume, but not on the next note, but also on any playing note. This will therefore play both C notes using volume 2.

    PLAY "U15 C U2 C"

    Finally, X (0 or 1) is used to turn the frequency filter on (1) or off (0).

  • Making music in Basic 7.0 part 2

    Making music in Basic 7.0 part 2

    The synthesizer control characters (V, O, T, U and X) always take one integer argument and always affect all the rest of the notes that are played. V stands for Voice and is the key to polyphonic music. Since polyphonic music is achieved by playing notes in different voices, you will use V a lot.

    Each note will be played when the previous note is done, but if you switch voices, the next note will be played immediately (if the voice you switch to is free). This will play the C note, followed by E and G at the same time. There are three voices available: 1, 2 and 3.

    PLAY "V1 CE V2 G"

    This program gives you a nice riff:

    10 FOR A=1 TO 4
    20 PLAY "V1 CE CV2EV3G"
    30 PLAY "V1 CGCC V2EV3G"
    40 PLAY "V1CV2EV3G"
    50 NEXT

  • Making music in Basic 7.0 part 1

    Making music in Basic 7.0 part 1

    In Commodore Basic 7, music is made using the PLAY command. PLAY takes one string, and that string contains the notations that you want the Commodore 128 to play. The string “CDE” will play the note C, and then the note D and finally then note E.

    PLAY "CDE"

    Possible notes are C, D, E, F, G, A and B. R is for Rest. Rests take up time, but does not make any sound. Spaces are ignored, so you can add spaces to make your string more readable. When you add a note control character to your note, this might be of interest. There are three note control characters that you can use. Control characters operates only on the note immediately to the right, spaces ignored.

    Sharp (#) will play the note a half tone higher, flat ($) will play the note a half tone lower and period (.) will increase note duration by 50%. Since note control chars only apply to the next note, this will play 4 C notes, but only the third note will be longer.

    PLAY "CC.CC"

    The synthesizer control characters and the duration control characters do not just apply to the next note to the right, but to all preceding notes. All synthesizer control characters take numeric arguments, but none of the duration control characters take any arguments. I will get back to the synthesizer control characters, but these are the duration control characters:

    W for whole note, H for half note, Q for quarter note (default), I for eight note and S for sixteenth note. This will play two bars. The first bar will consist of two quarter notes and one half note. The next bar will consist of one half note and two quarter notes.

    PLAY "QCCHCCQCC"

    With this much knowledge, you can do Smoke on the water by Deep Purple. Something like this:

    PLAY "QC#D.FC#DI#FHF"