[Csnd] turnoff signals with loscil
Date | 2009-10-23 02:27 |
From | Emerson Aagaard |
Subject | [Csnd] turnoff signals with loscil |
Hello list, I'm trying to make a very simple loscil instrument that will loop for a period of a specified duration, but before the end of this duration will "release", or basically stop looping and continue through the sample to the end. I read about this in the manual, and it says that this is possible to achieve this by sending the instrument a turnoff signal from the score. So far, however, I haven't found any way to send a turnoff signal from the score, and it looks like I would need to use if statements? I feel like this is more complicated than it needs to be (not a criticism of Csound if that's the way it is, but I'm saying like I feel I'm missing something obvious here). Thanks in advance for any help, and thanks to everyone again for the response to my query about linux, Emerson |
Date | 2009-10-23 08:09 |
From | Andres Cabrera |
Subject | [Csnd] Re: turnoff signals with loscil |
Hi, You can turn off an instrument with a negative number in an i statement in the score. Note that this will only turn off instruments with indefinite duration (always on). To create a note with indefinite duration use a negative number in the duration. Notice that you'll have to use abs() to get line to work in instr 1: |
Date | 2009-10-24 06:26 |
From | Emerson Aagaard |
Subject | [Csnd] Re: Re: turnoff signals with loscil |
Thanks for the assistance, Andres, but it's still not working how I want it to. Using your example, as well as the one in the manual, the note does turn off, but it is sudden, and it doesn't release. I'm not sure if I need to use an envelope or what, but I don't want to make any changes in amplitude; the sample decays naturally (and just for reference, I'm using Dr. B's "sing.aif" that's in the csound tootorials). Hope this is clear? Just in case, here's my csd. <CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments> sr = 44100
kr = 4410 ksmps = 10
nchnls = 1 instr 112
a1 loscil p4, p5, p6, 440, 1, 36962, 57090
out a1 endin </CsInstruments> <CsScore> f4 0 0 1 "samples\sing.aif" 0 4 0
i112 0 -6 10000 440 4
i-112 4 3 10000 440 4
e </CsScore> </CsoundSynthesizer>
Emerson |
Date | 2009-10-24 08:29 |
From | Andres Cabrera |
Subject | [Csnd] Re: Re: Re: turnoff signals with loscil |
Hi, Yes, you need an envelope. It will start the release phase when the note is turned off. You need special envelopes which have an additional release segment like linenr, linsegr or madsr. Cheers, Andrés On Sat, Oct 24, 2009 at 6:26 AM, Emerson Aagaard |
Date | 2009-10-24 16:32 |
From | Jacob Joaquin |
Subject | [Csnd] Re: Re: Re: turnoff signals with loscil |
I think I have a possible solution. I want to make sure that I understand the problem correctly first. You want to loop a sound. You will specify how long the sound will play. At the end of this duration, if the loop has not completed, you want the loop to finish playing before the instrument stops. For example, let's say you have a four second loop. You tell it to play for six seconds, which is two seconds shy of finishing the loop on the second pass. So the instrument needs to be smart enough to add an extra two seconds to the loop so it can finish out. If that is correct, the opcode xtratim can be used to extend the duration of the instrument. If not, please clarify the problem. Hope this helps. Best, Jake On Fri, Oct 23, 2009 at 10:26 PM, Emerson Aagaard |
Date | 2009-10-24 22:17 |
From | Emerson Aagaard |
Subject | [Csnd] Re: Re: Re: Re: turnoff signals with loscil |
Thanks Andres, I'll give it a shot. Jacob, that's sort of what I'm after, except what I want to happen is instead of just the loop finishing, I want the entire sound to finish (the loop is in the middle of the sound file). So I would want to happen, if I use the same sort of example, is that I have a 4 second sound-file, and I'm looping 2 seconds let's say, and I play it for 6, and want to start a release on the 4th second. It would finish it's current "pass" of the loop and then continue on to the end of the sound file. Hope this makes sense, and again, thanks for the help, guys. Emerson |
Date | 2009-10-28 16:05 |
From | Jacob Joaquin |
Subject | [Csnd] Re: Re: Re: Re: Re: turnoff signals with loscil |
I think this does what you want. Sorry it took so long to get back. |