| csOutChannel registers a Tcl global variable with the
channel
name that can be queried. In the example, csOutChannel freq
does just that.
If you type
puts $freq
you get the current value of the channel. The trouble
now is that while it works for Tcl, Tk does not respond
to it. I have made extensive tests, which seem to indicate
this is a bug in Tk. When the variable is set by a custom
command, it works, but when it is set by the outvalue
callback it does not. Something very funny with it. I will
have to investigate it more, but I'll probably have
to ask one of the Tcl developers if they know why it
is not happening.
Victor
>
>
> On Nov 4, 2005, at 2:30 PM, Victor Lazzarini wrote:
>
> > Today I tried my listener script with
> > pd and I can control cstclsh from it quite well (using
> > netsend). It might open up possibilities of
> > client-server csound set-ups with a variety of client
> > programs (so far I have a wish script and a PD patch,
> > but it is possible to write custom clients with a
> variety of languages). >
> > Victor
>
>
> That is an excellent idea, which also opens up the
> possibility of editing shared Csound files over a network
> through the use of a shared [textfile] object! I doubt
> that level of collaboration has yet been reached with
> Csound, yet it is now possible.
>
> One thing I was having trouble with though was trying to
> get the canonical example GUI to respond to MIDI (or
> other) control data. What follows is an example; the
> sound reflects the change and responds to MIDI but the
> GUI does not. Registering the same invalue/outvalue
> chanels in MacCsound's GUI shows that the GUI responds. I
> think the Tclcsound idea would be amazing for
> implementing realtime performance systems where data is
> not passed to Csound from the TCL/Wish GUI but rather is
> just a display.
>
>
> # "remote_test.tcl" - display test
> # script to test cswish
> # use csOpcodedir to set OPCODEDIR in your system
> # if needed
> # Tcl/Tk 8.4
> # VL, 2005
>
> global filename fval aval ffval qaval
> set aval 1000
> set fval 300
> set filename "remote_sliders.csd"
> csCompile -odac:1 -iadc:1 -+noninterleaved=1
> -+rtaudio=CoreAudio -M0 -d $filename
> csInChannel freq
> csInChannel amp
> csInChannel filfreq
> csInChannel filq
> csOutChannel freq
>
> labelframe .middle -text "csound control panel" -padx 20
> -pady 20 frame .bottom -padx 20 -pady 20
> frame .sliders -padx 20 -pady 20
>
> proc newOrc { } {
> global filename
> set filename [tk_getOpenFile -filetypes "{{CSD} {.csd}
> TEXT}"] if { $filename != "" } {
> csStop
> csCompile -odac:1 -iadc:1 -+noninterleaved=1
> -+rtaudio=CoreAudio -M0 -d $filename
> }
> }
>
> pack .middle .sliders .bottom
> button .bottom.open -text "open new csd" -command newOrc
> 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
> scale .sliders.freq -variable fval -orient horizontal
> -from 200 -to 400 -command [list csInValue freq] -label
> "frequency" -length 300 scale .sliders.amp -variable aval
> -orient horizontal -from 0 -to 10000 -command [list
> csInValue amp] -label "amplitude" -length 300 scale
> .sliders.ffreq -variable ffval -orient horizontal -from
> 200 -to 4000 -command [list csInValue filfreq] -label
> "filter cf" -length 300 scale .sliders.q -variable qval
> -orient horizontal -from 1 -to 100 -command [list
> csInValue filq] -label "filter Q" -length 300 pack
> middle.run .middle.pause .middle.stop -side left pack
> bottom.open .bottom.quit -side left pack .sliders.amp
> sliders.freq .sliders.ffreq .sliders.q ## EOF ##
>
>
>
> sr=44100
> ksmps=10
> nchnls=1
>
> instr 1
>
> ;k1 invalue "amp"
> ;k1 tonek k1, 10
> ;k2 invalue "freq"
> k3 invalue "filfreq"
> k4 invalue "filq"
>
> k8 ctrl7 1, 1, 200, 400
> k9 ctrl7 1, 7, 0, 10000
> k9 tonek k9, 10
>
> asig oscili k9,k8,1
> afil resonz asig, k3, k3/k4, 1
>
> outvalue "amp", k9
> outvalue "freq", k8
>
> ;; uncomment for use with MacCsound
> ;outvalue "dispfreq", k8
> ;outvalue "dispamp", k9
> ;outvalue "dispfilfreq", k3
> ;outvalue "dispfilq", k4
>
> out afil
>
> endin
>
>
>
> f1 0 16384 10 1 .5 .33 .25 .2 .16 .14 .12 .1 .9 .8 .7 .6
> 5 i1 0 600
>
>
>
>
>
> Version: 3
> Render: Real
> Ask: Yes
> Functions: Window
> WindowBounds: 404 44 1077 789
> Options: -b1024 -A -s -m7 -R
>
>
> ioView nobackground {65535, 65535, 65535}
> ioListing {10, 10} {400, 500}
> ioSlider {427, 64} {190, 34} 200.000000 400.000000
> 200.000000 freq ioSlider {432, 160} {190, 34} 0.000000
> 10000.000000 8113.000000 amp ioSlider {433, 258} {190, 34}
> 200.000000 4000.000000 1704.799927 filfreq ioSlider {436,
> 357} {190, 34} 1.000000 100.000000 53.915501 filq ioText
> {502, 96} {46, 26} display 200.000000 0.001000 "dispfreq"
> left "Lucida Grande" 10 {0, 0, 0} {65535, 65535, 65535}
> nobackground noborder
> ioText {511, 192} {46, 26} display 8112.965820 0.001000
> "dispamp" left "Lucida Grande" 10 {0, 0, 0} {65535, 65535
> , 65535} nobackground noborder text> ioText {513, 289} {46, 26} display 1705.559937
> 0.001000 "dispfilfreq" left "Lucida Grande" 10 {0, 0, 0}
> {65535, 65535, 65535} nobackground noborder to edit text> ioText {516, 389} {46, 26} display 53.915501
> 0.001000 "dispfilq" left "Lucida Grande" 10 {0, 0, 0}
> {65535, 65535, 65535} nobackground noborder to edit text> ioText {496, 36} {49, 34} label 0.000000
> 0.001000 "" left "Lucida Grande" 10 {0, 0, 0} {65535,
> 65535, 65535} nobackground noborder freq ioText {500, 134}
> {49, 34} label 0.000000 0.001000 "" left "Lucida Grande"
> 10 {0, 0, 0} {65535, 65535, 65535} nobackground noborder
> amp ioText {514, 241} {49, 34} label 0.000000 0.001000 ""
> left "Lucida Grande" 10 {0, 0, 0} {65535, 65535, 65535}
> nobackground noborder filfreq
> ioText {516, 336} {49, 34} label 0.000000 0.001000 "" left
> "Lucida Grande" 10 {0, 0, 0} {65535, 65535, 65535}
> nobackground noborder Q
>
>
> -David
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo
> App Server. Download it for free - -and be entered to win
> a 42" plasma tv or your very own Sony(tm)PSP. Click here
> to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |