Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Re: Re: TclCsound: Outvalue problem

Date2008-03-25 18:05
Fromvictor
Subject[Csnd] Re: Re: Re: TclCsound: Outvalue problem
csOutValue channel

polls a channel for its current value (which is also sent to
the global variable of the same name).

I am glad you like it. One of the things I like about it
is interactive scripting, where you can type things, etc
to do a kind of on-the-fly synthesis.

Funnily enough by the time I finished writing Tclcsound I
had discovered Python and now that is what I am most used
to...

Victor
----- Original Message ----- 
From: "joachim heintz" 
To: 
Sent: Tuesday, March 25, 2008 3:46 PM
Subject: [Csnd] Re: Re: TclCsound: Outvalue problem


> Genial! It's working now, Victor. I put the changed code below.
> It's working both, with the "passive" slider, and with the label.
>
> In the csound instrument, just the outvalue opcode sends the values 
> correctly, not chnset:
> outvalue "reval", kcount; this is working
> chnset kcount, "reval"; this not
> Is this as expected?
>
> And what I don't understand in the TclCsound commands, is the  difference 
> between
> - csOutChannel name : registers a csound outvalue channel and creates  tcl 
> global variable 'name'
> and
> - csOutValue channel : returns the value of a csound outvalue channel
> In my code I am working with csOutChannel. What is csOutValue for,  and 
> how is it used?
>
> Thanks so much, Victor. I think this is a great possibility for  building 
> own interfaces.
>
> joachim
>
>
>
>> #!/usr/local/bin/cswish
>>
>> cd /Users/jh/Documents/Csound/csound5/examples/tclcsound
>> set filename "simpletest.csd"
>> csCompile -odac -iadc -d $filename -b1024
>>
>> # setting the channels for invalue/outvalue
>> csInChannel val
>> csOutChannel reval
>>
>> proc UpdateSliders { } {
>>        global sliderValue reval
>>        set sliderValue $reval
>>        update
>>        after 50 UpdateSliders
>> }
>>
>> labelframe .middle -text "csound control panel" -padx 20 -pady 20
>> frame .bottom -padx 20 -pady 20
>> frame .sliders -padx 20 -pady 20
>> frame .fr
>> pack .middle .sliders .bottom .fr
>> button .middle.run -text "play" -command csPlay
>> button .middle.stop -text "stop" -command csStop
>> button .middle.pause -text "pause" -command csPause
>> button .bottom.quit -text "quit" -command exit
>>
>> #from the widgets to csound ...
>> scale .sliders.val -orient horizontal -from 0 -to 10 -command [list 
>> csInValue val] -label "Send to Csound" -length 300
>>
>> #... and back
>> scale .sliders.retval -variable sliderValue -orient horizontal - from 
>> 0 -to 30  -label "Return Value" -length 300
>> label .fr.label -textvariable sliderValue
>>
>> pack .middle.run .middle.pause .middle.stop -side left
>> pack .bottom.quit -side left
>> pack .sliders.val .sliders.retval .fr.label
>>
>> after 50 UpdateSliders
>
>
>
>
> Am 24.03.2008 um 20:10 schrieb victor:
>> Did you call updateSliders? I suppose you can just place a
>> call at the end of the code:
>>
>> after 50 UpdateSliders
>>
>> I suppose you could also do something like this:
>>
>> proc UpdateSliders { } {
>>        global sliderValue reval
>>        set sliderValue $reval
>>        update
>>        after 50 UpdateSliders
>> }
>>
>> Recursively.
>>
>> Victor
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
> csound"