Iseq Tutorial ------------- Stephen Judd sjudd@ffd2.com http://www.ffd2.com/fridge/iseq/ last revised: April, 2002 Introduction ------------ Iseq is, of course, a music program for the Commodore 64. I tried to make it pretty easy to use and fun to play around with, as well as efficient and powerful, based on my experiences using (and writing!) Tunesmith, as well as conversations with many other music composers (Antti Pinktamen, CreamD, daBlondie, Dokken, and surely many others). The purpose of this tutorial is, of course, to show you how easy it is to get going with Iseq, and to get used to some of its features and philosophy. The first thing to do is to start making sounds, and playing with the instrument and arpeggio editors, which is what the next section will describe. Then it's on to making tunes, and finally to using those tunes in a program. Note that at any time you can press CTRL-h for a list of keys and their functions. Creating Instruments -------------------- The _player_ plays notes -- it sets frequencies, counts durations, and manages what is active and what isn't. An _instrument_ defines how those notes will sound -- what type of waveform will be used, sound fx like vibrato, etc. To make more complex and interesting sounds than the basic SID waveforms, an instrument must modulate SID registers. Iseq -- which stands for Instrument Sequence -- got its start from the idea that everything in a music program is a sequence of values -- notes, player directives, SID values, etc. In the case of an instrument, a set of values, modulation schemes, and so on are written to SID, in order to produce certain sounds. In Iseq, an instrument is created simply by specifying a set of values to be written to SID registers. So, when you press F5 to enter the instrument editor, you will see a screen like the following, containing a list of SID registers and a few other things: d415 [] d416 [] d417 [] d418 [] atdk [] surl [] freq [] pwid [] creg [] frq+ [] gate [] fixf [] 0000 [] type amp fr ph type amp fr ph + sin 0100 00 00 + sin 0000 00 00 + tri 0000 00 00 + sin 0000 00 00 + con 0000 00 00 + sin 0000 00 00 Again, sounds are made by writing to and modulating SID registers, so in Iseq you simply specify what gets written to each register -- specifically, by specifying the _type_ of sequence to be written to a register, and the _values_ for that sequence. We will start by writing single values to each register, to produce a sound. 1. Simple sounds To begin, press '=' to enter the "sequence type" editor. From this screen you can specify the type and length of sequence to 'attach' to a SID register. To make a simple sound, we need to set two registers: the the sustain register (surl), and the control register (creg). (We should really set the attack/decay register, but it defaults to zero.) Cursor down to the surl and creg entries, and press '+' to change the sequence type. You should then see a line like surl: one-shot sequence len=1 for each register. This means a "one-shot" sequence (written once, as opposed to a "continuous" sequence which continually loops) of length 1, i.e. LDA value STA register Do the same thing for the "gate" entry also, for a total of three sequences. Press the backarrow <- key to exit. The screen will flash as the instrument is compiled into the player. Once you are back at the "sequence value" editor, you set values for the selected parameter by pressing cursor-right. Set the values as follows: surl [f9] ;sustain = 15, release = 9 creg [21] ;waveform = sawtooth, gate on gate [20] ;waveform = sawtooth, gate off When a note is played -- in this case, when a note key is pressed -- the surl and creg values will be written to the appropriate SID registers. When it is time to turn the note off -- in this case, when the note key is released -- the "gate" value is written to creg (e.g. $d404). The "gate" value above simply turns the gate off and keeps the waveform at sawtooth (a value of "10" would turn the gate off and switch the waveform to triangle, by contrast). Now, simply press a note key: w e t y u o p a s d f g h j k l : ; Where a is the note C, w is C#, s is D, and so on. When you release the key, the release cycle should begin. Try changing the "gate" value to 10, the sustain and release values, and so on. The "notekeys" above are played in a "base" octave, displayed on the screen. Pressing + and - will change that base octave. Moreover, pressing shift-notekeys will play the notes one octave up, and C= will play the notes one octave down, so there are effectively three octaves available for each "base" octave. That's it, a simple instrument! To name this instrument, press ctrl-i, then press cursor-right and type in a name. Press backarrow <- to exit the instrument selector. 2. A simple arpeggio We might as well create a simple arpeggio to go with the simple instrument. Press ctrl-a to enter the arpeggio editor. Arpeggios are very simple: simply cursor down to the arpeggio you want to define, use shift+ and shift- to change the length, and use cursor-right to enter in values. For this example, cursor to arpeggio 1 and set the length to three. Then press cursor right, enter 0 4 7 and press return. These values should now appear in brackets. Now press a note key and voila -- instant major arpeggio. Change the values to 0 3 7 for a minor arpeggio, etc. To change the arpeggio speed, press CTRL-0 through -9. To change the arpeggio type (one-shot vs. continuous), press !. To name the arpeggio, press '=' to go to the alternate arpeggio display, press cursor-right, and type in a name. Press '=' again to toggle back to the value editor. Press backarrow <- to return to the instrument editor. 3. Ramps Now let's do something a little more fun. From the instrument editor, press '=' again to go to the modulator editor, and select "continuous ramp up" for the "freq" parameter. You can press "!" to quickly switch between continuous and one-shot. Then exit back to the value editor. At this point, you should see something like freq [0000 0000 0000] A ramp needs three values: a start value, an end value, and a step value. As you would expect, it will generate a series of values, starting at start and ending at end, constantly adding the step value, like a FOR-NEXT-STEP loop. Press cursor-right to edit these values; the cursor keys will let you move back and forth, and the back-arrow to exits. Go to the first value, and type "0000" -- this will start the frequency at 0. Go to the second value, and type "9000", to end the frequency at 9000. (That's right, just type it in; you can also use + and -, shift+, shift-, and < and > to change the values, or press return. Negative values are OK too.). Finally, change the third value to "100" or so. Now press "*" -- * is the key to toggle a note on or off; the difference between * and a key like "a" is that "a" specifies a frequency, whereas * just starts the note up. Since we are modifying the frequency directly, keys like "a" won't be any different. You can press * while editing a sequence, or from the main screen. The frequency should be doing what you expect -- sweeping up in frequency. Now for some fun: enter an end value of "ffff", and a step value of "4321". Neat, huh? Try some different steps. Also try changing the waveform (set creg to "11" for example, and press * twice to restart the thing). 4. Adders An "adder" is like a ramp, combined with a sequence. An adder simply adds values to a starting value (continuously -- there are no "oneshot" adders). For example, to duplicate the ramp effect above, use an adder of length 1, set the start value to 0, and the seq value to "4321" -- it will just keep adding 4321 to the running value. What makes adders special is that they can add a _sequence_ of values to the starting value. For example: start value=0 sequence = 1 2 3 would generate the sequence of values 1 3 6 7 9 12 13 15 18 ... by first adding 1 to the start value, then adding 2 to that value, then 3 to _that_ value, and so on. Just think of it as another effect generator, and you'll be ok! 5. Using the sequence generator Press '=' once again to edit the seq types. Choose "" for freq and choose a continuous sequence of length 20 for the "frq+" parameter. To do this, choose "continuous sequence" using the + and - keys, and change the length using shift+ and shift-. Then go back to the main screen. "frq+" means to modulate the frequency using a _relative_ sequence; that is, the frq+ values will be added to the "base" frequency -- the frequency set by the note, like "a" -- and stored in the SID frequency registers. A simple example is vibrato; whatever note is played, we want to wiggle the frequency around the base frequency. First press the lira-key, to make notes "stick", then press "a". The note should keep playing when you release the key. Depending on the values in frq+, the results might sound weird. Sequence values can be edited by hand, as in example 2, but for this example we'll use the sequence generator. Cursor down to the "frq+" parameter, and press shift-return. This will put you into the "sequence generator", at the bottom of the screen. The idea of the sequence generator is pretty simple: create a waveform by adding together several different waveforms. There are six "generators". For each generator you can select a type of waveform, the amplitude of the waveform, the frequency of the waveform, and the phase, or offset into the waveform. You can also select whether to add or subtract the waveform from the total. For now, we'll just use one waveform. The cursor keys move around the different fields, and the + and - keys change the value of the field (and so do shift+ shift- < and >). First, choose a triangle waveform (or a sinusoid if you want). Then go to the amplitude field, press shift+ to increase the value a couple of times, to 100 or 200 or so (you can also use < and > to double/halve the value). Then try some different frequency values. You should hear the note start to wiggle around. As always, CTRL-H from within the sequence generator gives a list of keys, and pressing back-arrow exits. You might try modulating the pulse width similarly (creg = 41). That's pretty much all there is to creating instruments. The CTRL-h help screen gives a listing of all the SID registers and their bit functions, in case you don't know them already. Before we end, though, there are two parameters which haven't been discussed: "fixf" and the funny "0000" parameter. Fixf stands for "fix frequency", and is used for things like a combined drum and bass, where the first two player calls might be a noise waveform at high frequency, then changed to a pulse waveform at the original frequency. Fixf is used to restore the frequency after a certain number of player calls. For example, the drum+bass instrument might be defined as: freq [9000 9000] creg [81 81 41 41] fixf [2] This will restore the original frequency, whatever it is, after two player calls. The "0000" parameter is a user parameter -- you can set it to whatever you want, from the seq type editor screen (the '=' screen), using the # key. For example, to change the border color, it can be set to d020. This parameter is useful for syncing a program to the music, for example. And that's about it -- now it's time to make a tune. Editing Tunes ------------- First, set the instrument back to something simple, like surl [f5] creg [21] gate [20] and press the backarrow <- to return to the tune editor. If you need to clear the tune editor, press shift-clear. Press F3 to edit a tune sequence. As usual, the cursor keys will let you move around. Cursor to one of the note folders (e.g. A). First, press backarrow (or insert or pretty much any key) to start a sequence. This will enter an "end sequence" value. Next, choose an instrument by pressing ctrl-i; select whichever instrument is defined as the simple one. (Remember that you can rename instruments by pressing cursor-right from this menu). Next, set a duration. Press ctrl-d, and a similar menu will come up. Press cursor-right to enter a duration value, enter "12", and press return. The duration may also be set using 1-8 and shift 1-8, but values are set only through ctrl-d. Then exit the menu using <- or return. The screen should look something like: A: inst dur <- Now, enter some notes. For example, a c-major scale would be asdfghjk When done, cursor up to edit a tune sequence. Cursor to "v1" and type "a". The screen should look like: v1: A stop Now press ctrl-p -- voila! Press ctrl-p again to halt the playing. Next, cursor on top of the "A" and press shift-g to set the gate delay; enter 2. This will start the gate release two counts before the end of the note. Now, when played, the notes should be a little more separated. Try a few other things: after the A, use shift-T and enter a transpose value of "1", then press A again: v1: gate A trans A stop Now it should play the note sequence, then play it again transposed up a half step. Note that if you transpose all notes in all voices, you change keys. Finally, cursor over to the "stop", and press backarrow <-. This will set a loop. Use the cursor left/right keys to select the first "A", and press return. Now if you ctrl-p the tune will continuously loop. Note that since the transpose value was never reset, it will keep playing at the transposed value. Which brings us to the following: IMPORTANT: if you add values inside a loop, you _must_ reset the loop value. The loop value above is set to -3. If you enter more stuff in, that loop value is still at -3, and will loop to the wrong place. (You can even get into infinite loops this way, at which point you'll have to press rs/restore to reset). And that's all there is to it: define instruments, enter note sequences, combine note sequences into tunes. Single-stepping --------------- Single-stepping is a handy editing feature. Try cursoring down to the note sequence you've written, and press '.'. You'll notice that the note is played and the cursor advances; therefore, pressing . over and over will step through a note sequence, one at a time. It is often much easier to find your place in a tune using your ears instead of your eyes! Moreover, it is possible to let single-step "operate" on the note data. Right now, the only operation is transpose. Why is this useful? Let's say you've written something, and then decide you really want the notes all down an octave. All you have to do is set a transpose value of -12 (using ctrl-shift-S), and single-step through all the notes. Thus endeth the tutorial.