Csound Csound-dev Csound-tekno Search About

[Csnd] problem with "zaw" and OSC

Date2010-10-21 23:19
From"Colman O'Reilly"
Subject[Csnd] problem with "zaw" and OSC
Hi All –
I seem to have run into a problem I can’t explain. 

I am building a large performance system using TouchOSC as the controller for Csound, and am getting a very high pitched tone whenever I use turnoff2 – but only if I am using a zak with the signal.

I have attached a recreation of the problem on a much smaller scale.   Essentially I have a control instrument, an instrument that will be turned off and on, and then a “mixer” instrument.   If I simply use the “outs” opcode in the sound generating instrument – there is no high pitched tone – but if I route the output to a mixer instrument it appears.  

I’m sure I’m overlooking something and would love a push in the right direction.  

I have attached a link to a simple touchOSC instrument I created, although I’m sure someone will probably see the error right away in my code.  It is simply a toggle button sending out either a 1 or a 0.


Thanks in advance!
-Colman

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr = 44100

kr = 4410

ksmps = 10

nchnls = 2

0dbfs = 1

gihandle OSCinit 8000

zakinit 10, 10

turnon 1

turnon 2

instr 1

k1 init 0

nxtmsg:

ka OSClisten gihandle, "/1/toggle1", "i", k1 ;touch OSC controller, sending a 0 or 1

if (ka == 0) goto ex

kgoto nxtmsg

ex:

if k1 == 1 then

k1 = 8 ;arbitrary number to prevent it from looping

event "i", 11, 0, 300

endif

if k1 == 0 then

turnoff2 11, 0, 1

endif

endin

instr 11

a1 oscil .5, 440, 1

;outs a1, a1

zaw a1, 0

endin

instr 2

a1 zar 0

outs a1, a1

endin

</CsInstruments>

<CsScore>

f1 0 4096 10 1

f0 600

</CsScore>

</CsoundSynthesizer>







--




Date2010-10-22 02:49
FromLouis Cohen
Subject[Csnd] Re: problem with "zaw" and OSC
I think you will need to clear the zak audio after your outs command.  
The zak a-rate variables have to be cleared at the end of every k- 
cycle. Try the opcode "zac"

-Lou

On Oct 21, 2010, at 6:19 PM, Colman O'Reilly wrote:

> Hi All –
> I seem to have run into a problem I can’t explain.
>
> I am building a large performance system using TouchOSC as the  
> controller for Csound, and am getting a very high pitched tone  
> whenever I use turnoff2 – but only if I am using a zak with the  
> signal.
>
> I have attached a recreation of the problem on a much smaller  
> scale.   Essentially I have a control instrument, an instrument that  
> will be turned off and on, and then a “mixer” instrument.   If I  
> simply use the “outs” opcode in the sound generating instrument –  
> there is no high pitched tone – but if I route the output to a mixer  
> instrument it appears.
>
> I’m sure I’m overlooking something and would love a push in the  
> right direction.
>
> I have attached a link to a simple touchOSC instrument I created,  
> although I’m sure someone will probably see the error right away in  
> my code.  It is simply a toggle button sending out either a 1 or a 0.
>
> http://www.colmanoreilly.com/files/ColmanProblem.touchosc
>
> Thanks in advance!
> -Colman
>
> 
> 
> 
> 
> sr	 =	44100
> kr	 =	4410
> ksmps	 =	10
> nchnls	=	2
> 0dbfs = 1
> gihandle OSCinit 8000
> zakinit 10, 10
> turnon 1
> turnon 2
> instr 1
> k1 init 0
> nxtmsg:
> ka OSClisten gihandle, "/1/toggle1", "i", k1 ;touch OSC controller,  
> sending a 0 or 1
> if (ka == 0) goto ex
> kgoto nxtmsg
> ex:
> if k1 == 1 then
> k1 = 8 ;arbitrary number to prevent it from looping
> event "i", 11, 0, 300
> endif
> if k1 == 0 then
> turnoff2 11, 0, 1
> endif
> endin
> instr 11
> a1 oscil .5, 440, 1
> ;outs a1, a1
> zaw a1, 0
> endin
> instr 2
> a1 zar 0
> outs a1, a1
> endin
> 
> 
> f1 0 4096 10 1
> f0 600
> 
> 
>
>
>
>
>
>
> -- 
> Colman O'Reilly | colmanoreilly@gmail.com | www.colmanoreilly.com
>
>
>
>



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-10-22 03:52
Fromthorin kerr
Subject[Csnd] Re: problem with "zaw" and OSC
You need to clear zak space using the zacl opcode

in instrument 2, after
outs a1, a1

try inserting this line:
zacl 0, 1

Thorin

On Fri, Oct 22, 2010 at 8:19 AM, Colman O'Reilly
 wrote:
> Hi All –
> I seem to have run into a problem I can’t explain.
> I am building a large performance system using TouchOSC as the controller
> for Csound, and am getting a very high pitched tone whenever I use turnoff2
> – but only if I am using a zak with the signal.
> I have attached a recreation of the problem on a much smaller scale.
> Essentially I have a control instrument, an instrument that will be turned
> off and on, and then a “mixer” instrument.   If I simply use the “outs”
> opcode in the sound generating instrument – there is no high pitched tone –
> but if I route the output to a mixer instrument it appears.
> I’m sure I’m overlooking something and would love a push in the right
> direction.
> I have attached a link to a simple touchOSC instrument I created, although
> I’m sure someone will probably see the error right away in my code.  It is
> simply a toggle button sending out either a 1 or a 0.
> http://www.colmanoreilly.com/files/ColmanProblem.touchosc
> Thanks in advance!
> -Colman
>
> 
>
> 
>
> 
>
> 
>
> sr = 44100
>
> kr = 4410
>
> ksmps = 10
>
> nchnls = 2
>
> 0dbfs = 1
>
> gihandle OSCinit 8000
>
> zakinit 10, 10
>
> turnon 1
>
> turnon 2
>
> instr 1
>
> k1 init 0
>
> nxtmsg:
>
> ka OSClisten gihandle, "/1/toggle1", "i", k1 ;touch OSC controller, sending
> a 0 or 1
>
> if (ka == 0) goto ex
>
> kgoto nxtmsg
>
> ex:
>
> if k1 == 1 then
>
> k1 = 8 ;arbitrary number to prevent it from looping
>
> event "i", 11, 0, 300
>
> endif
>
> if k1 == 0 then
>
> turnoff2 11, 0, 1
>
> endif
>
> endin
>
> instr 11
>
> a1 oscil .5, 440, 1
>
> ;outs a1, a1
>
> zaw a1, 0
>
> endin
>
> instr 2
>
> a1 zar 0
>
> outs a1, a1
>
> endin
>
> 
>
> 
>
> f1 0 4096 10 1
>
> f0 600
>
> 
>
> 
>
>
>
>
>
> --
> Colman O'Reilly | colmanoreilly@gmail.com | www.colmanoreilly.com
>
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-10-22 04:00
From"Colman O'Reilly"
Subject[Csnd] Re: Re: problem with "zaw" and OSC
Wow, problem solved.  Thank you!
C

On Thu, Oct 21, 2010 at 10:52 PM, thorin kerr <thorin.kerr@gmail.com> wrote:
You need to clear zak space using the zacl opcode

in instrument 2, after
outs a1, a1

try inserting this line:
zacl 0, 1

Thorin

On Fri, Oct 22, 2010 at 8:19 AM, Colman O'Reilly
<colmanoreilly@gmail.com> wrote:
> Hi All –
> I seem to have run into a problem I can’t explain.
> I am building a large performance system using TouchOSC as the controller
> for Csound, and am getting a very high pitched tone whenever I use turnoff2
> – but only if I am using a zak with the signal.
> I have attached a recreation of the problem on a much smaller scale.
> Essentially I have a control instrument, an instrument that will be turned
> off and on, and then a “mixer” instrument.   If I simply use the “outs”
> opcode in the sound generating instrument – there is no high pitched tone –
> but if I route the output to a mixer instrument it appears.
> I’m sure I’m overlooking something and would love a push in the right
> direction.
> I have attached a link to a simple touchOSC instrument I created, although
> I’m sure someone will probably see the error right away in my code.  It is
> simply a toggle button sending out either a 1 or a 0.
> http://www.colmanoreilly.com/files/ColmanProblem.touchosc
> Thanks in advance!
> -Colman
>
> <CsoundSynthesizer>
>
> <CsOptions>
>
> </CsOptions>
>
> <CsInstruments>
>
> sr = 44100
>
> kr = 4410
>
> ksmps = 10
>
> nchnls = 2
>
> 0dbfs = 1
>
> gihandle OSCinit 8000
>
> zakinit 10, 10
>
> turnon 1
>
> turnon 2
>
> instr 1
>
> k1 init 0
>
> nxtmsg:
>
> ka OSClisten gihandle, "/1/toggle1", "i", k1 ;touch OSC controller, sending
> a 0 or 1
>
> if (ka == 0) goto ex
>
> kgoto nxtmsg
>
> ex:
>
> if k1 == 1 then
>
> k1 = 8 ;arbitrary number to prevent it from looping
>
> event "i", 11, 0, 300
>
> endif
>
> if k1 == 0 then
>
> turnoff2 11, 0, 1
>
> endif
>
> endin
>
> instr 11
>
> a1 oscil .5, 440, 1
>
> ;outs a1, a1
>
> zaw a1, 0
>
> endin
>
> instr 2
>
> a1 zar 0
>
> outs a1, a1
>
> endin
>
> </CsInstruments>
>
> <CsScore>
>
> f1 0 4096 10 1
>
> f0 600
>
> </CsScore>
>
> </CsoundSynthesizer>
>
>
>
>
>
> --
> Colman O'Reilly | colmanoreilly@gmail.com | www.colmanoreilly.com
>
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




--




Date2010-10-22 08:52
FromVictor.Lazzarini@nuim.ie
Subject[Csnd] Re: problem with "zaw" and OSC
AttachmentsNone  

Date2010-10-22 18:54
From"Colman O'Reilly"
Subject[Csnd] Re: Re: problem with "zaw" and OSC
Thanks very much for all of the feedback and explaining what was going on - it has been a huge help .  This makes a great deal more sense and I was able to translate the solution to my actual project relatively easily.  

Best -
Colman

On Thu, Oct 21, 2010 at 9:49 PM, Louis Cohen <loucohen@jolc.net> wrote:
I think you will need to clear the zak audio after your outs command. The zak a-rate variables have to be cleared at the end of every k-cycle. Try the opcode "zac"

-Lou


On Oct 21, 2010, at 6:19 PM, Colman O'Reilly wrote:

Hi All –
I seem to have run into a problem I can’t explain.

I am building a large performance system using TouchOSC as the controller for Csound, and am getting a very high pitched tone whenever I use turnoff2 – but only if I am using a zak with the signal.

I have attached a recreation of the problem on a much smaller scale.   Essentially I have a control instrument, an instrument that will be turned off and on, and then a “mixer” instrument.   If I simply use the “outs” opcode in the sound generating instrument – there is no high pitched tone – but if I route the output to a mixer instrument it appears.

I’m sure I’m overlooking something and would love a push in the right direction.

I have attached a link to a simple touchOSC instrument I created, although I’m sure someone will probably see the error right away in my code.  It is simply a toggle button sending out either a 1 or a 0.

http://www.colmanoreilly.com/files/ColmanProblem.touchosc

Thanks in advance!
-Colman

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
sr       =      44100
kr       =      4410
ksmps    =      10
nchnls  =       2
0dbfs = 1
gihandle OSCinit 8000
zakinit 10, 10
turnon 1
turnon 2
instr 1
k1 init 0
nxtmsg:
ka OSClisten gihandle, "/1/toggle1", "i", k1 ;touch OSC controller, sending a 0 or 1
if (ka == 0) goto ex
kgoto nxtmsg
ex:
if k1 == 1 then
k1 = 8 ;arbitrary number to prevent it from looping
event "i", 11, 0, 300
endif
if k1 == 0 then
turnoff2 11, 0, 1
endif
endin
instr 11
a1 oscil .5, 440, 1
;outs a1, a1
zaw a1, 0
endin
instr 2
a1 zar 0
outs a1, a1
endin
</CsInstruments>
<CsScore>
f1 0 4096 10 1
f0 600
</CsScore>
</CsoundSynthesizer>






--
Colman O'Reilly | colmanoreilly@gmail.com | www.colmanoreilly.com







Send bugs reports to the Sourceforge bug tracker
          https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




--