Csound Csound-dev Csound-tekno Search About

[Csnd] OSC and event_i

Date2012-03-15 09:51
Fromzappfinger
Subject[Csnd] OSC and event_i
Hi,

In the following code, why does instrument 2 only gets triggered once?

Richard



sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

giSine  ftgen   0, 0, 2^10, 10, 1
giosc1  OSCinit 9000

turnon 1


instr 1
kval init 0.0

kans    OSClisten giosc1, "/freq", "f", kval
if kans == 1 then
    printk	1,kval
    aSnd	oscil	1, kval, giSine
    outs      aSnd, aSnd
    event_i "i", 2, 0, .25, i(kval) ;call instr 2
    ;printk	1,kval 
endif
endin

instr 2; 
		printk     1, p4
aSnd	oscil	1, p4, giSine
         outs      aSnd, aSnd
endin




e 300

--
View this message in context: http://csound.1045644.n5.nabble.com/OSC-and-event-i-tp5567496p5567496.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-03-15 10:02
FromJulien Claassen
SubjectRe: [Csnd] OSC and event_i
Hi Richard!
   I don't really know, why your instrument gets only trigger once, perhaps 
because the event_i is suppose to be triggered at i-time.
   Still, I might have an idea, how to fix it. Instead of the event_i use 
subinstr:
aSnd, aSnd subinstr 2, i(kval) ;call instr 2
   Hm, on the other hand, I seem to remember, that subinstr takes it's p2 and 
p3 from the calling instrument. You might try to get the absolute tie of the 
current performance and put that as p2 to your event_i call.
   I hope, one of these may help, but I was a little boggled by these 
mechanisms as well.
   Warm regards
           Julien

=-=-=-=-=-=-=-=-=-=-=-=-
Such Is Life: Very Intensely Adorable;
Free And Jubilating Amazement Revels, Dancing On - FLOWERS!

======      Find my music at      ======
http://juliencoder.de/nama/music.html
.....................................
"If you live to be 100, I hope I live to be 100 minus 1 day,
so I never have to live without you." (Winnie the Pooh)

Date2012-03-15 10:11
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] OSC and event_i
It only gets triggered at i time.  Ther eis an event opcode that runs at
k-rate which is probably what you mean


> Hi,
>
> In the following code, why does instrument 2 only gets triggered once?
>
> Richard
>
> 
>
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
>
> giSine  ftgen   0, 0, 2^10, 10, 1
> giosc1  OSCinit 9000
>
> turnon 1
>
>
> instr 1
> kval init 0.0
>
> kans    OSClisten giosc1, "/freq", "f", kval
> if kans == 1 then
>     printk	1,kval
>     aSnd	oscil	1, kval, giSine
>     outs      aSnd, aSnd
>     event_i "i", 2, 0, .25, i(kval) ;call instr 2
>     ;printk	1,kval
> endif
> endin
>
> instr 2;
> 		printk     1, p4
> aSnd	oscil	1, p4, giSine
>          outs      aSnd, aSnd
> endin
>
> 
> 
>
> e 300
>
> --
> View this message in context:
> http://csound.1045644.n5.nabble.com/OSC-and-event-i-tp5567496p5567496.html
> Sent from the Csound - General mailing list archive at Nabble.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"
>
>
>
>



Date2012-03-15 10:17
FromTarmo Johannes
SubjectRe: [Csnd] OSC and event_i
hello,

use event instead of event_i - the latter is executed only in the init pass of 
instr 1 and it makes no sense to put into if k-variable  condition (since it 
it will be executed after init)

event is k-time opcode, event_i i-time.

or use schedkwhen and you can use kans as trigger (sorry I don't have manual 
at hand to explain closer, please check out the corrects syntax for schedkwhen 
yourself)

greetings,
tarmo

On Thursday 15 March 2012 02:51:53 zappfinger wrote:
> Hi,
> 
> In the following code, why does instrument 2 only gets triggered once?
> 
> Richard
> 
> 
> 
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
> 
> giSine  ftgen   0, 0, 2^10, 10, 1
> giosc1  OSCinit 9000
> 
> turnon 1
> 
> 
> instr 1
> kval init 0.0
> 
> kans    OSClisten giosc1, "/freq", "f", kval
> if kans == 1 then
>     printk	1,kval
>     aSnd	oscil	1, kval, giSine
>     outs      aSnd, aSnd
>     event_i "i", 2, 0, .25, i(kval) ;call instr 2
>     ;printk	1,kval
> endif
> endin
> 
> instr 2;
> 		printk     1, p4
> aSnd	oscil	1, p4, giSine
>          outs      aSnd, aSnd
> endin
> 
> 
> 
> 
> e 300
> 
> --
> View this message in context:
> http://csound.1045644.n5.nabble.com/OSC-and-event-i-tp5567496p5567496.html
> Sent from the Csound - General mailing list archive at Nabble.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"

Date2012-03-15 10:27
Fromzappfinger
Subject[Csnd] Re: OSC and event_i
Yes, I get it.

I would expect an event_k would exist. But instead I must use event "i"...

thanks all.

Richard

--
View this message in context: http://csound.1045644.n5.nabble.com/OSC-and-event-i-tp5567496p5567579.html
Sent from the Csound - General mailing list archive at Nabble.com.