Csound Csound-dev Csound-tekno Search About

[Cs-dev] Re initialize instruments in real time

Date2009-05-28 16:12
Fromdavistro
Subject[Cs-dev] Re initialize instruments in real time

 In the following code, we have a control variable used to star reproducing
a sample (if gkControl is 1) and stop reproducing if gkControl is 2 here is
where we want to reinitialize the state of the opcode diskin or others like
pluck, line, linen, etc. How can we do that?





   -o dac -+rtaudio=alsa 




   sr = 44100
   kr = 4410
   ksmps = 10
   nchnls = 2
   
   gkcontrol    init 0
   
   instr 1
       gkcontrol    chnget    "sample"
       
       if gkcontrol == 1 then
           a1,a2    diskin    "rep1.wav", 1,    0,    1,    0,    100
           outs a1, a2
       endif
       if gkcontrol == 2 then
           ;Reiniciar
       endif
   endin
   
   instr 2
       gkcontrol    =    p4
       
       printk2    gkcontrol
       
   endin







;reproduccion todos los instrumentos

i1    0    100
i2    0    50    1
i2    50  50    2   





-- 
View this message in context: http://www.nabble.com/Reinitialize-instruments-in-real-time-tp23763800p23763800.html
Sent from the Csound - Dev mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-05-28 16:33
FromOeyvind Brandtsegg
SubjectRe: [Cs-dev] Re initialize instruments in real time
Maybe like this (untested):

   if gkcontrol == 1 then
          myLabel:
          a1,a2    diskin    "rep1.wav", 1,    0,    1,    0,    100
          rireturn
          outs a1, a2
      endif
      if gkcontrol == 2 then
          reinit myLabel
      endif

Oeyvind

2009/5/28 davistro :
>
>
>  In the following code, we have a control variable used to star reproducing
> a sample (if gkControl is 1) and stop reproducing if gkControl is 2 here is
> where we want to reinitialize the state of the opcode diskin or others like
> pluck, line, linen, etc. How can we do that?
>
>
> 
> 
>
>   -o dac -+rtaudio=alsa
>
> 
>
> 
>   sr = 44100
>   kr = 4410
>   ksmps = 10
>   nchnls = 2
>
>   gkcontrol    init 0
>
>   instr 1
>       gkcontrol    chnget    "sample"
>
>       if gkcontrol == 1 then
>           a1,a2    diskin    "rep1.wav", 1,    0,    1,    0,    100
>           outs a1, a2
>       endif
>       if gkcontrol == 2 then
>           ;Reiniciar
>       endif
>   endin
>
>   instr 2
>       gkcontrol    =    p4
>
>       printk2    gkcontrol
>
>   endin
>
>
>
> 
>
> 
>
> ;reproduccion todos los instrumentos
>
> i1    0    100
> i2    0    50    1
> i2    50  50    2
>
> 
>
> 
>
> --
> View this message in context: http://www.nabble.com/Reinitialize-instruments-in-real-time-tp23763800p23763800.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-06-01 02:35
Fromdavistro
SubjectRe: [Cs-dev] Re initialize instruments in real time
	
Although the code is correct in syntax, the result is not what I expect,
because the return value to 1 to hear that the sample does not start again
if it continues playing.
I tried to turnon and turnoff opcodes but without results.

Thanks and I hope someone can help me: S.


Oeyvind Brandtsegg-2 wrote:
> 
> Maybe like this (untested):
> 
>    if gkcontrol == 1 then
>           myLabel:
>           a1,a2    diskin    "rep1.wav", 1,    0,    1,    0,    100
>           rireturn
>           outs a1, a2
>       endif
>       if gkcontrol == 2 then
>           reinit myLabel
>       endif
> 
> Oeyvind
> 
> 2009/5/28 davistro :
>>
>>
>>  In the following code, we have a control variable used to star
>> reproducing
>> a sample (if gkControl is 1) and stop reproducing if gkControl is 2 here
>> is
>> where we want to reinitialize the state of the opcode diskin or others
>> like
>> pluck, line, linen, etc. How can we do that?
>>
>>
>> 
>> 
>>
>>   -o dac -+rtaudio=alsa
>>
>> 
>>
>> 
>>   sr = 44100
>>   kr = 4410
>>   ksmps = 10
>>   nchnls = 2
>>
>>   gkcontrol    init 0
>>
>>   instr 1
>>       gkcontrol    chnget    "sample"
>>
>>       if gkcontrol == 1 then
>>           a1,a2    diskin    "rep1.wav", 1,    0,    1,    0,    100
>>           outs a1, a2
>>       endif
>>       if gkcontrol == 2 then
>>           ;Reiniciar
>>       endif
>>   endin
>>
>>   instr 2
>>       gkcontrol    =    p4
>>
>>       printk2    gkcontrol
>>
>>   endin
>>
>>
>>
>> 
>>
>> 
>>
>> ;reproduccion todos los instrumentos
>>
>> i1    0    100
>> i2    0    50    1
>> i2    50  50    2
>>
>> 
>>
>> 
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Reinitialize-instruments-in-real-time-tp23763800p23763800.html
>> Sent from the Csound - Dev mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>> is a gathering of tech-side developers & brand creativity professionals.
>> Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>> iPhoneDevCamp as they present alongside digital heavyweights like
>> Barbarian
>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
> 
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals.
> Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like
> Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> 

-- 
View this message in context: http://www.nabble.com/Reinitialize-instruments-in-real-time-tp23763800p23808852.html
Sent from the Csound - Dev mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cso