Oeyvind
Brandtsegg, 2008
obrandts@gmail.com
Partikkel
automation score is a scripting tool for generating automation for partikkel
parameters.
As far as I
know, all partikkel parameters can be set and automated, and several instances
of the partikkel generator can be used in parallel.
Parameter
automation is generated in Csound instruments, sending parameter values to
partikkel (running in a separate instrument) via chn channels.
To
configure the audio output device:
edit the
file partikkel_automation_score.csd (line 3), using conventional Csound command
line flags
To run,
type:
csound
partikkel_automation_score.csd
at the
command line.
Creating parameter automation:
Syntax of the parameter automation
script:
Importing your own sound files:
Note about output routing and
effects
It's best
to write your automation in a separate file, I recommend saving this file with
the extension ".inc". For example "my_automation.inc"
To include
the automation in this file, add the following line to the score section
partikkel_automation_score.csd:
#include
"my_automation.inc"
You may
delete (or comment out) any other automation currently included. To comment out
a line, put a semicolon at the beginning of the line, like this
;#include
"score_examples.inc"
The
automation is generated by initiating csound instrument events, like in any
other Csound score.
Instruments
2, 3, 4, 5, 10, 11, 12 and 20 generate parameter automation.
Instrument
51 (and currently up to 54, this can be extended) starts an instance of the
partikkel generator, you need to start at least one instance.
The
parameter automation instruments have a common syntax, but with small changes
for each type of automation.
For
example, instrument 2 generates a curved line
automation (like a fade in), and has this syntax:
; start dur ParameterName startVal endVal Curve
i2 0 3 "Partikkel1GrainPitch"
1 2 3
The start
parameter determines when the automation segment will start, and the dur
parameter determines the duration of the line segment.
The
ParameterName is the name of a partikkel parameter (see a full list of
parameters below). The number after “Partikkel” in the parameter name (e.g.
“Partikkel1” in the example above) signifies which partikkel instance the
parameter is valid for.
The
startVal sets the starting value for the automation, and the endVal sets the
ending value.
The Curve parameter
determines the curvature of the line segment, where a value of zero gives a
straight line, values below zero gives increasingly concave curves, values
above zero gives increasingly convex curves. See the Csound manual for transeg
if you need more information on the subject of line curvature.
Instrument
3 is like instrument 2, except it does not have a start value. It will use the
current value of the parameter (whatever value it has) as the starting point
for the automation. The syntax is as follows:
; start dur ParameterName endVal Curve
i3 0 1 "Partikkel1GrainPitch" 2 0
It is
possible to use a LFO to create parameter automation,
this is done with instrument 4, like this:
; start dur ParameterName LfoAmount LfoFreq Fadein Fadeout
i4 1 6 "Partikkel1GrainPitch" 0.5 0.4 1 1
The
LfoAmount sets the amount of modulation, while the LfoFreq sets the frequency
of the LFO. This instrument also has a fade in time and a fade out time, to
enable smooth transitions when starting or stopping the LFO.
You can use
a random signal generator to create automation, this
is done with instrument 5:
; start dur ParameterName minValue maxValue cpsMin cpsMax Fadein Fadeout
i5 0 3 "Partikkel1GrainPitch" 0 1 10 100
1 1
The
minValue sets the minimum amount of parameter modulation, and similarly
maxValue sets the max amount. The cpsMin parameter sets the minimum frequency
for generating new random values, and similarly cpsMax sets the maximum
frequency for generating random values. Like instrument 4, the random generator
has a fade in and a fade out time.
For more
information regarding the random spline generator, refer to the Csound manual
for the rspline opcode.
To rewrite the
ftables used internally by the partikkel opcode, instruments 10, 11 and 12 can
be used. Refer to the csound manual for specific information about how you can
use ftables to affect sound generation with the partikkel opcode.
Morphing to
new ftable values using curved line transition:
With this
command, you specify the ftable values you want to morph to, and you will get a
gradual interpolation from old to new values over the specified duration.
; start dur TableName Curve Table values (start, end, v1,v2,v3,v4....)
i10 3 5 "giwavfreqstarttab1" 0 0
2 1 1 2
Continuously morph between current and new ftable (back and forth) using
a LFO as control signal. The LFO amount has a max value of 1, meaning the morphing oscillates
over the full range between the two (old and new) different ftable value sets.
During the LFO fade out, the original (old) ftable is gradually restored.
; start dur TableName LfoAmount LfoFreq Fadein Fadeout Table
values (start, end, v1,v2,v3,v4....)
i11 8 10 "giwavfreqstarttab1" 1 0.8 3 5 0 4 1 2 3 4 5
Continuously
morph between current and new ftable using a random signal (rspline) as control
signal
; start dur ParameterName minValue maxValue cpsMin cpsMax Fadein Fadeout Table
values (start, end, v1,v2,v3,v4....)
i12 6 20 "giwavfreqstarttab1" 0 1 1 10 3 3 0
2 1 1 1
To set the
source waveforms for granulation, use instrument 20:
; start dur PartikkelVoice waveSlot (1 to 4) waveName
(global ftable name)
i20 0 1 1 1 "giStruglKor"
PartikkelVoice
refers to the partikkel instance (for example, a partikkel instance created
with instr 51 is PartikkelVoice 1)
The
parameter waveSlot refers to one of the four source waveforms for each
partikkel instance.
The
waveName refers to the source waveform's name (see below)
Sound files
are loaded in the file "globals_ftables.inc", you will edit this file
to import your own sound files. It is easiest to put your sound files in the
same folder as the rest of the partikkel automation score files.
To load a
sound file, type a line like this one:
giStruglKor ftgen 0,
0, 0, 1, "GrSrc_StruglKor2mono.wav", 0, 0, 0 ; soundfile
The first
name (giStruglKor in this case) is an internal reference we will use later, use
any name you want here.
The text
between the hyphens ("GrSrc_StruglKor2mono.wav" in this case), is the
name of your sound file.
Now you
have loaded your sound file, easy.
However,
there is one more thing that needs doing to actually use this sound file in the
automation script.
Add a line
like this one:
chnset giStruglKor, "giStruglKor"
Where the
first name (giStruglKor) is the name you chose to use earlier, when you loaded
the sound file,
and the
second name ("giStruglKor") is the name you want to use to refer to
this sound file later.
Now, if you
look back to the explanation for instrument 20 above, you will see that we used
this name to select this sound file for usage as a source waveform.
All 8 audio
outputs of the partikkel opcode are used. Outputs 1 and 2 are sent to master
audio out left and right respectively. Outputs 3 to 8 are sent to different
effects (ringmodulator, bandpass filter, stereo delay and stereo reverb). The
following shows the output routing:
a1 is sent to "MasterAudioLeft"
a2, is
sent to "MasterAudioRight"
a3, is sent to "Ringmod1Send" (mono in)
a4, is sent to "Bandpass1Send" (mono in)
a5, is
sent to "DelaySendLeft"
a6, is
sent to "DelaySendRight"
a7, is
sent to "ReverbSendLeft"
a8, is
sent to "ReverbSendRight"
You can use
the channel masking features of partikkel to route individual grains to
separate output channels.
It may
sometimes be inconvenient to specify values for e.g. grain rate as absolute frequencies.
In the same manner it may be inconvenient to specify grain transposition as a
factor, if one wants to generate melodic lines in equal temperament. Score
macros have been included for conversion from midi note number to frequency
(cycles per second), and conversion from semitone to transposition ratio. The
macros can be found in the score section of partikkel_automation_score.csd. The
macro names and usage are repeated here:
cpsMidi(N)
Conversion from midi note number to frequency (cps).
The argument
sets the midi note number.
Example
(remember the dollar sign when calling a macro):
$cpsMidi(69)
will give
a frequency value of 440
semiTone(N)
Conversion from semitone to transposition factor.
The
argument sets the number of semitones to transpose.
Example
(remember the dollar sign when calling a macro):
$semiTone(3)
will give
a transposition factor needed to transpose up 3 semitones.
In the list
below, the character combination "$N" denotes the partikkel instance
the parameter will affect,
for
example, the parameter "Partikkel$NAmp" should be rewritten as
"Partikkel1Amp" to make the parameter valid for partikkel instance 1,
similarly,
use "Partikkel2Amp" for partikkel instance 2.
"Partikkel$NAmp" ; output amplitude
"Partikkel$NSyncGravity" ; grain clock sync amount
"Partikkel$NGrainRate" ; number of grains per second
"Partikkel$NGrFmFreq" ; FM freq for modulating the
grainrate
"Partikkel$NGrFmIndex" ; FM index for modulating the
grainrate (normally kept in a 0.0 to 1.0 range)
"Partikkel$NDistribution" ; grain random distribution in
time
"Partikkel$NGrainDur" ; length of each grain relative
to grain rate
"Partikkel$NSustain" ; balance between enveloped time(attack+decay) and sustain level time, 0.0 = no time at
sustain level
"Partikkel$NAdRatio" ; balance between attack time
and decay time, 0.0 = zero attack time and full decay time
"Partikkel$NEnv2Amt" ; amount of secondary
enveloping per grain (e.g. for fof synthesis)
"Partikkel$NGrainPitch" ; transposition (playback speed)
of audio inside grains, as transposition factor (cps)
"Partikkel$NGrainPitch1" ; transposition, individually per
source wave, *in cents*
"Partikkel$NGrainPitch2" ; transposition, individually per
source wave, *in cents*
"Partikkel$NGrainPitch3" ; transposition, individually per
source wave, *in cents*
"Partikkel$NGrainPitch4" ; transposition, individually per
source wave, *in cents*
"Partikkel$NSweepshape" ; grain wave pitch sweep shape (sweep
speed), 0.5 is linear sweep
"Partikkel$NPitchFmFreq" ; FM freq, modulating waveform pitch
"Partikkel$NPitchFmIndex" ; FM index, modulating waveform pitch
"Partikkel$NTrainCps" ; Trainlet frequency
"Partikkel$NTrainPartials" ; number of partials in trainlets
"Partikkel$NTrainChroma" ; chroma, falloff of partial
amplitude towards sr/2
"Partikkel$NRandomMask" ; random masking
"Partikkel$NWaveX" ; wave mix X axis
"Partikkel$NWaveY" ; wave mix Y axis
"Partikkel$NTrainAmp" ; balance of trainlets and other
source waves
"Partikkel$NSourceWave1" ; source audio waveform 1
"Partikkel$NSourceWave2" ; source audio waveform 2
"Partikkel$NSourceWave3" ; source audio waveform 3
"Partikkel$NSourceWave4" ; source audio waveform 4
"Partikkel$NSamplepos1" ; time pointer (phase) for source
waveform 1
"Partikkel$NSamplepos2" ; time pointer (phase) for source
waveform 2
"Partikkel$NSamplepos3" ; time pointer (phase) for source
waveform 3
"Partikkel$NSamplepos4" ; time pointer (phase) for source
waveform 4
(changeable with instruments 10,11 and 12)
"gidisttab$N" ; probability distribution for random grain masking
"giwavfreqstarttab$N" ;
start freq scalers, per grain
"giwavfreqendtab$N" ;
end freq scalers, per grain
"gifmamptab$N" ; FM index scalers, per grain
"gigainmasks$N" ; gain masking table, amplitude for individual grains
"gichannelmasks$N" ;
channel masking table, output routing for individual grains
; ringmod and bandpass parameters
"Ringmod1Frequency"
; modulator frequency
"Ringmod1Mix"
; dry/wet mix
"Bandpass1Cutoff"
; cutoff frequency
"Bandpass1Bandwidth"
; bandwidth (as factor of
cutoff frequency)
; delay
effect parameters
"DelayTimeLeft" ; left channel delay
time in milliseconds for vdelay
"DelayTimeRight" ; right channel delay
time in milliseconds for vdelay
"DelayFeedback" ; delay feedback
"DelayXfeed" ; cross feedback L
to R and R to L
; reverb
effect parameters
"ReverbFeedback" ; reverb feedback affects
reverb time
"ReverbLPF" ; low pass
frequency for reverb feedback loop