Csound Csound-dev Csound-tekno Search About

[Csnd] Turning instruments

Date2013-01-19 17:27
FromMartin Huenniger
Subject[Csnd] Turning instruments
Hi list,

I have the following problem: I'm trying to start instruments from an external API via score-events and I also want to use external score events to switch them off again. For now I do it like this:

instr 1
	if abs(p3)>0 then
		aout diskin2 p4, 1, 0, 1
		outs aout, aout
	else
		turnoff
	endif
endin

and I use sore-events of the form

i 1.1 0 -1 "sound.aiff" 

and

i 1.1 0 0 

to start several instances of the instrument 1 with different soundfies.

Now I want to fade the samples in and out during initialisation and turnoff. But this seems not to work with the turnoff opcode or at least with my architecture of the instrument. Do you have any suggestion, how to deal with this situation? I have to use the instances, but I do not necessarily need to use parameter p3 to distinguish between on and off events.

Best,
Martin

_________________________
Martin Hünniger
a_s_tarantoga@yahoo.de
a-s-tarantoga.tumblr.com
soundcloud.com/a_s_tarantoga






Date2013-01-19 18:08
FromTarmo Johannes
SubjectRe: [Csnd] Turning instruments
Hi,


Then you need some envelope for fade in and fade out
use for example madsr linsegr or similar - these enable you have the release 
(fade out) after the moment the turnoff is called or the instrument is called 
with negative number like

i -1 0 0

hope it was close to what you meant...

tarmo




On Saturday 19 January 2013 18:27:43 Martin Huenniger wrote:
> Hi list,
> 
> I have the following problem: I'm trying to start instruments from an
> external API via score-events and I also want to use external score events
> to switch them off again. For now I do it like this:
> 
> instr 1
> 	if abs(p3)>0 then
> 		aout diskin2 p4, 1, 0, 1
> 		outs aout, aout
> 	else
> 		turnoff
> 	endif
> endin
> 
> and I use sore-events of the form
> 
> i 1.1 0 -1 "sound.aiff"
> 
> and
> 
> i 1.1 0 0
> 
> to start several instances of the instrument 1 with different soundfies.
> 
> Now I want to fade the samples in and out during initialisation and turnoff.
> But this seems not to work with the turnoff opcode or at least with my
> architecture of the instrument. Do you have any suggestion, how to deal
> with this situation? I have to use the instances, but I do not necessarily
> need to use parameter p3 to distinguish between on and off events.
> 
> Best,
> Martin
> 
> _________________________
> Martin Hünniger
> a_s_tarantoga@yahoo.de
> a-s-tarantoga.tumblr.com
> soundcloud.com/a_s_tarantoga
> 
> 
> 
> 
> 
> 
> 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"


Date2013-01-19 18:21
FromSteven Yi
SubjectRe: [Csnd] Turning instruments
I'd also mention that if you follow Tarmo's advice, the original
instrument could be:

instr 1

       aout diskin2 p4, 1, 0, 1
       kenv linsegr 0, .01, 1, .1, 1, .25, 0
       aout = aout * kenv
       outs aout, aout

endin

(Have not tested above, but something like that)

The Android and iOS Example projects have a MultiTouchXY example that
uses the technique Tarmo mentioned of using negative p1 to turn off a
note, and at least I've found that works well for me.

steven

On Sat, Jan 19, 2013 at 6:08 PM, Tarmo Johannes
 wrote:
> Hi,
>
>
> Then you need some envelope for fade in and fade out
> use for example madsr linsegr or similar - these enable you have the release
> (fade out) after the moment the turnoff is called or the instrument is called
> with negative number like
>
> i -1 0 0
>
> hope it was close to what you meant...
>
> tarmo
>
>
>
>
> On Saturday 19 January 2013 18:27:43 Martin Huenniger wrote:
>> Hi list,
>>
>> I have the following problem: I'm trying to start instruments from an
>> external API via score-events and I also want to use external score events
>> to switch them off again. For now I do it like this:
>>
>> instr 1
>>       if abs(p3)>0 then
>>               aout diskin2 p4, 1, 0, 1
>>               outs aout, aout
>>       else
>>               turnoff
>>       endif
>> endin
>>
>> and I use sore-events of the form
>>
>> i 1.1 0 -1 "sound.aiff"
>>
>> and
>>
>> i 1.1 0 0
>>
>> to start several instances of the instrument 1 with different soundfies.
>>
>> Now I want to fade the samples in and out during initialisation and turnoff.
>> But this seems not to work with the turnoff opcode or at least with my
>> architecture of the instrument. Do you have any suggestion, how to deal
>> with this situation? I have to use the instances, but I do not necessarily
>> need to use parameter p3 to distinguish between on and off events.
>>
>> Best,
>> Martin
>>
>> _________________________
>> Martin Hünniger
>> a_s_tarantoga@yahoo.de
>> a-s-tarantoga.tumblr.com
>> soundcloud.com/a_s_tarantoga
>>
>>
>>
>>
>>
>>
>> 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"
>
>
> 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"
>


Date2013-01-19 18:41
FromMartin Huenniger
SubjectRe: [Csnd] Turning instruments
Hi Tarmo and Steven,

Thank you. I tried the linsegr before, but it wouldnt work with my instrument. But perhaps it is due to the if-statement in the instruments definition. I'll try again.

Best,
Martin

Am 19.01.2013 um 19:21 schrieb Steven Yi:

> I'd also mention that if you follow Tarmo's advice, the original
> instrument could be:
> 
> instr 1
> 
>       aout diskin2 p4, 1, 0, 1
>       kenv linsegr 0, .01, 1, .1, 1, .25, 0
>       aout = aout * kenv
>       outs aout, aout
> 
> endin
> 
> (Have not tested above, but something like that)
> 
> The Android and iOS Example projects have a MultiTouchXY example that
> uses the technique Tarmo mentioned of using negative p1 to turn off a
> note, and at least I've found that works well for me.
> 
> steven
> 
> On Sat, Jan 19, 2013 at 6:08 PM, Tarmo Johannes
>  wrote:
>> Hi,
>> 
>> 
>> Then you need some envelope for fade in and fade out
>> use for example madsr linsegr or similar - these enable you have the release
>> (fade out) after the moment the turnoff is called or the instrument is called
>> with negative number like
>> 
>> i -1 0 0
>> 
>> hope it was close to what you meant...
>> 
>> tarmo
>> 
>> 
>> 
>> 
>> On Saturday 19 January 2013 18:27:43 Martin Huenniger wrote:
>>> Hi list,
>>> 
>>> I have the following problem: I'm trying to start instruments from an
>>> external API via score-events and I also want to use external score events
>>> to switch them off again. For now I do it like this:
>>> 
>>> instr 1
>>>      if abs(p3)>0 then
>>>              aout diskin2 p4, 1, 0, 1
>>>              outs aout, aout
>>>      else
>>>              turnoff
>>>      endif
>>> endin
>>> 
>>> and I use sore-events of the form
>>> 
>>> i 1.1 0 -1 "sound.aiff"
>>> 
>>> and
>>> 
>>> i 1.1 0 0
>>> 
>>> to start several instances of the instrument 1 with different soundfies.
>>> 
>>> Now I want to fade the samples in and out during initialisation and turnoff.
>>> But this seems not to work with the turnoff opcode or at least with my
>>> architecture of the instrument. Do you have any suggestion, how to deal
>>> with this situation? I have to use the instances, but I do not necessarily
>>> need to use parameter p3 to distinguish between on and off events.
>>> 
>>> Best,
>>> Martin
>>> 
>>> _________________________
>>> Martin Hünniger
>>> a_s_tarantoga@yahoo.de
>>> a-s-tarantoga.tumblr.com
>>> soundcloud.com/a_s_tarantoga
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 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"
>> 
>> 
>> 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"
>> 
> 
> 
> 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"
> 

_________________________
Martin Hünniger
a_s_tarantoga@yahoo.de
a-s-tarantoga.tumblr.com
soundcloud.com/a_s_tarantoga






Date2013-01-19 18:46
FromMartin Huenniger
SubjectRe: [Csnd] Turning instruments
Hi,

yay! it works. Thanks for the help!!!

Best,
Martin

Am 19.01.2013 um 19:41 schrieb Martin Huenniger:

> Hi Tarmo and Steven,
> 
> Thank you. I tried the linsegr before, but it wouldnt work with my instrument. But perhaps it is due to the if-statement in the instruments definition. I'll try again.
> 
> Best,
> Martin
> 
> Am 19.01.2013 um 19:21 schrieb Steven Yi:
> 
>> I'd also mention that if you follow Tarmo's advice, the original
>> instrument could be:
>> 
>> instr 1
>> 
>>      aout diskin2 p4, 1, 0, 1
>>      kenv linsegr 0, .01, 1, .1, 1, .25, 0
>>      aout = aout * kenv
>>      outs aout, aout
>> 
>> endin
>> 
>> (Have not tested above, but something like that)
>> 
>> The Android and iOS Example projects have a MultiTouchXY example that
>> uses the technique Tarmo mentioned of using negative p1 to turn off a
>> note, and at least I've found that works well for me.
>> 
>> steven
>> 
>> On Sat, Jan 19, 2013 at 6:08 PM, Tarmo Johannes
>>  wrote:
>>> Hi,
>>> 
>>> 
>>> Then you need some envelope for fade in and fade out
>>> use for example madsr linsegr or similar - these enable you have the release
>>> (fade out) after the moment the turnoff is called or the instrument is called
>>> with negative number like
>>> 
>>> i -1 0 0
>>> 
>>> hope it was close to what you meant...
>>> 
>>> tarmo
>>> 
>>> 
>>> 
>>> 
>>> On Saturday 19 January 2013 18:27:43 Martin Huenniger wrote:
>>>> Hi list,
>>>> 
>>>> I have the following problem: I'm trying to start instruments from an
>>>> external API via score-events and I also want to use external score events
>>>> to switch them off again. For now I do it like this:
>>>> 
>>>> instr 1
>>>>     if abs(p3)>0 then
>>>>             aout diskin2 p4, 1, 0, 1
>>>>             outs aout, aout
>>>>     else
>>>>             turnoff
>>>>     endif
>>>> endin
>>>> 
>>>> and I use sore-events of the form
>>>> 
>>>> i 1.1 0 -1 "sound.aiff"
>>>> 
>>>> and
>>>> 
>>>> i 1.1 0 0
>>>> 
>>>> to start several instances of the instrument 1 with different soundfies.
>>>> 
>>>> Now I want to fade the samples in and out during initialisation and turnoff.
>>>> But this seems not to work with the turnoff opcode or at least with my
>>>> architecture of the instrument. Do you have any suggestion, how to deal
>>>> with this situation? I have to use the instances, but I do not necessarily
>>>> need to use parameter p3 to distinguish between on and off events.
>>>> 
>>>> Best,
>>>> Martin
>>>> 
>>>> _________________________
>>>> Martin Hünniger
>>>> a_s_tarantoga@yahoo.de
>>>> a-s-tarantoga.tumblr.com
>>>> soundcloud.com/a_s_tarantoga
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 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"
>>> 
>>> 
>>> 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"
>>> 
>> 
>> 
>> 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"
>> 
> 
> _________________________
> Martin Hünniger
> a_s_tarantoga@yahoo.de
> a-s-tarantoga.tumblr.com
> soundcloud.com/a_s_tarantoga
> 
> 
> 
> 
> 
> 
> 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"
> 

_________________________
Martin Hünniger
a_s_tarantoga@yahoo.de
a-s-tarantoga.tumblr.com
soundcloud.com/a_s_tarantoga