Arpeggiate the BBC
More music software from Gary Herman — an arpeggiator for the BBC micro
This program reproduces on a BBC computer (model A or B) the arpeggiator function familiar on many synthesizers. It is especially intended for those who don't already have arpeggiator synths or as a complement to such synths. Although tunable (by altering the variable BASE in line 10), it has neither the tonal depth nor the quality of a professional arpeggiator synth. However, the results of using it are good enough for effects, fills and rhythmic accompaniment. In some respects, the programme, called, impudently, 'Arp' — is an improvement on many dedicated devices, since it can produce a range of flanging-type effects and also responds — unlike many synthesizers — to the order in which keys are pressed. With suitable modifications, it can, of course, be used as a subroutine or procedure in a longer synthesizer program.
Arpeggiators, for those who don't already know, take a keyboard input (usually up to three or four notes) and create output in the form of an arpeggio or sequence of separated notes. The opposite to an arpeggio is a chord (sometimes a dischord). Arpeggiators usually have a variable rate (represented by the time gap between notes), direction (ascending or descending notes) and range (playing the same notes over one or more octaves). Arp has all these features: rate is adjustable to give clearly separated notes, harp- or mandolin-like effects or anything in-between. Direction is determined by the order in which the notes are originally played and range is from one to four octaves.
The programme uses READ...DATA and keyboard input routines (lines 30 and 310 and lines 160 to 210 respectively), which should be familiar from programs in previous issues. These allocate key-codes of the top two rows of the BBC's Qwerty keyboard to an array, A(X), and then check to see whether any of those keys are being pressed. If they are, the appropriate pitch is determined and is placed in an array FREQ(T). T is defined as a number, base three, plus one (see line 180), which means that its values can only be 1,2 or 3. It's value represents the order in which keys have been pressed and it counts up to three and then starts again. If two or three keys are pressed almost simultaneously, they are renumbered as a group before the program moves on to its play section (lines 220 to 290). If the player pauses between notes, the INKEY (0) in line 200 ensures that the programme moves directly to the play section.
The play section plays the notes in order — the first, FREQ(1), on channel one, the second and third (if there are any) on channels two and three respectively (see lines 240, 250 and 270). Line 260 sets a delay between each note — adjustable for different arpeggio rates. The parenthetic FOR...NEXT loop (lines 220 and 290) sets the range, ensuring that the notes are played in their original octave and in up to three octaves above that (the variable which sets the number of octaves is G). Line 280 checks to see if a key has been pressed during the time in which the notes are playing. If not, the arpeggio is repeated (a feature which is often called 'hold' on synths and which gives a rhythmic effect beloved by contemporary synth bands and composers like Philip Glass). If a key has been pressed, the whole process effectively starts again.
The main body of the program begins at line 40 and repeats from there. This line calls a screen display procedure (lines 320 to 430). The procedure call is followed by lines 50 to 140 which set up the BBC's red function keys to change the characteristics of the arpeggiator: f0 halves the rate and f1 doubles it; f2 turns the hold feature off, allowing you to end a repeating arpeggio without playing another note ('HOLD' is automatically turned back on when any musical key is hit); f3 sets the range, from one to four and back to one with each press; f4 to f9 set the ADSR envelope characteristics of the notes played using the BBC's conventions. Thus f4 and f5 set attack and decay target levels (ALA and ALD in the BBC manual), while f6 to f9 set attack, decay, sustain and release steps (AA, AD, AS and AR in the BBC manual).
On running Arp, the rate and range are both set at one. Everything else is initialised at 0 and you will hear no sound on pressing a key until at least 'attack target' or 'attack step' have been given non-zero values. Typical screen displays for arpeggio effects are:
RATE: 4 8
HOLD: 1 1
RANGE: 3 2
NOTES: 2 3
ATTACK TARGET: 112 112
DECAY TARGET: 0 24
A STEP: 8 24
D STEP: -8 -112
S STEP: 0 0
R STEP: -1 -1
There are a wealth of possible effects, and experimenters might consider utilising the BBC's noise channel (channel 0) to produce repeating percussion patterns as well as musical notes — although the right settings on Arp as it stands can create some intriguing percussive effects.
Feature by Gary Herman
mu:zines is the result of thousands of hours of effort, and will require many thousands more going forward to reach our goals of getting all this content online.
If you value this resource, you can support this project - it really helps!