Hello everybody!
Working through the floss manual i’m getting a better understanding of Csound and how to use in a way i like it more! The score was always a thing what made Csound for me very unattractive!
I’m experimenting a bit with the ‘event’ opcode to trigger a other instrument. What a convenient way to create a lot of sounds! In this example i used a ‘linseg’ line multiplied with random values to make it more ‘human’.
But now i’m asking myself how to use a list of numbers which represents the time of initialization of different instances of one instrument.
So, i wan’t to use Csound combined with Lisp, create a list of numbers there and copy the list into csound as a trigger list.
Is it clear what i mean?
I think i have to use an array, but i don’t know how to work it out.
Here is the example where i want to replace my metro trigger with a list of numbers.
<CsoundSynthesizer>
<CsOptions>
-d -odac -A
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1.0
giSine ftgen 1, 0, 2^10, 10, 1
;-----------------------------------------------------------
instr 1
kMult linseg 5, 10, 5, 10, 10, 10, 5, 10, 20, 10, 25, 10, 50, 30, 5, 20, 5, 20, 1
kDens random 0.001, 0.5
kTrig metro kDens*kMult
if kTrig == 1 then
event "i", 2, 0, kDens*kMult, 60, 127
endif
endin
instr 2
iMaxAmp random 0.001, 0.1
iAtk random 0.05, 0.25
aEnv linseg 0, p3*iAtk, iMaxAmp, p3*0.5, 0
iFreq random p4, p5
iFreq mtof iFreq
aSine poscil aEnv, iFreq, giSine
iPanStart random 0, 1
kPan line iPanStart, p3*0.5, 1-iPanStart
aOutL, aOutR pan2 aSine, kPan
outs aOutL, aOutR
endin
;-----------------------------------------------------------
</CsInstruments>
<CsScore>
i1 0 130
</CsScore>
</CsoundSynthesizer>