[Csnd] Negative Envelope Contour
Date | 2019-06-08 13:10 |
From | brian@AMSYNTH.COM |
Subject | [Csnd] Negative Envelope Contour |
Hi everyone, does anyone know how to get an envelope (eg. linseg) to provide a negative contour rather than positive?
Thanks in advance! Brian |
Date | 2019-06-08 13:16 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Negative Envelope Contour |
Use negative values (linear envs) or a simple arithmetic expression (exp envs, depending on how you want the curve) Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2019-06-08 13:17 |
From | "Jeanette C." |
Subject | Re: [Csnd] Negative Envelope Contour |
Jun 8 2019, brian@AMSYNTH.COM has written: > > > Hi everyone, > > does anyone know how to get an envelope (eg. linseg) > to provide a negative contour rather than positive? ... Negative in which way? Going from e.g. 0 to -1 or forming the opposite of a "normal positive" curve? 1. You could just go from 0 to -1, I am not aware of a restraint there or you could multiply the output of a positive env by -1. 2. You can subtract your positive contour from the maximum value. e.g.: kpositive linseg 0, p3/3, 1.5, p3/3, 1.2, p3/3, 0 ; Maximum is 1.5 kcomplement = 1.5 - kpositive HTH, best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s With you I get so high Lost in the crystal sky You are this melody That's where you take me <3 (Britney Spears) 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-06-08 13:20 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Negative Envelope Contour |
Thanks Victor and Jeanette! I'll try your suggestions and see what I get. (Yes, something like going from 0 to -1 instead of 0 to +1) I guess I could have experimented a bit myself first on this one.. but sometimes suggestions are better! :)
Brian
On Sat, 8 Jun 2019 14:17:29 +0200, Jeanette C. wrote: Jun 8 2019, brian@AMSYNTH.COMhas written:Hi everyone, does anyone know how to get an envelope (eg. linseg) to provide a negative contour rather than positive?... Negative in which way? Going from e.g. 0 to -1 or forming the opposite of a "normal positive" curve? 1. You could just go from 0 to -1, I am not aware of a restraint there or you could multiply the output of a positive env by -1. 2. You can subtract your positive contour from the maximum value. e.g.: kpositive linseg 0, p3/3, 1.5, p3/3, 1.2, p3/3, 0 ; Maximum is 1.5 kcomplement = 1.5 - kpositive HTH, best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s With you I get so high Lost in the crystal sky You are this melody That's where you take me 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-06-08 13:37 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Negative Envelope Contour |
Still the same problem, but this time using madsr. The Csound Manual says that madsr range is 0 to 1, but I don't see any way to make this a negative amount..
On Sat, 8 Jun 2019 14:17:29 +0200, Jeanette C. wrote: Jun 8 2019, brian@AMSYNTH.COMhas written:Hi everyone, does anyone know how to get an envelope (eg. linseg) to provide a negative contour rather than positive?... Negative in which way? Going from e.g. 0 to -1 or forming the opposite of a "normal positive" curve? 1. You could just go from 0 to -1, I am not aware of a restraint there or you could multiply the output of a positive env by -1. 2. You can subtract your positive contour from the maximum value. e.g.: kpositive linseg 0, p3/3, 1.5, p3/3, 1.2, p3/3, 0 ; Maximum is 1.5 kcomplement = 1.5 - kpositive HTH, best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s With you I get so high Lost in the crystal sky You are this melody That's where you take me 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-06-08 13:47 |
From | "Jeanette C." |
Subject | Re: [Csnd] Negative Envelope Contour |
Jun 8 2019, brian@AMSYNTH.COM has written: > > > Still the same problem, but this time using madsr. The Csound > Manual says that madsr range is 0 to 1, but I don't see any way to make > this a negative amount.. ... Multiply the result by -1. Best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s With you I get so high Lost in the crystal sky You are this melody That's where you take me <3 (Britney Spears) 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-06-08 14:01 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Negative Envelope Contour |
Doesn't seem to work. I am trying: filterfreq * (filtermadsr*(-1)) but no sound.
On Sat, 8 Jun 2019 14:47:50 +0200, Jeanette C. wrote: Jun 8 2019, brian@AMSYNTH.COMhas written:Still the same problem, but this time using madsr. The Csound Manual says that madsr range is 0 to 1, but I don't see any way to make this a negative amount..... Multiply the result by -1. Best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s With you I get so high Lost in the crystal sky You are this melody That's where you take me 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-06-08 14:11 |
From | "Jeanette C." |
Subject | Re: [Csnd] Negative Envelope Contour |
Jun 8 2019, brian@AMSYNTH.COM has written: > > > Doesn't seem to work. I am trying: filterfreq * (filtermadsr*(-1)) > but no sound. ... Hm, I'm not too sure about the filters, but this would result in a negative filter frequency and that might not work. Try: kinvadsr = 1 - kadsr kfilterfreq * kinvadsr This would result in a filter frequency between 0 and kfilterfreq. Most likely, you'd be better off with something like: kbasefilterfreq = minimum kmaxamount = some_value kfilterfreq = kbasefilterfreq + kmaxamount * kinvadsr Because of the 1 - kmadsr you'll get the reverse shape of the adsr. You could also multiply the adsr output by -1 and use the above version with kbasefilterfreq ad kmaxamount, but then your filterfrequency would bo from kbasefilterfreq - kmaxamount to kbasefilterfreq. That means you should keep kmaxmount less than kbasefilterfreq. If you'd want to set the modulation amount dynamically, you could use limit or some other opcode to make sure that the actual filterfrequency never goes below 0. HTH, best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s With you I get so high Lost in the crystal sky You are this melody That's where you take me <3 (Britney Spears) 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-06-08 15:15 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Negative Envelope Contour |
I'm trying 1-madsr and getting some results, but sometimes notes don't sound. It's like something needs to "finish" before another note can sound. It's very irregular though.. sometimes it works for a bit, othertimes no.
On Sat, 8 Jun 2019 15:11:00 +0200, Jeanette C. wrote: Jun 8 2019, brian@AMSYNTH.COMhas written:Doesn't seem to work. I am trying: filterfreq * (filtermadsr*(-1)) but no sound.... Hm, I'm not too sure about the filters, but this would result in a negative filter frequency and that might not work. Try: kinvadsr = 1 - kadsr kfilterfreq * kinvadsr This would result in a filter frequency between 0 and kfilterfreq. Most likely, you'd be better off with something like: kbasefilterfreq = minimum kmaxamount = some_value kfilterfreq = kbasefilterfreq + kmaxamount * kinvadsr Because of the 1 - kmadsr you'll get the reverse shape of the adsr. You could also multiply the adsr output by -1 and use the above version with kbasefilterfreq ad kmaxamount, but then your filterfrequency would bo from kbasefilterfreq - kmaxamount to kbasefilterfreq. That means you should keep kmaxmount less than kbasefilterfreq. If you'd want to set the modulation amount dynamically, you could use limit or some other opcode to make sure that the actual filterfrequency never goes below 0. HTH, best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s With you I get so high Lost in the crystal sky You are this melody That's where you take me 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-06-08 15:29 |
From | "Jeanette C." |
Subject | Re: [Csnd] Negative Envelope Contour |
Jun 8 2019, brian@AMSYNTH.COM has written: > > > I'm trying 1-madsr and getting some results, but sometimes notes > don't sound. It's like something needs to "finish" before another note > can sound. It's very irregular though.. sometimes it works for a bit, > othertimes no. Can you send example code? Best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s With you I get so high Lost in the crystal sky You are this melody That's where you take me <3 (Britney Spears) 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-06-08 15:30 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Negative Envelope Contour |
Sure:
<CsoundSynthesizer>
On Sat, 8 Jun 2019 16:29:17 +0200, Jeanette C. wrote: Jun 8 2019, brian@AMSYNTH.COMhas written:I'm trying 1-madsr and getting some results, but sometimes notes don't sound. It's like something needs to "finish" before another note can sound. It's very irregular though.. sometimes it works for a bit, othertimes no.Can you send example code? Best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s With you I get so high Lost in the crystal sky You are this melody That's where you take me 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-06-08 15:48 |
From | "Jeanette C." |
Subject | Re: [Csnd] Negative Envelope Contour |
Jun 8 2019, brian@AMSYNTH.COM has written: ... > afilt mvclpf1 > asum,(gkfreq*(1-kadsrfilt))*ifilt,gkreso ... (gkfreq*(1-kadsrfilt))*ifilt This still only multiplies the values and the moment kadsrfilt reaches 1, the product is 0. Best work with addition. Set either gkfreq or ifilt as the basic filter frequency and then add the "modulation amount" * (1-kadsrfilt) to that. I'm sorry, I wouldn't be able to run your example, being blind and having difficulties with the FLTK interface and I never bothered to read the manual for the opcodes to create "fixed" instruments from that with all values within reach of the UI. Best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s With you I get so high Lost in the crystal sky You are this melody That's where you take me <3 (Britney Spears) 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-06-08 17:36 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Negative Envelope Contour |
Jeanette, I think *I* was the one who couldn't see what the problem was! ;) Your suggestion was right; using "1.001 - kadsrfilt" prevents reaching 0, and it appears that there is a nice range between 1.001 and 1.999. I added a slider to access this depth in realtime, and just to see the final product. The filter frequency is hardwired to the Modulation Wheel, and adjusting that and resonance gives nice results. Here below is the final code, with settings done in such a way that the filter release stage gives a nice "up" effect. Thanks for your help Jeanette! Brian
<CsoundSynthesizer>
On Sat, 8 Jun 2019 16:48:40 +0200, Jeanette C. wrote: Jun 8 2019, brian@AMSYNTH.COMhas written: ...afilt mvclpf1 asum,(gkfreq*(1-kadsrfilt))*ifilt,gkreso... (gkfreq*(1-kadsrfilt))*ifilt This still only multiplies the values and the moment kadsrfilt reaches 1, the product is 0. Best work with addition. Set either gkfreq or ifilt as the basic filter frequency and then add the "modulation amount" * (1-kadsrfilt) to that. I'm sorry, I wouldn't be able to run your example, being blind and having difficulties with the FLTK interface and I never bothered to read the manual for the opcodes to create "fixed" instruments from that with all values within reach of the UI. Best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s With you I get so high Lost in the crystal sky You are this melody That's where you take me 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-06-08 18:05 |
From | "Jeanette C." |
Subject | Re: [Csnd] Negative Envelope Contour |
Hey hey Brian, I'm glad you got some working code for a live, performance oriented instrument. Enjoy tweaking your parameters. :) Best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s I believe We all have one true love Somewhere in this world <3 (Britney Spears) 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-06-08 18:41 |
From | brian@AMSYNTH.COM |
Subject | Re: [Csnd] Negative Envelope Contour |
A "gift"! :) This is a brass/trumpet preset I just made, using contour (normal, not inverted). Tweak the cutoff to get it to taste. Enjoy! :)
<CsoundSynthesizer>
On Sat, 8 Jun 2019 19:05:11 +0200, Jeanette C. wrote: Hey hey Brian, I'm glad you got some working code for a live, performance oriented instrument. Enjoy tweaking your parameters. :) Best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s I believe We all have one true love Somewhere in this world 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
|