[Csnd] Question about lfo and linsegr
Date | 2019-02-08 20:23 |
From | brian@AMSYNTH.COM |
Subject | [Csnd] Question about lfo and linsegr |
Hi everyone, it appears that the lfo opcode provides a sinewave that is bipolar. Is there a unipolar alternative? Also, I've been using linsegr for envelopes, but it has the limitation that the sustain point must be the second-to-last step. Is there an alternative that allows the sustain point to be assignable to other points?
Thanks in advance! brian |
Date | 2019-02-08 20:34 |
From | john |
Subject | Re: [Csnd] Question about lfo and linsegr |
On Fri, 8 Feb 2019, brian@AMSYNTH.COM wrote: > > Hi everyone, > > it appears that the lfo opcode provides a sinewave that is bipolar. Is there a > unipolar alternative? > Just add kamp to the output > Also, I've been using linsegr for envelopes, but it has the limitation that > the sustain point must be the second-to-last step. Is there an alternative > that allows the sustain point to be assignable to other points? > > If it is the sustain point what are you expecting after? If using score then using linseg (or expseg etc) and arithmeric involving p3 usually works. If midi then I am out of my experience. Maybe I just do not understand what you want. ==John ff Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-02-08 20:42 |
From | Guillermo Senna |
Subject | Re: [Csnd] Question about lfo and linsegr |
A combination of linseg and xtratim? linseg is supposed to keep the last value. On 8/2/19 17:34, john wrote: > > > On Fri, 8 Feb 2019, brian@AMSYNTH.COM wrote: > >> >> Hi everyone, >> >> it appears that the lfo opcode provides a sinewave that is bipolar. >> Is there a >> unipolar alternative? >> > > > Just add kamp to the output > > >> Also, I've been using linsegr for envelopes, but it has the >> limitation that >> the sustain point must be the second-to-last step. Is there an >> alternative >> that allows the sustain point to be assignable to other points? >> >> > > If it is the sustain point what are you expecting after? If using > score then using linseg (or expseg etc) and arithmeric involving p3 > usually works. If midi then I am out of my experience. > > Maybe I just do not understand what you want. > > ==John ff > > Csound mailing list > Csound@listserv.heanet.ie > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-02-08 20:43 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Question about lfo and linsegr |
Hi John, ok, I'll try adding kamp (never would have thought of that!). As for linsegr, I am using midi, yes. My thought was to have sustain at one point, and upon release, successive attacks and decays. Kind of like the CZ synths of the 80s, which used "rate" and "level" points for each envelope step, rather than a traditional adsr profile.
brian
On Fri, 8 Feb 2019 20:34:19 +0000, john wrote: On Fri, 8 Feb 2019, brian@AMSYNTH.COMwrote:Hi everyone, it appears that the lfo opcode provides a sinewave that is bipolar. Is there a unipolar alternative?Just add kamp to the outputAlso, I've been using linsegr for envelopes, but it has the limitation that the sustain point must be the second-to-last step. Is there an alternative that allows the sustain point to be assignable to other points?If it is the sustain point what are you expecting after? If using score then using linseg (or expseg etc) and arithmeric involving p3 usually works. If midi then I am out of my experience. Maybe I just do not understand what you want. ==John ff Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
|
Date | 2019-02-08 21:10 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Question about lfo and linsegr |
Hi Guillermo, thanks for the suggestion; I tested out the xtratim examples in the Csound manual, but unfortunately they seem to just give a longish release, and nothing more.
brian
On Fri, 8 Feb 2019 17:42:28 -0300, Guillermo Senna wrote: A combination of linseg and xtratim? linseg is supposed to keep the last value. On 8/2/19 17:34, john wrote:On Fri, 8 Feb 2019, brian@AMSYNTH.COMwrote:Hi everyone, it appears that the lfo opcode provides a sinewave that is bipolar. Is there a unipolar alternative?Just add kamp to the outputAlso, I've been using linsegr for envelopes, but it has the limitation that the sustain point must be the second-to-last step. Is there an alternative that allows the sustain point to be assignable to other points?If it is the sustain point what are you expecting after? If using score then using linseg (or expseg etc) and arithmeric involving p3 usually works. If midi then I am out of my experience. Maybe I just do not understand what you want. ==John ff Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted hereCsound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
|
Date | 2019-02-08 21:16 |
From | Guillermo Senna |
Subject | Re: [Csnd] Question about lfo and linsegr |
Could you post the envelope you are working with? On 8/2/19 18:10, brian@AMSYNTH.COM wrote: > > > Hi Guillermo, > > thanks for the suggestion; I tested out the xtratim > examples in the Csound manual, but unfortunately they seem to just give > a longish release, and nothing more. > > brian > > On Fri, 8 Feb 2019 > 17:42:28 -0300, Guillermo Senna wrote: > >> A combination of linseg and > xtratim? linseg is supposed to keep the last >> value. >> >> On 8/2/19 > 17:34, john wrote: >>> On Fri, 8 Feb 2019, brian@AMSYNTH.COM [1]wrote: >>>> Hi everyone, it appears that the lfo opcode provides a sinewave > that is bipolar. Is there a unipolar alternative? >>> Just add kamp to > the output >>>> Also, I've been using linsegr for envelopes, but it > has the limitation that the sustain point must be the second-to-last > step. Is there an alternative that allows the sustain point to be > assignable to other points? >>> If it is the sustain point what are you > expecting after? If using score then using linseg (or expseg etc) and > arithmeric involving p3 usually works. If midi then I am out of my > experience. Maybe I just do not understand what you want. ==John ff > Csound mailing list Csound@listserv.heanet.ie [2] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [3] Send bugs reports to > https://github.com/csound/csound/issues [4] Discussions of bugs and > features can be posted here >> Csound mailing list >> > Csound@listserv.heanet.ie [5] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [6] >> Send bugs reports > to >> https://github.com/csound/csound/issues [7] >> Discussions of bugs > and features can be posted here > > > > Links: > ------ > [1] > mailto:brian@AMSYNTH.COM > [2] mailto:Csound@listserv.heanet.ie > [3] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > [4] > https://github.com/csound/csound/issues > [5] > mailto:Csound@listserv.heanet.ie > [6] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > [7] > https://github.com/csound/csound/issues > > Csound mailing list > Csound@listserv.heanet.ie > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-02-08 21:25 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Question about lfo and linsegr |
It's currently nothing special.. something like this: kenva1 linsegr 0, 0.01,0.9, 0.5,0.5, 0.14,0 I'd like to extend it like this, with the sustain point at the asterisk: kenva1 linsegr 0, 0.01,0.9, 0.5,0.5,* 0.01,0.9, 0.5,0.5, 0.3,0.8, 0.6,0.3, 0.14,0
Just to give a rough idea of the concept..
brian
On Fri, 8 Feb 2019 18:16:00 -0300, Guillermo Senna wrote: Could you post the envelope you are working with? On 8/2/19 18:10, brian@AMSYNTH.COMwrote:Hi Guillermo, thanks for the suggestion; I tested out the xtratim examples in the Csound manual, but unfortunately they seem to just give a longish release, and nothing more. brian On Fri, 8 Feb 2019 17:42:28 -0300, Guillermo Senna wrote:A combination of linseg andxtratim? linseg is supposed to keep the lastvalue. On 8/2/1917:34, john wrote:that is bipolar. Is there a unipolar alternative?On Fri, 8 Feb 2019, brian@AMSYNTH.COM[1]wrote:Hi everyone, it appears that the lfo opcode provides a sinewavethe outputJust add kamp tohas the limitation that the sustain point must be the second-to-last step. Is there an alternative that allows the sustain point to be assignable to other points?Also, I've been using linsegr for envelopes, but itexpecting after? If using score then using linseg (or expseg etc) and arithmeric involving p3 usually works. If midi then I am out of my experience. Maybe I just do not understand what you want. ==John ff Csound mailing list Csound@listserv.heanet.ie [2] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [3] Send bugs reports to https://github.com/csound/csound/issues[4] Discussions of bugs and features can be posted hereIf it is the sustain point what are youCsound mailing listCsound@listserv.heanet.ie [5] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND[6]Send bugs reportstohttps://github.com/csound/csound/issues [7] Discussions of bugsand features can be posted here Links: ------ [1] mailto:brian@AMSYNTH.COM [2] mailto:Csound@listserv.heanet.ie [3] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [4] https://github.com/csound/csound/issues [5] mailto:Csound@listserv.heanet.ie [6] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [7] https://github.com/csound/csound/issues Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted hereCsound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
|
Date | 2019-02-08 21:29 |
From | john |
Subject | Re: [Csnd] Question about lfo and linsegr |
You should be able to roll your own with use of te release opode but it is not easy. Iway thinking of xtratin and a new linseg for post-release activity. But might be complicated. There must be a csiound expert who can do this. ==John ff On Fri, 8 Feb 2019, brian@AMSYNTH.COM wrote: > > Hi Guillermo, > > thanks for the suggestion; I tested out the xtratim examples in the Csound > manual, but unfortunately they seem to just give a longish release, and > nothing more. > > > > brian > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-02-08 22:57 |
From | Guillermo Senna |
Subject | Re: [Csnd] Question about lfo and linsegr |
Attachments | xtratim.csd |
I've adapted the xtratim example found on the manual. There are probably a lot of easier ways to do it! I didn't optimize for the number of variables used; I created them as I needed them. On 8/2/19 18:25, brian@AMSYNTH.COM wrote: > > > It's currently nothing special.. something like this: > > kenva1 > linsegr 0, 0.01,0.9, 0.5,0.5, 0.14,0 > > I'd like to extend it like this, > with the sustain point at the asterisk: > > kenva1 linsegr 0, 0.01,0.9, > 0.5,0.5,* 0.01,0.9, 0.5,0.5, 0.3,0.8, 0.6,0.3, 0.14,0 > > Just to give a > rough idea of the concept.. > > brian > > On Fri, 8 Feb 2019 18:16:00 -0300, > Guillermo Senna wrote: > >> Could you post the envelope you are working > with? >> On 8/2/19 18:10, brian@AMSYNTH.COM [10]wrote: >> >>> Hi > Guillermo, thanks for the suggestion; I tested out the xtratim examples > in the Csound manual, but unfortunately they seem to just give a longish > release, and nothing more. brian On Fri, 8 Feb 2019 17:42:28 -0300, > Guillermo Senna wrote: >>>> A combination of linseg and >>> xtratim? > linseg is supposed to keep the last >>>> value. On 8/2/19 >>> 17:34, > john wrote: On Fri, 8 Feb 2019, brian@AMSYNTH.COM [1][1]wrote: >>>>> Hi everyone, it appears that the lfo opcode provides a > sinewave >>>> that is bipolar. Is there a unipolar alternative? > er-left:#1010ff 2px solid; margin-left:5px; width:100%"> >>> left:5px; > width:100%"> Also, I've been using linsegr for envelopes, but it has the > limitation that the sustain point must be the second-to-last step. Is > there an al >>>> ding-left:5px; border-left:#1010ff 2px solid; > margin-left:5px; width:100%"> >>>>> If it is the sustain point what > are you >>>> expecting after? If using score then using linse >>> etc) and > arithmeric involving p3 usually works. If midi then I am out of my > experience. Maybe I just do not understand what you want. ==John ff > Csound mailing list Csound@listserv.heanet.ie [2] [2] > https://listserv.heanet.ie/cgi-bin/wa?A0= >>>> nd/csound/issues[4] > Discussions of bugs and features can be posted here >>> h:100%">Csound > mailing list Csound@listserv.heanet.ie [3] [5] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [4][6] Send bugs reports > to https://github.com/csound/csound/issues [5] [7] Discussions of bugs > and features can be posted here Links: ------ [1] > mailto:brian@AMSYNTH.COM [6] [2] mailto:Csound@listserv > in/wa?A0=CSOUND > "https://github.com/csound/csound/issues">https://github.com/csound/csound/issues > [5] mailto:Csound@listserv.heanet.ie [7] [6] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [8] [7] > https://github.com/csound/csound/issues [9] Csound mail > eanet.ie/cgi-bin/ >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to >> Csound mailing list >> > Csound@listserv.heanet.ie [11] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [12] >> Send bugs reports > to >> https://github.com/csound/csound/issues [13] >> Discussions of bugs > and features can be posted here > > > > Links: > ------ > [1] > mailto:brian@AMSYNTH.COM > [2] mailto:Csound@listserv.heanet.ie > [3] > mailto:Csound@listserv.heanet.ie > [4] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > [5] > https://github.com/csound/csound/issues > [6] mailto:brian@AMSYNTH.COM > [7] > mailto:Csound@listserv.heanet.ie > [8] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > [9] > https://github.com/csound/csound/issues > [10] > mailto:brian@AMSYNTH.COM > [11] mailto:Csound@listserv.heanet.ie > [12] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > [13] > https://github.com/csound/csound/issues > > Csound mailing list > Csound@listserv.heanet.ie > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-02-08 23:19 |
From | Guillermo Senna |
Subject | Re: [Csnd] Question about lfo and linsegr |
I apologize. Line 37 should be: kEnvRel = kLastEnv + (0.9-kLastEnv)/(kr*0.01) * kStep On 8/2/19 19:57, Guillermo Senna wrote: > I've adapted the xtratim example found on the manual. There are probably > a lot of easier ways to do it! > > I didn't optimize for the number of variables used; I created them as I > needed them. > > > On 8/2/19 18:25, brian@AMSYNTH.COM wrote: >> >> >> It's currently nothing special.. something like this: >> >> kenva1 >> linsegr 0, 0.01,0.9, 0.5,0.5, 0.14,0 >> >> I'd like to extend it like this, >> with the sustain point at the asterisk: >> >> kenva1 linsegr 0, 0.01,0.9, >> 0.5,0.5,* 0.01,0.9, 0.5,0.5, 0.3,0.8, 0.6,0.3, 0.14,0 >> >> Just to give a >> rough idea of the concept.. >> >> brian >> >> On Fri, 8 Feb 2019 18:16:00 -0300, >> Guillermo Senna wrote: >> >>> Could you post the envelope you are working >> with? >>> On 8/2/19 18:10, brian@AMSYNTH.COM [10]wrote: >>> >>>> Hi >> Guillermo, thanks for the suggestion; I tested out the xtratim examples >> in the Csound manual, but unfortunately they seem to just give a longish >> release, and nothing more. brian On Fri, 8 Feb 2019 17:42:28 -0300, >> Guillermo Senna wrote: >>>>> A combination of linseg and >>>> xtratim? >> linseg is supposed to keep the last >>>>> value. On 8/2/19 >>>> 17:34, >> john wrote: On Fri, 8 Feb 2019, brian@AMSYNTH.COM [1][1]wrote: >>>>>> Hi everyone, it appears that the lfo opcode provides a >> sinewave >>>>> that is bipolar. Is there a unipolar alternative? >> er-left:#1010ff 2px solid; margin-left:5px; width:100%"> >>>> left:5px; >> width:100%"> Also, I've been using linsegr for envelopes, but it has the >> limitation that the sustain point must be the second-to-last step. Is >> there an al >>>>> ding-left:5px; border-left:#1010ff 2px solid; >> margin-left:5px; width:100%"> >>>>>> If it is the sustain point what >> are you >>>>> expecting after? If using score then using linse >>>> etc) and >> arithmeric involving p3 usually works. If midi then I am out of my >> experience. Maybe I just do not understand what you want. ==John ff >> Csound mailing list Csound@listserv.heanet.ie [2] [2] >> https://listserv.heanet.ie/cgi-bin/wa?A0= >>>>> nd/csound/issues[4] >> Discussions of bugs and features can be posted here >>>> h:100%">Csound >> mailing list Csound@listserv.heanet.ie [3] [5] >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [4][6] Send bugs reports >> to https://github.com/csound/csound/issues [5] [7] Discussions of bugs >> and features can be posted here Links: ------ [1] >> mailto:brian@AMSYNTH.COM [6] [2] mailto:Csound@listserv >> in/wa?A0=CSOUND >> "https://github.com/csound/csound/issues">https://github.com/csound/csound/issues >> [5] mailto:Csound@listserv.heanet.ie [7] [6] >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [8] [7] >> https://github.com/csound/csound/issues [9] Csound mail >> eanet.ie/cgi-bin/ >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND >> Send bugs reports to >>> Csound mailing list >>> >> Csound@listserv.heanet.ie [11] >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [12] >>> Send bugs reports >> to >>> https://github.com/csound/csound/issues [13] >>> Discussions of bugs >> and features can be posted here >> >> >> >> Links: >> ------ >> [1] >> mailto:brian@AMSYNTH.COM >> [2] mailto:Csound@listserv.heanet.ie >> [3] >> mailto:Csound@listserv.heanet.ie >> [4] >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND >> [5] >> https://github.com/csound/csound/issues >> [6] mailto:brian@AMSYNTH.COM >> [7] >> mailto:Csound@listserv.heanet.ie >> [8] >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND >> [9] >> https://github.com/csound/csound/issues >> [10] >> mailto:brian@AMSYNTH.COM >> [11] mailto:Csound@listserv.heanet.ie >> [12] >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND >> [13] >> https://github.com/csound/csound/issues >> >> Csound mailing list >> Csound@listserv.heanet.ie >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND >> Send bugs reports to >> https://github.com/csound/csound/issues >> Discussions of bugs and features can be posted here >> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-02-09 11:56 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Question about lfo and linsegr |
Hi Guillermo, I tried your file just now (with line 37 adjusted as you said), and it seems to be on the right track. If you try the code here below (I adjusted the audio options for use on my pc) you wil see that the final relase stage of "0.9, 0" is quite fast, when it is supposed to be slow. Also, you will hear that when a note sustain is released, the amplitude rises slightly before decreasing, which it shouldn't.
<CsoundSynthesizer>
brian
On Fri, 8 Feb 2019 20:19:52 -0300, Guillermo Senna wrote: I apologize. Line 37 should be: kEnvRel = kLastEnv + (0.9-kLastEnv)/(kr*0.01) * kStep On 8/2/19 19:57, Guillermo Senna wrote:I've adapted the xtratim example found on the manual. There are probably a lot of easier ways to do it! I didn't optimize for the number of variables used; I created them as I needed them. On 8/2/19 18:25, brian@AMSYNTH.COMwrote:It's currently nothing special.. something like this: kenva1 linsegr 0, 0.01,0.9, 0.5,0.5, 0.14,0 I'd like to extend it like this, with the sustain point at the asterisk: kenva1 linsegr 0, 0.01,0.9, 0.5,0.5,* 0.01,0.9, 0.5,0.5, 0.3,0.8, 0.6,0.3, 0.14,0 Just to give a rough idea of the concept.. brian On Fri, 8 Feb 2019 18:16:00 -0300, Guillermo Senna wrote:Could you post the envelope you are workingwith?On 8/2/19 18:10, brian@AMSYNTH.COM[10]wrote:Guillermo, thanks for the suggestion; I tested out the xtratim examples in the Csound manual, but unfortunately they seem to just give a longish release, and nothing more. brian On Fri, 8 Feb 2019 17:42:28 -0300, Guillermo Senna wrote:Hilinseg is supposed to keep the lastA combination of linseg andxtratim?john wrote: On Fri, 8 Feb 2019, brian@AMSYNTH.COM[1][1]wrote:value. On 8/2/1917:34,sinewaveHi everyone, it appears that the lfo opcode provides aer-left:#1010ff 2px solid; margin-left:5px; width:100%">that is bipolar. Is there a unipolar alternative?width:100%"> Also, I've been using linsegr for envelopes, but it has the limitation that the sustain point must be the second-to-last step. Is there an alleft:5px;margin-left:5px; width:100%">ding-left:5px; border-left:#1010ff 2px solid;are youIf it is the sustain point whatarithmeric involving p3 usually works. If midi then I am out of my experience. Maybe I just do not understand what you want. ==John ff Csound mailing list Csound@listserv.heanet.ie [2] [2] https://listserv.heanet.ie/cgi-bin/wa?A0=expecting after? If using score then using linseetc) andDiscussions of bugs and features can be posted herend/csound/issues[4]mailing list Csound@listserv.heanet.ie [3] [5] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [4][6] Send bugs reports to https://github.com/csound/csound/issues [5] [7] Discussions of bugs and features can be posted here Links: ------ [1] mailto:brian@AMSYNTH.COM [6] [2] mailto:Csound@listserv in/wa?A0=CSOUND "https://github.com/csound/csound/issues">https://github.com/csound/csound/issues [5] mailto:Csound@listserv.heanet.ie [7] [6] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [8] [7] https://github.com/csound/csound/issues[9] Csound mail eanet.ie/cgi-bin/h:100%">CsoundSend bugs reports tohttps://listserv.heanet.ie/cgi-bin/wa?A0=CSOUNDCsound mailing listCsound@listserv.heanet.ie [11] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND[12]Send bugs reportstohttps://github.com/csound/csound/issues [13] Discussions of bugsand features can be posted here Links: ------ [1] mailto:brian@AMSYNTH.COM [2] mailto:Csound@listserv.heanet.ie [3] mailto:Csound@listserv.heanet.ie [4] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [5] https://github.com/csound/csound/issues [6] mailto:brian@AMSYNTH.COM [7] mailto:Csound@listserv.heanet.ie [8] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [9] https://github.com/csound/csound/issues [10] mailto:brian@AMSYNTH.COM [11] mailto:Csound@listserv.heanet.ie [12] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [13] https://github.com/csound/csound/issues Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted hereCsound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
|
Date | 2019-02-09 16:48 |
From | Guillermo Senna |
Subject | Re: [Csnd] Question about lfo and linsegr |
Yes, that's because every time you change the 'kEnvRel linseg ...' line you have to sum the durations of the segments in that line and pass that value to xtratim. Here's instr1, now with two more variable! instr 1 inum notnum icps cpsmidi iamp ampmidi 0.5 itim1 = 0.01 iamp1 = 0.9 xtratim 2.71 ; the sum of durations in the release linseg. kEnvRel init 0 if (release:k() != 1) then kEnv linseg 0, 0.01, 0.9, 0.5, 0.5 else kEnvRel linseg 0, itim1, 0, 0, iamp1, 0.5, 0.5, 0.7, 0.1, 0.6, 0.9, 0.9, 0 kStep init 0 if kStep == 0 then kLastEnv = kEnv kEnv = 0 endif if kStep <= (kr*itim1) then kEnvRel = kLastEnv + (iamp1-kLastEnv)/(kr*itim1) * kStep kStep += 1 endif endif a1 oscili (kEnv+kEnvRel)*iamp, icps outs a1, a1 endin On 9/2/19 08:56, brian@AMSYNTH.COM wrote: > > > Hi Guillermo, > > I tried your file just now (with line 37 adjusted > as you said), and it seems to be on the right track. > > If you try the > code here below (I adjusted the audio options for use on my pc) you wil > see that the final relase stage of "0.9, 0" is quite fast, when it is > supposed to be slow. Also, you will hear that when a note sustain is > released, the amplitude rises slightly before decreasing, which it > shouldn't. > > ; Select audio/midi flags here according to platform > ; > Audio out Audio in Silent MIDI in > -odac -+rtaudio=jack -+rtmidi=alsa > -Ma ;;;realtime I/O > > ;Simple usage of the xtratim opcode > sr = 48000 > > ksmps = 10 > nchnls = 2 > 0dbfs=1 > > instr 1 > > inum notnum > icps cpsmidi > > iamp ampmidi 0.5 > > xtratim 1.55 > kEnvRel init 0 > if (release:k() != > 1) then > kEnv linseg 0, 0.01,0.9, 0.5, 0.5 > else > kEnvRel linseg 0, > 0.01, 0, 0, 0.9, 0.5,0.5, 0.7,0.1, 0.6,0.9, 0.9,0 > > kStep init 0 > > if > kStep == 0 then > kLastEnv = kEnv > kEnv = 0 > endif > > if kStep I > apologize. Line 37 should be: >> kEnvRel = kLastEnv + > (0.9-kLastEnv)/(kr*0.01) * kStep >> On 8/2/19 19:57, Guillermo Senna > wrote: >>> I've adapted the xtratim example found on the manual. There > are probably a lot of easier ways to do it! I didn't optimize for the > number of variables used; I created them as I needed them. On 8/2/19 > 18:25, brian@AMSYNTH.COM [23]wrote: >>>> It's currently nothing > special.. something like this: kenva1 linsegr 0, 0.01,0.9, 0.5,0.5, > 0.14,0 I'd like to extend it like this, with the sustain point at the > asterisk: kenva1 linsegr 0, 0.01,0.9, 0.5,0.5,* 0.01,0.9, 0.5,0.5, > 0.3,0.8, 0.6,0.3, 0.14,0 Just to give a rough idea of the concept.. > brian On Fri, 8 Feb 2019 18:16:00 -0300, Guillermo Senna wrote: >>>>> Could you post the envelope you are working >>>> with? >>>> > On 8/2/19 18:10, brian@AMSYNTH.COM [1][10]wrote: >>>>>> Hi > Guillermo, thanks for the suggestion; I tested out the xtratim examples > in the Csound manual, but unfortunately they seem to just give a longish > release, and nothing more. brian On Fri, 8 Feb 2019 17:42:28 -0300, > Guillermo Senna wrote: >>>>>> A combination of linseg and > xtratim? linseg is supposed to keep the last >>>> f 2px solid; > margin-left:5px; width:100%"> value. On 8/2/19> > brian@AMSYNTH.COM[1][1]wrote: >>>> ="padding-left:5px; > border-left:#1010ff 2px solid; margin-left:5px; width:100%"> Hi > everyone, it appears that the lfo opcode provides a sinewave >>>>>> that is bipolar. Is there a unipolar alternative? > er-left:#1010ff 2px solid; margin-left:5px; width:100%"> > ="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; > width:100%">left:5px; width:100%"> Also, I've been using linsegr for > envelopes, but it has the limitation that the sustain point must be the > second-to-last step. Is there an al >>>>>> ding-left:5px; > border-left:#1010ff 2px solid; >>>>> margin-left:5px; width:100%"> > border-left:#1010ff 2px solid; margin-left:5px; width:100%"> If it is > the sustain >>>>> "padding-left:5px; border-left:#1010ff 2px solid; > margin-left:5px; width:100%"> >>>> f 2px solid; margin-left:5px; > width:100%"> expecting after? If using score then using linse etc) and > arithmeric involving p3 usually works. If midi then I am out of my > experience. Maybe I just do not understand what you want. ==John ff > Csound mailing list https://listserv.heanet.ie/cgi-bin/wa?A0= > "padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; > width:100%">nd/csound/issues[4] Discussions of bugs and features can be > po >>>>> idth:100%"> >>>>> >>>>>> h:100%">Csound >>>>> mailing list > Csound@listserv.heanet.ie [2] [3] [5] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [3] [4][6] Send bugs > reports to > ub.com/csound/csound/issues">https://github.com/csound/csound/issues [5] > [7] Discussions of bugs and features can be posted here Links: ------ > [1] mailto:brian@AMSYNTH.COM [7] [6] [2] mailto:Csound@listserv > in/wa?A0=CSOUND "https://github.com/csound/csound/issues > to:Csound@listserv.heanet.ie [4] [7] [6] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [5] [8] [7] > https://github.com/csound/csound/issues [6][9] Csound ma >>>> gi-bin/ > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [8] Send bugs reports to > Csound mailing list > eanet.ie/cgi-bin/wa?A0=CSOUND">https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND[12] > >>>>>> Send bugs reports >>>>> to >>>> rder-left:#1010ff 2px solid; > margin-left:5px; width:100%">https://github.com/csound/csound/issues [9] > [13] Discussions of bugs and features can be posted here Links: ------ > [1] mailto:brian@AMSYNTH.COM [10] [2] mai > d@listserv.heanet.ie">Csound@listserv.heanet.ie [4] > https://listserv.heanet.ie/cg >>>> SOUND [5] > https://github.com/csound/csound/issues [11] [6] > mailto:brian@AMSYNTH.COM [12] [7] mailto:Csound@listserv.heanet.ie [13] > [8] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [14] [9] > https://github.com/csound/csound/issues [15] [10] > mailto:brian@AMSYNTH.COM [16] [11] mailto:Csound@listserv.heanet.ie [17] > [12] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [18] [13] > https://github.com/csound/csound/issues [19] Csound mailing list > Csound@listserv.heanet.ie [20] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [21] Send bugs reports > to https://github.com/csound/csound/issues [22] Discussions of bugs and > features can be posted here >> Csound mailing list >> Csound@listserv.heanet.ie [24] >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [25] >> Send bugs reports > to >> https://github.com/csound/csound/issues [26] >> Discussions of bugs > and features can be posted here > > > > Links: > ------ > [1] > mailto:brian@AMSYNTH.COM > [2] mailto:Csound@listserv.heanet.ie > [3] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > [4] > mailto:Csound@listserv.heanet.ie > [5] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > [6] > https://github.com/csound/csound/issues > [7] mailto:brian@AMSYNTH.COM > [8] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > [9] > https://github.com/csound/csound/issues > [10] > mailto:brian@AMSYNTH.COM > [11] > https://github.com/csound/csound/issues > [12] > mailto:brian@AMSYNTH.COM > [13] mailto:Csound@listserv.heanet.ie > [14] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > [15] > https://github.com/csound/csound/issues > [16] > mailto:brian@AMSYNTH.COM > [17] mailto:Csound@listserv.heanet.ie > [18] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > [19] > https://github.com/csound/csound/issues > [20] > mailto:Csound@listserv.heanet.ie > [21] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > [22] > https://github.com/csound/csound/issues > [23] > mailto:brian@AMSYNTH.COM > [24] mailto:Csound@listserv.heanet.ie > [25] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > [26] > https://github.com/csound/csound/issues > > Csound mailing list > Csound@listserv.heanet.ie > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-02-15 12:58 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Question about lfo and linsegr |
I'm not sure what you mean by adding kamp to the output. All I have been able to do so far is to add the LFO to the amplitude, but that just adds a tremolo effect, which I don't want yet. Can you show me where to make the changes? Here is the instrument I'm using:
<CsoundSynthesizer>
brian
On Fri, 8 Feb 2019 20:34:19 +0000, john wrote: On Fri, 8 Feb 2019, brian@AMSYNTH.COMwrote:Hi everyone, it appears that the lfo opcode provides a sinewave that is bipolar. Is there a unipolar alternative?Just add kamp to the outputAlso, I've been using linsegr for envelopes, but it has the limitation that the sustain point must be the second-to-last step. Is there an alternative that allows the sustain point to be assignable to other points?If it is the sustain point what are you expecting after? If using score then using linseg (or expseg etc) and arithmeric involving p3 usually works. If midi then I am out of my experience. Maybe I just do not understand what you want. ==John ff Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
|
Date | 2019-02-15 13:15 |
From | John ff |
Subject | Re: [Csnd] Question about lfo and linsegr |
What I meant was to replace klfo lfo gklfo,gkrate,0 by klfo lfo gklfo,gkrate klfo += gklfo in your example Sent from TypeApp On Feb 15, 2019, 12:59, at 12:59, brian@amsynth.com wrote: > > >I'm not sure what you mean by adding kamp to the output. All I have >been able to do so far is to add the LFO to the amplitude, but that >just >adds a tremolo effect, which I don't want yet. Can you show me where to >make the changes? > >Here is the instrument I'm using: > >-odac >-+rtaudio=jack -+rtmidi=alsa -Ma >-dm0 > >sr=48000 >ksmps=64 >nchnls=2 >0dbfs=1 > >;panel >FLcolor 233, 185, 110, >0, 0, 0 >FLpanel "ZSynth-MoogVCF-ModWheel >LFO",1010,550,300,100,4,-1,1 >FLvkeybd >"keyboard.map",960,90,20,430 >gkonoff,ihb2 FLbutton >"On/Off",0,1,2,100,30,20,20,0,1,0,0 >gk3,ihb4 FLbutton >"Exit",1,0,21,100,30,20,70,0,2,0,0 > >;displays for Cut-Q-LFO >Flsliders >ihval1 FLvalue "",60,30,520,20 >ihval2 FLvalue >"",60,30,520,70 >ihval3 FLvalue "",60,30,520,120 >ihval3b FLvalue >"",60,30,520,155 > >;display for Detune Flknob >ihval3c FLvalue >"",60,30,110,135 > >;displays for Amp Env Flsliders >ihval4 FLvalue >"",60,30,260,120+80 >ihval5 FLvalue "",60,30,260,120+130 >ihval6 FLvalue >"",60,30,260,120+180 >ihval7 FLvalue "",60,30,260,120+230 > >;displays for >Fil Env Flsliders >ihval8 FLvalue "",60,30,520,120+80 >ihval9 FLvalue >"",60,30,520,120+130 >ihval10 FLvalue "",60,30,520,120+180 >ihval11 >FLvalue "",60,30,520,120+230 > >;kout,ihandle Flslider "", imin, imax, >iexp, itype, idisp, iwidth, iheight, ix, iy > >gkfreq,gih1 FLslider >"Cutoff", 1, (sr)/2, 0, 25, ihval1, 355, 25, 143, 20 >gkreso,gih2 >FLslider "Resonance", 0.1, 0.99, 0, 25, ihval2, 355, 25, 143, >70 >gklfo,gih3 FLslider "LFO-level", 0, 30, 0, 25, ihval3, 155, 25, 343, >120 >gkrate,gih3b FLslider "LFO-rate", 0, 30, 0, 25, ihval3b, 155, 25, >343, 160 >gkdet,gih3c FLknob "Detune", 0, 4.0, 0, 1, ihval3c, 60, 40, >120 >;FLTK-COUNTERS MIN | MAX | STEP1 | STEP2 | TYPE | WIDTH | HEIGHT | X >| Y | OPCODE >gkBendRange, ihBendRange FLcount "Bend Range", -48, 48, 1, >1, 2, 100, 25, 210, 120, -1 > >;adsr volume >gkatt,gih4 FLslider "A. >attack",0.01, 2, 0, 25, ihval4, 155, 30, 90, 200 >gkdec,gih5 FLslider "A. >decay",0, 2, 0, 25, ihval5, 155, 30, 90, 250 >gksus,gih6 FLslider "A. >sustain",0.001, 1, 0, 25, ihval6, 155, 30, 90, 300 >gkrel,gih7 FLslider >"A. release",0, 4, 0, 25, ihval7, 155, 30, 90, 350 > >;adsr moog >filter >gkatt2,gih8 FLslider "F. attack",0.01, 2, 0, 25, ihval8, 155, 30, >343, 200 >gkdec2,gih9 FLslider "F. decay",0, 2, 0, 25, ihval9, 155, 30, >343, 250 >gksus2,gih10 FLslider "F. sustain",0.001, 1, 0, 25, ihval10, >155, 30, 343, 300 >gkrel2,gih11 FLslider "F. release",0, 4, 0, 25, >ihval11, 155, 30, 343, 350 > >FLpanel_end >FLrun > >;initial >values >FLsetVal_i 12000,gih1 ;init Cutoff value >FLsetVal_i .2,gih2 ;init >Q value >FLsetVal_i 1.01,gih3 ;init LFO level >FLsetVal_i 2.4,gih3b ;init >LFO rate >FLsetVal_i 1.01,gih3c ;init Detune value >FLsetVal_i 2, >ihBendRange ;init Pitch Bend value > >;amplitude envelope: >FLsetVal_i >0.02,gih4 ;init value attack >FLsetVal_i 0.31,gih5 ;init value >decay >FLsetVal_i .85,gih6 ;init value sustain >FLsetVal_i .5,gih7 ;init >value release > >;filter envelope: >FLsetVal_i 0.08,gih8 ;init value >attack >FLsetVal_i 0.54,gih9 ;init value decay >FLsetVal_i .14,gih10 ;init >value sustain >FLsetVal_i 1.60,gih11 ;init value release > >instr 1 > >if >gkonoff = 1 then >turnoff >endif > >iamp ampmidi .5 >ifreq cpsmidi > >kmax = >10 >kmin = 0 >imin = 0 >imax = 1 >ichan = 1 >ictlno = 1 > >;kdest ctrl7 ichan, >ictlno, kmin, kmax > >;k1 ctrl7 1,1,0,30 >;ktrig changed k1 >;FLsetVal >ktrig,k1,gih3 > >;k2 ctrl7 1,91,0,(sr)/2 >;trig changed k2 >;FLsetVal >ktrig,k2,gih1 > >;k3 ctrl7 1,93,0.1,0.99 >;ktrig changed k3 >;FLsetVal >ktrig,k3,gih2 > >;k4 ctrl7 1,74,0,4.0 >;ktrig changed k4 >;FLsetVal >ktrig,k4,gih3c > >;k5 ctrl7 1,71,0,30 >;ktrig changed k5 >;FLsetVal >ktrig,k5,gih3b > >kbend pchbend imin,imax >kbend = kbend*gkBendRange >kbend >= semitone(kbend) > >kporttime linseg 0,0.01,0.01 >kbend portk >kbend,kporttime > >klfo lfo gklfo,gkrate,0 >avco1 vco2 >iamp,(ifreq*kbend)+klfo,0 >avco2 vco2 >iamp,(ifreq*kbend*gkdet)+klfo,0 >asum sum avco1,avco2 >kadsrfilt mxadsr >i(gkatt2),i(gkdec2),i(gksus2),i(gkrel2),0,1 >afilt moogvcf >asum,gkfreq*kadsrfilt,gkreso > >kadsr mxadsr >i(gkatt),i(gkdec),i(gksus),i(gkrel),0,1 >outs >afilt*kadsr,afilt*kadsr > >endin > >instr 2 >exitnow >endin > >f1 0 16384 10 >1 >f0 [3600*24] > >brian > >On Fri, 8 Feb 2019 20:34:19 +0000, john wrote: > > >> On Fri, 8 Feb 2019, brian@AMSYNTH.COM [1]wrote: >> >>> Hi everyone, >it appears that the lfo opcode provides a sinewave that is bipolar. Is >there a unipolar alternative? >> >> Just add kamp to the output >> >>> >Also, I've been using linsegr for envelopes, but it has the limitation >that the sustain point must be the second-to-last step. Is there an >alternative that allows the sustain point to be assignable to other >points? >> >> If it is the sustain point what are you expecting after? If >using score >> then using linseg (or expseg etc) and arithmeric >involving p3 usually >> works. If midi then I am out of my experience. >> > >> Maybe I just do not understand what you want. >> >> ==John ff >> >> >Csound mailing list >> Csound@listserv.heanet.ie [2] >> >https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [3] >> Send bugs reports >to >> https://github.com/csound/csound/issues [4] >> Discussions of bugs >and features can be posted here > > > >Links: >------ >[1] >mailto:brian@AMSYNTH.COM >[2] mailto:Csound@listserv.heanet.ie >[3] >https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND >[4] >https://github.com/csound/csound/issues > >Csound mailing list >Csound@listserv.heanet.ie >https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND >Send bugs reports to > https://github.com/csound/csound/issues >Discussions of bugs and features can be posted here Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-02-15 13:29 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Question about lfo and linsegr |
Thanks John, that seemed to do the trick. (It might be an idea to mention this in the manual.. unless it's already mentioned somewhere else...)
brian
On Fri, 15 Feb 2019 13:15:59 +0000, John ff wrote: What I meant was to replace klfo lfo gklfo,gkrate,0 by klfo lfo gklfo,gkrate klfo += gklfo in your example Sent from TypeApp On Feb 15, 2019, 12:59, at 12:59, brian@amsynth.comwrote:I'm not sure what you mean by adding kamp to the output. All I have been able to do so far is to add the LFO to the amplitude, but that just adds a tremolo effect, which I don't want yet. Can you show me where to make the changes? Here is the instrument I'm using: -odac -+rtaudio=jack -+rtmidi=alsa -Ma -dm0 sr=48000 ksmps=64 nchnls=2 0dbfs=1 ;panel FLcolor 233, 185, 110, 0, 0, 0 FLpanel "ZSynth-MoogVCF-ModWheel LFO",1010,550,300,100,4,-1,1 FLvkeybd "keyboard.map",960,90,20,430 gkonoff,ihb2 FLbutton "On/Off",0,1,2,100,30,20,20,0,1,0,0 gk3,ihb4 FLbutton "Exit",1,0,21,100,30,20,70,0,2,0,0 ;displays for Cut-Q-LFO Flsliders ihval1 FLvalue "",60,30,520,20 ihval2 FLvalue "",60,30,520,70 ihval3 FLvalue "",60,30,520,120 ihval3b FLvalue "",60,30,520,155 ;display for Detune Flknob ihval3c FLvalue "",60,30,110,135 ;displays for Amp Env Flsliders ihval4 FLvalue "",60,30,260,120+80 ihval5 FLvalue "",60,30,260,120+130 ihval6 FLvalue "",60,30,260,120+180 ihval7 FLvalue "",60,30,260,120+230 ;displays for Fil Env Flsliders ihval8 FLvalue "",60,30,520,120+80 ihval9 FLvalue "",60,30,520,120+130 ihval10 FLvalue "",60,30,520,120+180 ihval11 FLvalue "",60,30,520,120+230 ;kout,ihandle Flslider "", imin, imax, iexp, itype, idisp, iwidth, iheight, ix, iy gkfreq,gih1 FLslider "Cutoff", 1, (sr)/2, 0, 25, ihval1, 355, 25, 143, 20 gkreso,gih2 FLslider "Resonance", 0.1, 0.99, 0, 25, ihval2, 355, 25, 143, 70 gklfo,gih3 FLslider "LFO-level", 0, 30, 0, 25, ihval3, 155, 25, 343, 120 gkrate,gih3b FLslider "LFO-rate", 0, 30, 0, 25, ihval3b, 155, 25, 343, 160 gkdet,gih3c FLknob "Detune", 0, 4.0, 0, 1, ihval3c, 60, 40, 120 ;FLTK-COUNTERS MIN | MAX | STEP1 | STEP2 | TYPE | WIDTH | HEIGHT | X | Y | OPCODE gkBendRange, ihBendRange FLcount "Bend Range", -48, 48, 1, 1, 2, 100, 25, 210, 120, -1 ;adsr volume gkatt,gih4 FLslider "A. attack",0.01, 2, 0, 25, ihval4, 155, 30, 90, 200 gkdec,gih5 FLslider "A. decay",0, 2, 0, 25, ihval5, 155, 30, 90, 250 gksus,gih6 FLslider "A. sustain",0.001, 1, 0, 25, ihval6, 155, 30, 90, 300 gkrel,gih7 FLslider "A. release",0, 4, 0, 25, ihval7, 155, 30, 90, 350 ;adsr moog filter gkatt2,gih8 FLslider "F. attack",0.01, 2, 0, 25, ihval8, 155, 30, 343, 200 gkdec2,gih9 FLslider "F. decay",0, 2, 0, 25, ihval9, 155, 30, 343, 250 gksus2,gih10 FLslider "F. sustain",0.001, 1, 0, 25, ihval10, 155, 30, 343, 300 gkrel2,gih11 FLslider "F. release",0, 4, 0, 25, ihval11, 155, 30, 343, 350 FLpanel_end FLrun ;initial values FLsetVal_i 12000,gih1 ;init Cutoff value FLsetVal_i .2,gih2 ;init Q value FLsetVal_i 1.01,gih3 ;init LFO level FLsetVal_i 2.4,gih3b ;init LFO rate FLsetVal_i 1.01,gih3c ;init Detune value FLsetVal_i 2, ihBendRange ;init Pitch Bend value ;amplitude envelope: FLsetVal_i 0.02,gih4 ;init value attack FLsetVal_i 0.31,gih5 ;init value decay FLsetVal_i .85,gih6 ;init value sustain FLsetVal_i .5,gih7 ;init value release ;filter envelope: FLsetVal_i 0.08,gih8 ;init value attack FLsetVal_i 0.54,gih9 ;init value decay FLsetVal_i .14,gih10 ;init value sustain FLsetVal_i 1.60,gih11 ;init value release instr 1 if gkonoff = 1 then turnoff endif iamp ampmidi .5 ifreq cpsmidi kmax = 10 kmin = 0 imin = 0 imax = 1 ichan = 1 ictlno = 1 ;kdest ctrl7 ichan, ictlno, kmin, kmax ;k1 ctrl7 1,1,0,30 ;ktrig changed k1 ;FLsetVal ktrig,k1,gih3 ;k2 ctrl7 1,91,0,(sr)/2 ;trig changed k2 ;FLsetVal ktrig,k2,gih1 ;k3 ctrl7 1,93,0.1,0.99 ;ktrig changed k3 ;FLsetVal ktrig,k3,gih2 ;k4 ctrl7 1,74,0,4.0 ;ktrig changed k4 ;FLsetVal ktrig,k4,gih3c ;k5 ctrl7 1,71,0,30 ;ktrig changed k5 ;FLsetVal ktrig,k5,gih3b kbend pchbend imin,imax kbend = kbend*gkBendRange kbend = semitone(kbend) kporttime linseg 0,0.01,0.01 kbend portk kbend,kporttime klfo lfo gklfo,gkrate,0 avco1 vco2 iamp,(ifreq*kbend)+klfo,0 avco2 vco2 iamp,(ifreq*kbend*gkdet)+klfo,0 asum sum avco1,avco2 kadsrfilt mxadsr i(gkatt2),i(gkdec2),i(gksus2),i(gkrel2),0,1 afilt moogvcf asum,gkfreq*kadsrfilt,gkreso kadsr mxadsr i(gkatt),i(gkdec),i(gksus),i(gkrel),0,1 outs afilt*kadsr,afilt*kadsr endin instr 2 exitnow endin f1 0 16384 10 1 f0 [3600*24] brian On Fri, 8 Feb 2019 20:34:19 +0000, john wrote:On Fri, 8 Feb 2019, brian@AMSYNTH.COM[1]wrote:it appears that the lfo opcode provides a sinewave that is bipolar. Is there a unipolar alternative?Hi everyone,Just add kamp to the outputAlso, I've been using linsegr for envelopes, but it has the limitation that the sustain point must be the second-to-last step. Is there an alternative that allows the sustain point to be assignable to other points?If it is the sustain point what are you expecting after? Ifusing scorethen using linseg (or expseg etc) and arithmericinvolving p3 usuallyworks. If midi then I am out of my experience.Maybe I just do not understand what you want. ==John ffCsound mailing listCsound@listserv.heanet.ie [2]https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND[3]Send bugs reportstohttps://github.com/csound/csound/issues [4] Discussions of bugsand features can be posted here Links: ------ [1] mailto:brian@AMSYNTH.COM [2] mailto:Csound@listserv.heanet.ie [3] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [4] https://github.com/csound/csound/issues Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted hereCsound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
|
Date | 2019-02-15 13:31 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Question about lfo and linsegr |
Hi Guillermo, thanks for this! It works fine here.. I have to study the math a bit, but it seems to make sense. -I'm playing around with the envelope parameters and getting nice results! :) brian
On Sat, 9 Feb 2019 13:48:46 -0300, Guillermo Senna wrote: Yes, that's because every time you change the 'kEnvRel linseg ...' line you have to sum the durations of the segments in that line and pass that value to xtratim. Here's instr1, now with two more variable! instr 1 inum notnum icps cpsmidi iamp ampmidi 0.5 itim1 = 0.01 iamp1 = 0.9 xtratim 2.71 ; the sum of durations in the release linseg. kEnvRel init 0 if (release:k() != 1) then kEnv linseg 0, 0.01, 0.9, 0.5, 0.5 else kEnvRel linseg 0, itim1, 0, 0, iamp1, 0.5, 0.5, 0.7, 0.1, 0.6, 0.9, 0.9, 0 kStep init 0 if kStep == 0 then kLastEnv = kEnv kEnv = 0 endif if kStepbrian@AMSYNTH.COMwrote:Hi Guillermo, I tried your file just now (with line 37 adjusted as you said), and it seems to be on the right track. If you try the code here below (I adjusted the audio options for use on my pc) you wil see that the final relase stage of "0.9, 0" is quite fast, when it is supposed to be slow. Also, you will hear that when a note sustain is released, the amplitude rises slightly before decreasing, which it shouldn't. ; Select audio/midi flags here according to platform ; Audio out Audio in Silent MIDI in -odac -+rtaudio=jack -+rtmidi=alsa -Ma ;;;realtime I/O ;Simple usage of the xtratim opcode sr = 48000 ksmps = 10 nchnls = 2 0dbfs=1 instr 1 inum notnum icps cpsmidi iamp ampmidi 0.5 xtratim 1.55 kEnvRel init 0 if (release:k() != 1) then kEnv linseg 0, 0.01,0.9, 0.5, 0.5 else kEnvRel linseg 0, 0.01, 0, 0, 0.9, 0.5,0.5, 0.7,0.1, 0.6,0.9, 0.9,0 kStep init 0 if kStep == 0 then kLastEnv = kEnv kEnv = 0 endif if kStep I apologize. Line 37 should be:kEnvRel = kLastEnv +(0.9-kLastEnv)/(kr*0.01) * kStepOn 8/2/19 19:57, Guillermo Sennawrote:are probably a lot of easier ways to do it! I didn't optimize for the number of variables used; I created them as I needed them. On 8/2/19 18:25, brian@AMSYNTH.COM[23]wrote:I've adapted the xtratim example found on the manual. Therespecial.. something like this: kenva1 linsegr 0, 0.01,0.9, 0.5,0.5, 0.14,0 I'd like to extend it like this, with the sustain point at the asterisk: kenva1 linsegr 0, 0.01,0.9, 0.5,0.5,* 0.01,0.9, 0.5,0.5, 0.3,0.8, 0.6,0.3, 0.14,0 Just to give a rough idea of the concept.. brian On Fri, 8 Feb 2019 18:16:00 -0300, Guillermo Senna wrote:It's currently nothingOn 8/2/19 18:10, brian@AMSYNTH.COM[1][10]wrote:Could you post the envelope you are workingwith?Guillermo, thanks for the suggestion; I tested out the xtratim examples in the Csound manual, but unfortunately they seem to just give a longish release, and nothing more. brian On Fri, 8 Feb 2019 17:42:28 -0300, Guillermo Senna wrote:Hixtratim? linseg is supposed to keep the lastA combination of linseg andmargin-left:5px; width:100%"> value. On 8/2/19> brian@AMSYNTH.COM[1][1]wrote:f 2px solid;border-left:#1010ff 2px solid; margin-left:5px; width:100%"> Hi everyone, it appears that the lfo opcode provides a sinewave="padding-left:5px;er-left:#1010ff 2px solid; margin-left:5px; width:100%"> ="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%">left:5px; width:100%"> Also, I've been using linsegr for envelopes, but it has the limitation that the sustain point must be the second-to-last step. Is there an althat is bipolar. Is there a unipolar alternative?border-left:#1010ff 2px solid;ding-left:5px;border-left:#1010ff 2px solid; margin-left:5px; width:100%"> If it is the sustainmargin-left:5px; width:100%">margin-left:5px; width:100%">"padding-left:5px; border-left:#1010ff 2px solid;width:100%"> expecting after? If using score then using linse etc) and arithmeric involving p3 usually works. If midi then I am out of my experience. Maybe I just do not understand what you want. ==John ff Csound mailing list https://listserv.heanet.ie/cgi-bin/wa?A0="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%">nd/csound/issues[4] Discussions of bugs and features can be pof 2px solid; margin-left:5px;Csound@listserv.heanet.ie [2] [3] [5] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [3] [4][6] Send bugs reports to ub.com/csound/csound/issues">https://github.com/csound/csound/issues [5] [7] Discussions of bugs and features can be posted here Links: ------ [1] mailto:brian@AMSYNTH.COM [7] [6] [2] mailto:Csound@listserv in/wa?A0=CSOUND "https://github.com/csound/csound/issues to:Csound@listserv.heanet.ie [4] [7] [6] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [5] [8] [7] https://github.com/csound/csound/issues[6][9] Csound maidth:100%">h:100%">Csoundmailing listhttps://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [8] Send bugs reports to Csound mailing list eanet.ie/cgi-bin/wa?A0=CSOUND">https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND[12]gi-bin/margin-left:5px; width:100%">https://github.com/csound/csound/issues [9] [13] Discussions of bugs and features can be posted here Links: ------ [1] mailto:brian@AMSYNTH.COM [10] [2] mai d@listserv.heanet.ie">Csound@listserv.heanet.ie [4] https://listserv.heanet.ie/cgrder-left:#1010ff 2px solid;Send bugs reportstohttps://github.com/csound/csound/issues [11] [6] mailto:brian@AMSYNTH.COM [12] [7] mailto:Csound@listserv.heanet.ie [13] [8] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [14] [9] https://github.com/csound/csound/issues [15] [10] mailto:brian@AMSYNTH.COM [16] [11] mailto:Csound@listserv.heanet.ie [17] [12] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [18] [13] https://github.com/csound/csound/issues [19] Csound mailing list Csound@listserv.heanet.ie [20] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [21] Send bugs reports to https://github.com/csound/csound/issues[22] Discussions of bugs and features can be posted hereSOUND [5]Csound mailing list Csound@listserv.heanet.ie [24]https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND[25]Send bugs reportstohttps://github.com/csound/csound/issues [26] Discussions of bugsand features can be posted here Links: ------ [1] mailto:brian@AMSYNTH.COM [2] mailto:Csound@listserv.heanet.ie [3] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [4] mailto:Csound@listserv.heanet.ie [5] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [6] https://github.com/csound/csound/issues [7] mailto:brian@AMSYNTH.COM [8] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [9] https://github.com/csound/csound/issues [10] mailto:brian@AMSYNTH.COM [11] https://github.com/csound/csound/issues [12] mailto:brian@AMSYNTH.COM [13] mailto:Csound@listserv.heanet.ie [14] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [15] https://github.com/csound/csound/issues [16] mailto:brian@AMSYNTH.COM [17] mailto:Csound@listserv.heanet.ie [18] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [19] https://github.com/csound/csound/issues [20] mailto:Csound@listserv.heanet.ie [21] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [22] https://github.com/csound/csound/issues [23] mailto:brian@AMSYNTH.COM [24] mailto:Csound@listserv.heanet.ie [25] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND [26] https://github.com/csound/csound/issues Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted hereCsound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
|