kyma•tweaky . How . CreatePitchesInSmalltalk

Question (or Task)

I want to be able use Smalltalk scripts to generate sequences of Midi note numbers (generally for use in a MidiVoice? prototype). The primary motivation is to be able to generate predictable fractional midi note numbers for microtonal output. (So Midi sequences would not be as useful.)

One useful model script would be one that generate a simple predetermined list of notes at a given duration and speed. So on compile my sound would trigger polyphonic notes 60 60.5 61 61.5 62 62.5 63 in sequence with a duration of say 5 seconds for each note and 0.5 seconds between triggers

Another useful script would be generate a simple pattern notes (or intervals) from a given starting note. So it might have a variable ... or a given starting reference point and then calculate and trigger a series of notes based on that starting note all with constant duration and a set time between triggers.

These would probably be enough to get me started. And actually ... for the sounds I'm working with at the moment, having the script establish a note duration is not really an issue, since all the sounds are percussive and will die away independently.

(Please ... can we find way to get MIDI notes to be a part of Kyma timelines?)

-- MarkPhillips - 24 Aug 2010

Solution(s)

I'll give a short answer here a refer you to Kyma X Revealed on page 269, the chapter called Algorithmically Generated Scores for the full details (You can access the manual from the Help menu in Kyma). You can also find several Sound examples in Kyma Sound Library:Scripts:MIDIVoice scripts.

To create your first model, you could use the following in the Script field of MIDIScript:

| p t |

p := #(60 60.5 61 61.5 62 62.5 63).
t := 0.

p do: [:pch |
   self keyDownAt: t s duration: 5 s frequency: pch nn velocity: 1.
   t := t + 0.5].

self controller: !Volume setTo: 0.5 atTime: 0 s.
self controller: !Volume slideTo: 1 steps: 60  byTime: 60 s.

Your second model sounds like it might be better implemented using an AnalogSequencer module. To create a sequence of interval offsets from a given tonic (in this case supplied by a keyboard, you could use the following in the Pitches field:

{!KeyNumber} {!KeyNumber + 2} {!KeyNumber + 4}  {!KeyNumber + 7.5}  {!KeyNumber + 9} 

These two examples are attached: * MIDIScriptandSequencer.kym.

-- CarlaScaletti - 25 Aug 2010

WebForm
Question: Create pitch sequences using smalltalk scripts
Keywords: smalltalk scripts

----- Revision r1.2 - 25 Aug 2010 - 16:45 GMT - CarlaScaletti
Copyright © 1999-2014 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding kyma•tweaky? Send feedback.