After completing the previous version of this piece on January 4, I thought it would be neat if I added the ability to slide some of the notes in the bass flute. Little did I know it would open up dozens of bugs in my python code. It took me a month and a half to sort out the issues. But now I can include slides in arbitrary note strings.
I had already created the ability to enter specific streams of notes in a text string.
inputs_array_64 = "n0o4u0e1v69d12 n3d4 n4 n5 n6o0 n7o4 d6n0 n1 n3 n2 n4 e8v78d1n6 n7"
This is similar to the way my old Pascal code worked. I specify notes with letters for each of the six features each note possesses:
- n: note number, a number from 0 to 7 for the scale degree, which is later translated into one of the 256 note numbers in my 214 note tonality diamond array. In this example, we start with n0, for the first note in a scale, move to n3, the fourth note in the scale, and so forth. If I change the root key of a scale, then the notes choose different notes in the 256 note diamond.
- o: octave, a number from 1 to 8. Zero is used to indicate that the note is silent. The fifth note is silent in the example above.
- u: up sample, which causes the program to use a different sample than the one calculated based on the equivalent MIDI number. For example, each sample set has six distinct samples per octave. C4 uses one sample, and D4 uses the next one. Sometimes I want to pick a higher or lower sample for a more sharp or mellow sound. More on that later.
- e: envelope, which is where I pick the envelope to be used. I pre-made several envelopes in csound and then specify which to use. e1 is on-off, e8 is fast decay, and e2 is very fast decay. I use the latter for the baritone guitar samples.
- v: velocity, which is used to indicate how hard the key is pressed. This is used to choose a sample that matches the preferred pressure. I use that if the sample set supports different samples for different loudness levels. This is important with piano samples especially. It also affects the loudness in the absence of samples that don’t provide different loudness levels.
- d: duration, which is how many time steps the note should be played.
My latest enhancement was to add a new feature, the glissando. The value for g indicates how many time_steps should be combined to have a continuous glissando between notes. See it’s use in the next example:
inputs_array_64 = "n0o4g0u0e1v69d12 n3d4g12 n4 n5 g0n6o0 n7o4 d6n0 g18n1 n3 n2 g0n4 e8v78d1n6 n7"
In this example, we start off with g0, which means no slide. Then on the second note, we have a glissando over 12 time steps. In this case that includes the notes n3, n4, and n5. I then create a function table that transits those notes over 12 time steps. Then in note five, we reset to g0 for no glissando. Note 8 starts another glissando over 18 time steps. I build a slide that transits n1, n3, n2, since each note has a duration of 6 time steps. The result is relatively simple to slide wherever I want in the scale. My code calculates the closest note automatically, changing octaves to do so when it would result in a smaller slide.
One of the consequence for glissandi on samples that already have vibrato is that a slide up by a whole step results in a speed up of the vibrato. This can get annoying if the distance traveled is several steps. My code automatically compensates for this “muchkinization” effect by changing the up sample feature in the background to avoid this effect. In this way, rising or falling glissandi don’t have mistimed vibrato. If I want, I can deliberately set the up sample feature to higher or lower samples. In the case of this piece, the bass flute part is played by four different flutes, with four different up sample values: -1, 0, +1, +2 from the calculated sample.
Glissandi can have many other controls, including how long to spend on the slide compared to the destination note, different durations to stay at different notes, different velocities for different notes. I’ve not yet implemented these controls in the text input file, but I have them buried in the code for later exploitation.
Listen here: