Way to use a variable in the score for timing control?

Hi,

I want to use a panel Fslider to set the timing of instruments in the score. Something like the code below, where the variables would be set with sliders. This seems like this should be straightforward, but I keep getting errors when trying to do this and in looking through a lot of examples of different scores I did not find any examples of this type of timing control.

sco = “”"
r6
i 1 0 gkDwellTimeA
i 2 gkDwellTimeA gkDwellTimeB
s
e
“”"

hi michael -

you cannot do this in the score — there is a complete seperation
between orc and sco, so no single orc variable like your gkDwellTimes
will be seen there.

you can fire instrument events via schedule or schedulek. the latter
you will need, because you work at k-rate with your slider. perhaps you
try, and report back here if you have problems.

cheers -
joachim

joachim,

I really appreciate your response…It has been a while since I coded in csound, but when I looked back at my old code I have been able to accomplish this kind of task in the orchestra, but the timing aspect of controlling lots of different instruments is something that I can remember running into lots of issues with. In the past I was using sliders to control a vco opcode that then fed that to event and turnoff2 opcodes…it worked, but as I tried to add in complexity it was not intuitive for me. I will give schedule a try and keep working on it.

Thanks,
Mike

You might also consider doing this with CsoundQT, Blue, Cabbage or another frontend rather than using the fltk opcodes. They are coming near the end of their shelf life.

rory,
The end of life of the fltk opcodes is understandable, but I have gotten used to them. I have used Cabbage, but none of the others…I usually use python with multiprocessing to call Csound with the use of OSC to talk to other python processes. While I do not see why I could not use Cabbage for this, I have not given it a lot of thought. If I try this I may start a new thread to ask you some questions.

Thanks,
Mike

Sure. Sounds like you have a good thing going with Python! But don’t discount Blue or CsoundQT, or even web based Csound for future experiments. They all offer different things.