| While working on my Wiimote pieces, I have gotten this type of thing to work by using the combo of "trigger" and "schedkwhen". So, your first instrument would be written the following way :instr 1
ki1 init 0
kk OSClisten gihandle, "/note",
"i", ki1 ktrig trigger ki1,0.9,0 ;the threshold can be anywhere between 0 and 1
schedkwhen ktrig,0,1,3,0,-1 ;
printk 0.1, ki1
endin
From: victor <Victor.Lazzarini@nuim.ie> To: csound@lists.bath.ac.uk Sent: Sunday, November 30, 2008 12:35:05 PM Subject: [Csnd] Re: Re: Re: OSCListen not... listening?
I should use 'event' then, with negative
p3.
Victor
----- Original Message -----
Sent: Sunday, November 30, 2008 5:29
PM
Subject: [Csnd] Re: Re: OSCListen not...
listening?
Thank you Mark for that observation. I thought that would at
least fix the fact that a sound happened when I loaded up the CSD. I didn't
and it's still not triggering kk. Maybe I'm using turnon wrong. Thank you
though Mark, it was a silly error that I missed.
-Edward
On Nov 30, 2008, at 2:07 AM, mark jamerson wrote:
I think your problem
may lie in the following line:
if (kk == 1) igoto gogo
It should be a kgoto.
From: Edward Loveall <edward@edwardloveall.com> To: csound@lists.bath.ac.uk Sent: Saturday, November 29, 2008
10:19:37 PM Subject: [Csnd] OSCListen not...
listening?
Hi all.
I've been fooling around trying to get processing
and OSC to talk to each other for while now and am running into 2
problems.
1. I am able to get OSC data in and scene
correctly. However, in the manual entry for OSCListen it states "kans -- set to 1 if a new message was
received, or zero if not." I can't get a 1 out of that thing even when
csound is reacting to OSC messages otherwise.
2. I'm trying to trigger an instr when said osc
messages are in. Maybe my problems are above, but maybe someone knows a
better way.
Here's my instrument:
<CsoundSynthesizer>
<CsOptions>
-odac -d
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 100
nchnls = 2
gihandle OSCinit 8000
instr 1
ki1 init 0
kk OSClisten gihandle, "/note",
"i", ki1
if (kk == 1) igoto gogo
gogo:
turnon 3
printk 0.1, ki1
endin
instr 3
ki1 init 0
ki2 init 0
kk OSClisten gihandle, "/note",
"i", ki1
kenv expseg ampdb(80), 4,
0.0001
aosc oscili kenv-0.0001,
cpsmidinn(ki1+60), 1
outs aosc,aosc
endin
</CsInstruments>
<CsScore>
f1 0 8192 10 1
i1 0 100
e
</CsScore>
</CsoundSynthesizer>
|