In this tutorial, we look at other ways to generate patterns in Sound parameter fields.

Before beginning this tutorial, please download the Kyma Tutorial Sound file that contains the Sounds discussed below. Completion of Tutorial A and Tutorial B is highly recommended, since basic procedures (such as decluttering the VCS) covered in these tutorials are not repeated in any depth here.

I would welcome feedback on these tutorials to enable me to make them even more clear than they are. I have set up a special email account for this purpose.

Barton McLean, 2/22/16

Each section refers to a correspondingly-named Sound found in this tutorial’s Sound file.

INTRO: The StepSequencer is the most versatile and obvious choice as the vehicle for generating patterns of notes or values. But many other means of pattern generation exist in Kyma, and we will explore a few of them here. Some will go where the StepSequencer does not. As in other tutorials, this one is merely an introduction detailing the tip of the Kyma iceberg. It goes without saying that, whenever you make a new hot value or expression resulting in a widget appearing in the VCS during play, you will need to go into that VCS and make the appropriate adjustments as to widget positioning and values (see Tutorial A).

[Each of the headings below corresponds to a Sound with that same name in tutorial Sound file. You can leave this window open to read along as you look at the Sounds and do the tasks in Kyma.]

#1: !Gate pulsing pitch array

You are given a simple oscillator with familiar parameter fields. Here is what you need to do: Make a Sound that can be gated manually (i.e., turned on and off) via an envelope and every time you press the Gate button, it will proceed to the next pitch. So you have two types of procedures: gating and pitch incrementing. Before proceeding further, try this on your own and see how far you can get. Hint: better to do each procedure separately and begin with the envelope-gating by copying/pasting an ADSR into the Oscillator Envelope parameter field.What follows are the specific steps you could take to achieve this goal.

TASK #1: Beginning with the manual gate, let’s use the traditional ADSR so we can gate the Oscillator. From the Prototypes (Ctrl+B), copy the ADSR, paste it into the Envelope parameter field, and click “Accept.” Play the Sound. You will get silence. Why is that? (Hint: look at the ADSR). Yes, the Gate field has a default !KeyDown which means that you would need a MIDI keyboard (or the Fake Keyboard from the Tools menu) to gate the Sound. But we want to start the Sound manually, so in that ADSR Gate field, substitute an exclamation point, which will auto-fill with the hot value, !Gate  (be sure that the !KeyDown hot value is selected so it will erase when you do the auto-fill). Also, in the Scale parameter field, you can’t use the !KeyVelocity hot value because there is no keyboard, so just substitute a value of “1.” Now play the Sound and press the Gate button in the VCS and make any adjustments necessary.

At this point you can gate the Sound on and off. Now to investigate how you can increment several pitches with this gate button.

TASK #2: Pitch incrementing. The key to this is the Capytalk message of:. Before proceeding, refresh your understanding of Arrays by reviewing Kyma X Revealed, starting on page 248 as well as looking up of: in the Capytalk Reference (Ctrl+H). We will keep the !LogFreq smoothed in the Frequency parameter field, and move the nn to the end of the expression. So, we need two elements to increment the pitches. First, we need an incrementing device with its trigger. So, we will use the familiar !Gate as the trigger and add to it the incrementing message countTriggersMod: and since we arbitrarily want six pitches we will put a “6” after the Mod:. All this as a way of providing the incrementing device (look up countTriggersMod: in the Capytalk reference). Now we need the actual pitches, and this is where the of: message comes in. In an of: expression, you have a trigger followed by an Array of the form #(!FirstValue !SecondValue !ThirdValue) etc. We will use the countTriggersMod to bump the of: to go to the next value in the Array as soon as the Gate is pressed. The Mod part of countTriggersMod: expression wraps around to 0 when 6 has been reached.

Here is the whole expression in the Frequency parameter field of the Oscillator:

!LogFreq smoothed + ((!Gate countTriggersMod: 6) of: #(!Interval1 !Interval2 !Interval3 !Interval4 !Interval5 !Interval6)) nn

Screen Shot 2016-02-11 at 3.13.17 PM


Note that the !Gate button is shared in two places; the ADSR Gate, and in the Frequency parameter field of the Oscillator. One hot value, two places.


Before attempting this, brush up on arrays and sequences of values in Kyma X Revealed, p. 250.

TASK #1: See if you can make the manual incrementing automatic by using the traditional bpm: message and the !BPM hot value. Hint: remember, it is replacing the !Gate.


Note that another set of parentheses had to be placed around (1 bpm: !BPM) in the Oscillator Frequency parameter field since it needs to be seen as a complete unit. Note also that the !Gate had to be replaced in both the ADSR and the Oscillator.


By now this same repetition is becoming boring, right? The next few tutorials will seek to enable you to put more variety and interest in the patterns you create. Your challenge here is to use an LFO to vary the speed. Keep in mind that you are dealing with two processes here — gating the Sound on and off, and coordinating this with the pitch changes. One without the other may result in unexpected results. See if you can figure this out on your own before proceeding. Hint: look for the parameter fields where the on/off takes place and where this is reflected in another parameter field.

TASK #1: Varying the on/off gating. Starting with gating the Sound in the ADSR, copy an LFO from the Prototypes and paste it just after the !BPM. Remember that you can never have two hot values (or a hot value and a pasted Sound) side by side without some math operation in between, so let’s consider doing some addition or multiplication. Think for a moment about values of each VCS widget. The !BPM is set at a value in the hundreds in the VCS. The LFO will be modifying that, either by addition or multiplication. The Frequency of the LFO, after we set it up below, will range from 0 to 2. So, would it be more effective to, say, add 1.5 to a !BPM that might be 300, or would it be more effective to multiply that 300 by 1.5? You might try it both ways (once the LFO is set up), but my preferred approach is to multiply one with the other. Here is the Gate parameter field expression in the ADSR:

Screen Shot 2016-02-11 at 3.15.39 PM

Now play the Sound. Note that there is no coordination between the on/off gating and the pitch change. Chaos reigns.

[A note here about my above statement “try it both ways.” Kyma has an extremely rich set of possibilities, and there just is not enough room in any tutorial or manual to cover them all, or even a large number. So when I first started learning Kyma, my most valuable tool was my own experimenting; setting up conditions with varying Sound expressions, VCS values, math operations, etc.  This culture of self experimentation is really necessary if one is to learn Kyma in any depth.]

Refer to Sound #3a for the answer so far.

TASK #2: Coordinating pitch with on/off gating. Open 3a (Answers). Look at the Gate field of the ADSR. Note that it still has the !BPM field tied to the LFO. So all we need to do is to duplicate this in the Frequency field of the audio oscillator to achieve perfect coordination with gating and pitch change.

The final expression in this audio oscillator field looks like this:

Screen Shot 2016-02-11 at 3.16.59 PM

And the solution for this is in Sound # 3b (Answers). I copied/pasted the LFO from the Sound, not from the Prototypes. You might want to move the LFO up to see that it does indeed go to two different places.

TASK #3: The LFO made independent from !BPM. Open Sound 3B (Answers). Now let’s look at the newly – emerged LFO. The prototype’s Frequency field expression is: !BPM * 0.001 hz. OK, play the Sound (always play a Sound from its RIGHTMOST icon or to first click in an empty area of the signal flow editor before pressing the space bar to play). Note that the pitch changes and the on/off gating are perfectly coordinated, due to the fact that the default frequency expression of the LFO is tied to the !BPM, as it also is in the Oscillator Frequency parameter field. But this is still a bit boring. What would happen if we made the frequency of the LFO independent of the !BPM frequency of the audio oscillator? Let’s see. In the LFO Frequency parameter field, enter a hot value that has the standard range of 0 – 1. Let’s say, !LFORate hz Now play the Sound again.

Note that you now have perfect coordination but also with an additional control of the !LFORate allowing for more variety in the rhythms as you juggle this and the !Modulation widget and the !BPM.

Go to Sound #3c (Answers) to verify this and check your work.

[In the VCS I have changed the !LFORate values to 0 – 10 to give more variety. Additionally in the Frequency field of the audio oscillator I have kept everything corresponding to MIDI note numbers (nn) whereas in the Frequency field of the LFO, the frequency is specified in hz (cycles per second). Why is that? Because it is a LFO and we don’t need frequencies above 10 hz, whereas to specify the audio in hz would be overly cumbersome since we’d be dealing with values in the hundreds and thousands, rather than the simple MIDI note numbers of 36 – 96 representing the traditional 60 – note MIDI keyboard. Note also that in Oscillators, the output level parameter field is called Envelope whereas in many other Sounds the output level is called Scale. These two terms are synonymous in that they both describe output volume, usually in the range of from 0 to 1 or -1 to 1.]


Buried in the Prototypes is a Constant Sound called SequenceOfValues. Find these using Ctrl+B. Actually there are two Constants, one for pitch and one for volume. We will explore them and their use in generating patterns. Before proceeding, open one of the Constants and learn what they are and how they are used (basically as a container for any expression, hot value, Sound, or number in the range of -1 to 1) by hovering the mouse over the headings.

TASK #1: Play the Tutorial, which has straightforward hot values you have seen many times before. Your task is to copy these two constants, one for pitch, one for volume, in the appropriate places so as to develop a mini pattern sequencer of sorts. So, where would you put them? Go through a process of elimination to find their destinations. Stop here and try to figure out where they go before proceeding… DON’T PEEK!

The pitch constant was a no-brainer, because there is only one place between the two Sound icons where pitch is controlled, namely in the Frequency parameter field of the Oscillator. So copy the SequenceOfValuesP Constant and paste it there. Note that there is already a hot value in that spot, the !Interval. We will leave it in place and past the Constant between that and the final nn which designates MIDI note numbers. Below you will find the whole Frequency parameter field expression. Note that there are some bells and whistles added. I thought it might be instructive to use the values given in the Constant for the p increments, which are from 0 to 1, and convert them to discrete MIDI 12 note octave pitches. First, in the Frequency parameter field, I had to multiply the Constant by 50 to bring it in the approximate range of the 36 – 96 MIDI note numbers (I arrived at 50 just by experimenting). Two sets of parentheses were required to gather together like expressions.

[Editors note: To translate numbers in the range of (0,1) to the range (36-96), multiply by the range and add the minimum number as the offset.  In this example, we would multiply by the difference between the highest and lowest MIDI note number and add the lowest desired MIDI note number.  So the expression would be (SequenceOfValuesP L * (96 – 36) + 36) nn].

[See the discussion of parentheses in “Kyma X Revealed,” p. 244]

So far you would have had notes alright but they would not be 12 notes to the octave. That’s where the Capytalk message rounded comes in. rounded simply rounds any math operation result to whole numbers, and the nn message assures that, if those numbers are within the MIDI range, they will fall somewhere within the traditional chromatic scale. Now back to the original expression contained in the Constant. As far as I can see it is in error in that it multiplies !End by 8. When I try that, I get nowhere, so we are going to delete that portion from the expression, leaving the following:

(((1 bpm: !BPM) countTriggersMod: !End reverse: !Reverse) + !Start ) of: #(!p1 !p2 !p3 !p4 !p5 !p6 !p7 !p8)

[If you like, you can copy the whole expression from this text and paste it into the Constant. This is true of any tutorial text expression that does not contain the yellow pasted Sounds in it.]

The volume Constant would be similarly copied and pasted into the Scale parameter field of the ADSR, replacing the “1” that is there. Once again, we are going to eliminate the “* 8” portion in the Constant, leaving:

(((1 bpm: !BPM) countTriggersMod: !End reverse: !Reverse) + !Start) of: #(!v1 !v2 !v3 !v4 !v5 !v6 !v7 !v8)

Now play the Sound. You will need to go into the VCS and change the !Start range to 0, 8, with a grid of 1. Change the range !End to 1, 8, and its grid to 1.

The eight pitch values can be arbitrary, but by experimenting you should be able to find something you like. When you do, save it as the Default.

[Save the Default preset in the VCS play mode, not the edit mode.]

The volume widgets (!v1 !v2 !v3, etc…) can similarly be adjusted.

One further note. Because of the way the expression is written, the only way to get all eight notes is to set the !Start at 0, and the !End at 8. But by schlepping around the !Start, !Reverse, !End during playback, you can get some pretty interesting patterns. Also experiment with changing the v values for variety.

This concludes Part 1 of Tutorial C.  Please go on to Tutorial C, Part 2 using this same Sound file.

Tagged on:

Leave a Reply