text
stringlengths
0
99.6k
V1 1/16 OC4 ( voice, duration, octave for voice 1)
R C D E F D E C 1/8 G
V2 1/16 OC3 R C V1 OC5 C V2 D E ( play 1/8 notes in V1 against 1/16 in V2)
V1 OC4 B V2 F D V1 OC5 C V2 E C
V1 1/16 D V2 G ;
Note that it was only necessary to set the octave and duration for each voice once. The system keeps track of the settings for each voice for you, so you only need to change them when the music demands it.
You probably also noticed that I left out the MUSIC.ON MUSIC.OFF words. That's because we are going to use BACH1 in another word, in just a moment. You can hear the BACH1 word by typing:
MUSIC.ON SETTINGS BACH1 MUSIC.OFF
or you can make another word:
: PLAY-BACH1 MUSIC.ON SETTINGS BACH1 MUSIC.OFF ;
to do the work for you. You can use BACH1 to get almost two measures of this Invention (with slight apologies to JSB) like this:
: BACH2 MUSIC.ON SETTINGS BACH1 7 TRANSPOSE BACH1 MUSIC.OFF ;
BACH2 will play BACH1 and then repeat it again, a fifth (7 half-steps) higher, which is all Bach really did. Note that we could have easily changed the waveform or the envelope settings for the second measure if we wanted to. The possibilities for programming musical Forth words is limited only by your imagination.
Accessing SID's advanced features:
Blazin' Forth contains words that make it easy to access the special features of the SID chip, such as the filters.
HIPASS LOWPASS BANDPASS NOTCH
These filters specify the type of filter to be used. Note that SID will only allow one type of filter to be selected at once, but this filter will only affect the voices which are routed through it. You may elect to filter all the voices, or only one or two.
FILTER
This word routes the current voice through the filter. For example:
V1 LOWPASS FILTER
Will turn on the lowpass filter and route only voice 1 through it. The other voices are un-affected.
NOFILTER
This word stops the filtering for the current voice. For example:
V1 NOFILTER
Will restore voice 1 to its un-filtered state. Note that the actual filter setting is unaffected by this command.
RESONANCE
This word takes a number between 0 and 15 on the stack, and sets the resonance of the filter, with 15 being maximum resonance. Example:
15 RESONANCE ( set resonance to maximum)
CUTOFF
This word takes a number between 0 and 2047 which sets the cutoff frequency for the current filter.
Example:
Using our BACH1 example from above, we can play around a little with the filters, to see how they change the sounds that come out:
MUSIC.ON SETTINGS ( set it up)
V1 HIPASS FILTER 2000 CUTOFF 15 RESONANCE ( set up a highpass filter for v1)
BACH1 ( play it)
V2 FILTER ( filter both voices)
BACH1 ( play it with both filtered voices)
V1 NOFILTER ( don't filter voice 1)
BACH1
V1 LOWPASS FILTER
( setup a lowpass filter with the same settings, and send v1 thru it)
BACH1 ( play it - note that V2 is still filtered)
V1 NOFILTER V2 NOFILTER BACH1 ( play without filters)
MUSIC.OFF ( shut down everything)
As you can see, it is quite easy to access the SID chip using the words provided with the system.
MISC.
V3OFF
This word will disconnect the audio output of voice 3. It is usually advisable to do this when using the output of voice 3 to modulate the other voices.
OSC3@
This word allows you to read the output of the voice 3's oscillator. This can be used to modulate one of the other voices. Note that a waveform must be selected for voice three in order for this register to output anything other than 0.
ENV3@
Same as OSC3@ , but allows you to read the value of voice 3's envelope generator. Note that envelope parameters must be set, and voice 3 gated in order for this register to return anything other than 0.
TRANSPOSE
Takes a number on the stack, which determines the number of half-steps the following notes will be moved up. Note that only positive values will have any effect. Using TRANSPOSE can save memory (and typing!), since sections which are repeated in a musical work may be replayed in a different key with this word. 0 TRANSPOSE will restore the notes to their normal values.
Voice Modulation:
One of the most fascinating areas to explore with SID is the area of voice modulation. In order to modulate voices, it is necessary to modify the source code to some of the sound words in Blazin' Forth. The heart of the music words is a procedure called PLAY. By modifying this word, it is possible to dynamically change the quality of a note while it is actually being sounded, by modulating it or otherwise tampering. There are several examples of how to do this located on the source disk. Note that these screens should be loaded in the order presented below.
Screens 125-126 contain a demonstration of how to add vibrato effects. It is possible to vary the width and speed of the vibrato, to get many different types. To access this demo, make sure the disk is available (see MOUNT) and then type: 125 126 THRU . When the screens are compiled, the demo is executed by typing PLAY-LIKE-LYNN .
The next 3 screens contain sound effects demonstrations. Screen 127 has the words SIREN and CLAPS. To access these words, type 127 LOAD , and then SIREN or CLAPS .
Screen 128 contains an example of RING MODULATION. Type 128 LOAD and then BELL-SOUNDS.
Screen 129 contains an example of voice synchronization. Type 129 LOAD , and then SYNCH-DEMO.
The SID chip is a fascinating device, and the brief discussion here hardly does it credit. It is possible to generate really remarkable music and sound effects using these words with SID. If you need basic information on things like envelopes, waveforms, and filtering, I would strongly urge you to obtain a copy of the programmers reference quide.
*fp0
*lk:blazin.doc5
*hd3:Blazin' Forth Documentation,Graphics Support,-#-
*cn1;VIC chip Support*cn0
Blazin' Forth contains an extensive implementation of Turtle Graphics which supports all of the graphics modes of the 64, and is also by far the fastest turtle graphics implementation I have ever seen on this computer. I am particularly proud of this aspect of Blazin' Forth, and I hope you get a lot of pleasure out of it.
Turtle Graphics was developed by Seymour Papert of MIT as part of his Logo language, and it is an excellent way to explore computer graphics. The Turtle in Turtle Graphics is a graphics cursor, generally shaped like a triangle (shaped like an arrow-head in Blazin' Forth). You control the turtle by telling it to move FORWARD, or BACK , and as it moves, it draws a line. You control the turtles direction by giving it commands like RIGHT or LEFT. You can also use coordinates, through the SETXY command.
The graphics screen in Blazin' Forth is 240 turtle steps high ( screen coordinates 0 to 239) and 320 turtle steps wide ( screen coordinates 0 to 319). Wraparound, which is usually part of Turtle Graphics systems, is not implemented, since I think it's preferable to see part of a figure instead of a mess. The lines drawn by the turtle are therefore clipped. It should also be mentioned that the graphics screen does not take any of the memory normally available to Forth due to the intensive use made of the C64's powerful bank switching feature.