Controlling p2 of 80 soundin

Hello, I need to play 80 soundin to control 80 different soundfiles.
I am going to use 2 sliders for each soundin to control the level and the pan:

kamp1 invalue “amp1”
kpan1 invalue “pan1”
aL1, aR1 soundin “Do3_01.aif”, 0
a1L = aL1 * kpan1 * kamp1
a1R = aR1 * (1 - kpan1) * kamp1

I’d like to have a third real-time control to set a parameter corresponding to p2 field in the score, so each player can start in a different moment.
But I don’t have any idea if it’s possible.

sure — everything is possible =)

when you can describe more in detail what it means “to set a parameter
corresponding to p2 field in the score”, i might be able to help you.

For instance I want soundin#1 to start 1 second later, like if the score statement was “i1 1”. But I’d like to set it by a slider, in the same way I did with level and pan. So, for each soundin I set onset, level and pan, and then play the whole instrument.

one possibility would be to seperate the jobs between two instruments:

  • one instrument receives the onset and calls
  • the other instrument which then plays back the sound file.

so in some not tested code:

instr Receive
kOnset invalue “onset”
schedulek “Play”,kOnset,1
turnoff
endin

instr Play
p3 filelen “Do3_01.aif”

endin

depending on your situation, there are als other possibilities. perhaps
the most simple one is a delay:

kamp1 invalue “amp1”
kpan1 invalue “pan1”
kOnset invalue “onset”
iDelay = i(kOnset)
aL1, aR1 soundin “Do3_01.aif”, 0
aL1 delay aL1, iDelay
aR1 delay aR1, iDelay
a1L = aL1 * kpan1 * kamp1
a1R = aR1 * (1 - kpan1) * kamp1

hope some of this might help to find a solution …

joachim

Hello Joachim,

thank you a lot for your help. I was looking for something complicated and didn’t think about the delay option, that is quite smart.
I have tried with it and it works very fine, thank you again. But I will try the first option as well and let you know.

Best regards,

G.