In this fourth tutorial, we continue our work with the StepSequencer.
In the text below, I am assuming you have completed my Tutorial A, Part 1, Tutorial A, Part 2, and Tutorial B, Part 1.
We continue using the same Kyma Tutorial Sound file we used in Tutorial B, Part 1.
Each section refers to a correspondingly-named Sound found in this tutorial’s Sound file.
6. USING SMALLTALK TO SAVE TYPING IN PARAMETER FIELDS
This section refers to the Sound named 6. Using Smalltalk to save typing in the parameter fields in Bart’s Kyma Tutorial #B – The StepSequencer.kym which can be downloaded from the Community Sound library.
Manually creating all those pitch and velocity switch widgets can get tedious, no? Fortunately there’s an easy way to produce gobs of widgets in Kyma. You can use a small amount of Smalltalk code to generate large numbers of controllers. You have already seen some Smalltalk code in the MIDIVoice. Bits of Smalltalk code are often behind the scenes like this implementing actions that would otherwise be tedious indeed.
TASK #1: Take an existing prototype where most of the parameters were generated using Smalltalk, and, one by one, copy/paste that code into the identical parameter field of your existing sequence from the previous tutorial (copied here). So, in the Prototypes, first open up the StepSequencer and the Step Sequencer 16-stage. Arrange them so you can compare the sequencer parameter field windows side by side. Note that the contents of the KeyDowns, KeyPitches and KeyVelocities parameter fields are vastly different between the two sequencers. In the 16-stage StepSequencer, Smalltalk is used to produce 16 separate widgets for keydown, pitch and velocity. Note the use of the Smalltalk message collect:
. It creates an array of values from the block of code contained within the square brackets. This is combined with the Capytalk message suffix2:
. Hover your mouse over the purple term to see what suffix2:
does.
TASK #2: Most important — Before you play the StepSequencer 16-stage, fully open or expand its Input Sound (what we called its recipient Sound in Tutorial #2). All of these Sounds should be familiar to you but this time they involve oscillators, not samples. Again we are looking for the recipient parameters for note triggering, pitch, and volume, same as in all the other tutorials here, so we can set them to !KeyNumber nn
(or !KeyPitch), !KeyVelocity
, and !KeyDown
. Remember that key events do not appear in the VCS, but you can mouse over each Sound to identify these recipient hot values and see how and where they are used.
Now for a slightly updated table representing what we just talked about in the StepSequencer Prototype:
SEQUENCER | SENDER MESSAGE (Sequencer) | RECIPIENT (Oscillators, AR) |
---|---|---|
KEY PITCHES | Smalltalk | !KeyPitch nn |
KEY VELOCITIES | Smalltalk | !KeyVelocity |
RATE & DURATIONS | !BPM/60 , Smalltalk | !KeyDown |
DUTY CYCLES | {0.9 * !Legato vmax: 0.01 s / !BPM bpm s} | Has no specific equivalent |
TASK #3: Note the expression in the DutyCycles field of StepSequencer 16-Stage. As you play the sequence and adjust the !BPM, each note gets shorter or longer according to the tempo. That’s what this expression does. Note how this interacts with the !Legato hot value. Everything has been neatly arranged already, thanks to the Smalltalk message collect:
, but you might need to activate the velocity switches for each step in the VCS, and set the !Interval for each step in the VCS.
TASK #4: Now back to the sending part of this Sound, the StepSequencer 16-Stage. Copy the expression from its KeyPitches parameter field and paste it into the KeyPitches field of 6. Using Smalltalk to save typing in the parameter fields. As always, every time you make a change in a parameter field you need to make the appropriate adjustments in the VCS and set some values, rearrange them as to fader type, size, location, and save them as a preset.
TASK #5: As you play the sequence, note that only 12 of the steps are playing. That is because you have only altered the KeyPitches field, not the other fields. So, now, go back and perform the same process with the KeyDowns, Durations, DutyCycles and the KeyVelocities fields, make the VCS adjustments (including changing the EndIndex value from 11 to 15), and again play the sequence.
TASK #6: Note that there is a discrepancy here in the tutorial between (A) the !Interval and !Sw areas and the (B) !StartIndex and !EndIndex. They are 1 step off. Knowing that everything in Kyma is mostly simple math, how would you adjust the StartIndex and EndIndex parameters to conform with the other two parameter fields? In other words, you would want StartIndex and EndIndex controls to begin at 1, not 0, and end at 16, not 15, even though the StepSequencer itself begins at 0 and ends at 15. Would you do this at the Sender end (StepSequencer) or the recipient end (Sample)? Figure this out and check with the answers tutorial. Hint: The Start and End parameter fields in the Sample refer to where in the sample file the Sample itself starts/ends, not the index number of the sequencer step.
TASK # 7: Let’s complete the task by adding !Stage to the GeneratedIndex parameter field of your Sound. When you play it you will need to edit it in the VCS choosing the “Radio Buttons (fill)” widget type and horizontally extend it. The numeric values would be 0, 15, with a grid of 1.
6. (ANSWERS) USING SMALLTALK TO SAVE TYPING IN PARAMETER FIELDS
Regarding the StepSequencer StartIndex and EndIndex, it is definitely done at the sequencer end because there is no place anywhere else to manipulate sequence steps. And why adding a minus 1 to each expression? Sequencers always start their steps with the “0” step. And so the “1” picked by the user as the first index step appears to Mr. StepSequencer as a “0.”
Note that I have arranged the velocity steps to conform with the pitch steps in the VCS so that all are aligned.
The lesson here is that the main StepSequencer parameter fields of KeyDowns, KeyPitches, KeyVelocities, can be broadly applied to control all kinds of Sounds (oscillators, samples, multisamples, spectrum samples such as SumOfSines, etc.) so long as these recipient Sounds have !KeyPitch, !KeyDown, and !KeyVelocity somewhere in their parameter fields.
Now, what happened to the GeneratedIndex parameter (which has a hot value of !Stage)? It is unable to accept an expression since it is a display field only. So no matter what you do it will not go beyond 0-15. So you can provide a 1-16 display to coordinate with the other widget stages by doing the following:
- Select the Stage widget in the VCS edit mode.
- Under the VCS editor Options drop down menu click Set Labels
- Set fader value change to 1.
- Select list as the labelling scheme.
- Clicking Edit, you’ll see a window with all the increments numbered. Simply change them to reflect what you want, in this case starting from 1 and going to 16.
7. EXTRA VALUES CONTROLLING SAMPLE START; SELECTABLE SOUND
Now for something a little different. So far, the StepSequencer has been used to control three areas: pitch, volume, and Sound triggering (with tempo), just as the MIDI keyboard does. In this example, only the triggering/tempo are used in the recipient ADSR !KeyDown. !KeyDown switches are also present, for more variety. Play the example, 7. Extra Values controlling Sample start: Selectable Sound, and try the various presets, which have the single guitar sample appearing magically in different repeated ostinato patterns. What is happening is that a sequence of six values is controlling the Sample’s Start parameter field, enabling it to start at a different point in the sample with each StepSequencer !KeyDown.
TASK #1: Now let’s look at this Sound in detail and examine the new hot values and expressions in some of the parameter fields:
KeyPitches: Note that there are no increments here, just a value of 60, which represents middle C on a MIDI keyboard and also the Sample playing back at its originally recorded rate.
Durations: This allows global control over the durations, allowing them to interact with the Rate as before in a slightly different way. [The tutorial has {1 s * !Dur}
in the Durations field; this could also be written as {!Dur s}
]
GeneratedIndex: This has been made into a hot value like that in previous tutorials. In the VCS, unlike most hot values, this one is for display only (!GE) and can not be used to control anything. It merely displays what step is currently playing. This is useful since you’re going to need some guidance when you change the ExtraValues values. [!GE behaves similarly to the GeneratedEvent in a SoundToGlobalController. So you could use !GE to control something in the Sound to the left of the StepSequencer. However, the most common use of the GeneratedIndex in the StepSequencer is to give you a visual indicator showing the current step.]
ExtraValues: This is the new kid in town. Mouse over its name and see what it does and how it needs to be implemented. The key here is the Sample parameter field Start, which specifies at what point of time within the Sample it will, well, start. Mouse over the Sample Start parameter field to see what it does. Now back to the ExtraValues parameter field. It has a very special syntax. You take the parameter you want to control (Sample start point) and enter it in parts like this:
#(
- the parameter you want to control:
!Start
- a list of values to control !Start: in this case I called them !L and numbered them from 0 to 5 and enclosed each in curly brackets to wit:
{!L0} {!L1} {!L2} {!L3} {!L4} {!L5}
- )
making the whole ExtraValues parameter field expression:
#( !Start {!L0} {!L1} {!L2} {!L3} {!L4} {!L5} )
[The format for the ExtraValues field is an Array where the first element is the EventValue you’d like to control, and each subsequent element is the value of that parameter on each successive step of the sequence. For example, #(!Start !L0 !L1 !L2 !L3 !L4 !L5)
. Curly braces are not required around the EventValues; however, they will come in handy when you start making further changes to them in Tutorial 8.]
So, when the StepSequencer runs, it steps through the values for !Start, resulting in a sequence of, not pitches or velocities, but rather Sample start points, which by definition must range from 0 to 1 with 0 being the Sample’s beginning and 1 being the Sample’s end. Note that, just as in the !KeyDown, !KeyVelocity, etc. parameters from the StepSequencer, the !Start hot value will not appear in the VCS when you play it. Rather, it’s steps will appear in the guise of the !L0, !L1, etc. hot values, which can then be altered just like any other hot value in the VCS as the StepSequencer plays.
TASK #2: Play with the !L0, !L1, etc. values, along with !Dur, !Rate, and !OnOff as the StepSequencer plays. Try some dice rolling to get all sorts of interesting (and some not so interesting) unforeseen combinations. The dice are just to the right of the Presets menu at the top of the VCS.
You can limit the widgets that the dice will influence by simply clicking on the widget’s label to grey them out. Note that this has already been done here.
TASK #3: So, you’re getting bored with the same guitar sample and want to branch out to different samples without closing this Sound and opening another. I have just the ticket, called SelectableSound. Go to the Prototypes and drag this just to the right of the existing Sample, incorporating it into the tutorial example. Remember, when searching the prototypes (using Ctrl+B), there is no space between “Selectable” and “Sound.”
While you have this Sound open, delete the existing second sound in the Inputs parameter field, Drone, (click on it and press “delete”). Now you’re left with your original Sample Sound. You want to have two more similar samples to select from, so you need to find a way to reproduce this Sample 2x with its existing hot values and expressions. To do this, hold down the Option (or Control) key and drag the Sample from the signal flow diagram into the SelectableSound Inputs parameter field. Drag it to the right of the existing Sample in the Inputs field.
Perform this operation once more, to make a total of 3 identical Samples. Now label the Samples by clicking on each icon in turn, pressing “Enter” and entering the new names in the window, namely “Sample 1,” “Sample 2,” and “Sample 3” accordingly. Then click “Accept” at the bottom of the parameter fields sidebar and they should appear in order from left to right.
Finally in the Selection parameter field change the expression to !Selection3, play the whole Sound, and, in the VCS edit window Ctrl+click on the Selection3 widget. Select Change range from the menu and change the minimum to 1, maximum to 3 and grid to 1.
Now, all you need to do is to find two more interesting samples to play with. They would need to be loops that change over time so you’d recognize the different start points as you play the StepSequencer. I would suggest samples from Samples Third Party/Sounds Good/New World Order folder, for example, bali and tabla. Now rearrange the VCS accordingly, save everything, and have fun with all the different settings in the VCS.
8. SPECTRUM SAMPLE PLAY W EXTRA VALUES
The next example, 8. Spectrum Sample play w extra values in StepSequencer, is a variation of Tutorial #7 but with a SumOfSines spectral resynthesis.
The StepSequencer is the same, but look at the SumofSines Sound and you see something different, namely in the TimeIndex parameter. The basic difference is that in spectral resynthesis Sounds [with certain settings, such as CtrlTime being checked in the SumOfSines], upon triggering, the Sound does not automatically play. It needs an additional value that moves through the spectrum file.
The ExtraValues parameter field of the StepSequencer is now being tied to !TimeIndex. But the TimeIndex parameter cannot be static, to sound natural it should move through the spectrum: hence the repeatingFullRamp:
. As you mouse over the purple message, note that it has exactly the same range of values as the TimeIndex parameter requires, -1 to +1, -1 being the start of the sample and + 1 being the end. As you may know from analog synthesizers, a ramp wave (or sawtooth wave) moves upwards steadily in value from -1 to a high point (1) and then abruptly crashes back down, to repeat itself. And so it is this moving low frequency waveform that is powering through the TimeIndex and playing the spectrum. And as all such purple messages, the repeatingFullRamp:
needs to be triggered in order to start on its path. The !KeyDown does this.
The other spectral parameter fields and expressions in the SumOfSines will be covered in the future Spectral Processing Tutorials.
This tutorial has no equivalent “Answers” twin.
9. ONE LITTLE TWEAK MAKES ALL THE DIFFERENCE
This is the same as the previous tutorial with one twist — one of those little tweaks that makes all the difference between boring and cool.
#TASK #1: We have focused on the ExtraValues parameter field in the previous section. To continue in this vein, your task is to take one of those steps — let’s say !L2, and vary it so that each time it sounds, a different start time will be used, resulting in a rich variety.
Knowing that you can make an expression within those curly braces (which are already there), what kind of Sound could you use that would vary over time? And what kind of variation would you want?
To answer the last question, note that in the VCS the L0, L1, etc. widgets have a range of 0 to 2. So you’d need something that varied, rather slowly, over the range of 0 to 2. Or at least had some variation in that range.
This is where a little Capytalk knowledge is critical, because very often by using Capytalk, your Sounds can go beyond the ordinary. So… let’s pause for a moment while you think of a Sound that you can paste into the !L2 expression in the ExtraValues field…
TASK #2: OK, many could be used, but we’ll use a very simple one, namely the Low Frequency Oscillator or LFO. Select the LFO found in the Prototypes, then copy/paste it to the right of the !L2 hot value but within the curly braces. Click “Accept” to pop up the LFO and double-click its icon to expose its parameter fields. (Do not play anything yet. Read on…)
All you need to be concerned about in the LFO is the two fields in red. !Modulation is already set as the output level, but the Frequency field should be changed for simplicity. Basically you want the LFO to be a time-varying entity that goes from 0 to 1 (or 2) at a speed you can control. So just make Frequency a hot value such as !LFOFreq hz
. That will make it cycle at a frequency of from 0 to 1 cycle per second, certainly enough time for it to influence the start point of !L2.
BACK TO THE STEPSEQUENCER EXTRAVALUES PARAMETER FIELD: Now, with Capytalk you can’t just have an expression (simplified as 2 or more hot values with some math) without some mathematical operation, right? First of all, ask yourself what is the numerical value of the LFO (all you need to know can be found by mousing over its title in its parameter field window). And you already know that the values from the VCS for !L2 range from 0 to 2. You just want something to nudge the values of !L2 automatically in a repetitive way.
There are many ways to combine these values, but we will stick to addition and multiplication for now. So you have two choices in this ExtraValues parameter field where !L2 now bumps up against the LFO between the curly braces — adding or multiplying these two hot values. Try out each. Remember that 0 times anything is… well… 0! But both will work, so choose the one that works best for you while playing the Sound from the rightmost icon and tweaking !L2.
My choice would be {!L2 * [LFO] L}
. Don’t forget to leave one space between each math operation on both sides:
What a difference a tweak makes!
Now on to the answers for #9.
9. (ANSWERS)
Note that the only thing you are controlling is the start time of the sample in six segments.
Remember, the third stage of the sequencer is the one being controlled by the LFO. All other of the segments are exactly the same.
TASK #1: If you like this, try the same thing with another one of the other stages. For example, two EventValues will increase the interest. Be sure to have a different name for the second LFO frequency hot value — maybe something like !LFOFreq1. Also, it would be good to name the second LFO (when it pops up after “Accept”) with a number as well to differentiate it.
10. CONTROLLING TIMBRE WITH !KEYTIMBRE
TASK #1 ORIENTATION: Open and play 10. StepSequencer controlling timbre with !KeyTimbre, selecting the Default preset. Look carefully at all of the sub-Sounds. All of the StepSequencer parameter fields should look familiar. What is new are the recipient Sounds, which are a collection of interacting oscillators and ADSRs forming a typical FM cluster (frequency modulation). The purpose is not to go into that in this tutorial, but suffice it to say that the traditional StepSequencer controls — the big three — as I call them, namely !KeyDown, !KeyVelocity, and !KeyNumber are appropriately present in this recipient cluster. So just assume that they are working properly.
TASK #2: SEQUENCING THE KEYTIMBRES: Now choose preset #1, which is set to all the same pitch in order for us to better hear the timbre sequencing when it happens.
Look at the KeyTimbres parameter field of the StepSequencer and read about what it does. What we want is a nice set of sequencing steps that can vary the strength of the CM Ratio of one of the oscillators (you don’t need to know what this means!)
Since most sequence arrays have values ranging from 0 to 1, let’s go to a previous tutorial, the #6 (Answers), and copy the expression from the KeyDowns or the KeyVelocities parameter fields — it doesn’t matter which. Then paste it into the KeyTimbres parameter field of this StepSequencer.
Now all you need to do is modify it to fit the occasion — 8 rather than 16 steps, and give it a name other than the existing !sw or !vel. How about !kt for KeyTimbre?
Now you are all set on the sending end.
TASK #3: TUNING THE RADIO: To stretch a previous analogy with the StepSequencer being the radio station and the FM cluster being the receiver, in order to tune this to “receive” exactly the one signal from the StepSequencer’s KeyTimbres, you need to type in, exactly, the hot value !KeyTimbre into the receiver Sound. Note this is not “Timbres,” but “Timbre.”
Where? Go to the Oscillator called “mod”, and in its Frequency field where you see !CMRatio, substitute the expression (!CMRatio * !KeyTimbre)
followed by the * sign and the rest of the expression, making the total expression
(!CMRatio * !KeyTimbre) * !FreqLow hz
Now, go back to the rightmost icon and play the complete Sound, again selecting the Default preset, which has no pitch variation. Clean up the VCS as usual. The Kt values should all be ok, defaulting to the 0 – 1 range.
TASK #4: As the sequence plays, experiment with the timbral frequency modulation section and note how, when you just tweak something a tiny bit, the whole sound is changed.
Also, try rolling the dice, which here will only affect the K… widgets since all the rest are greyed out. Save a few of your favorites as presets. This is one area where almost anything you roll sounds good!
Go on to the #10 Answers Sound. There is no text for that.
This concludes the StepSequencer tutorials. Up next: Creating Patterns Outside the StepSequencer (coming soon!)