[Csnd] gk variables performs oddly
Date | 2019-03-12 07:17 |
From | Kim공학하는 음대생 Toby |
Subject | [Csnd] gk variables performs oddly |
I'm trying to make a global LFO as gklfo it DOES work but the outcome isn't the same as I expected First off, I tried klfo lfo .5, .5 0 klfo = klfo + .5 and printk .1 klfo then I get values from 0 to 1 just fine However, When I do klfo lfo .5, .5 0 klfo = klfo + .5 gklfo = gklfo + klfo printk .1, gklfo The value keeps adding up even till 8,000 and Even if I disable klfo = klfo + .5, and do klfo lfo 1, .5 0 gklfo = gklfo + klfo printk .1, gklfo LFO works as it should be but the value goes from 0 to 877 below is my code Can someone tell me what I have done wrong??? <CsoundSynthesizer> <CsOptions> -odac -d </CsOptions> <CsInstruments> sr = 44100 ksmps = 32 nchnls = 2 0dbfs = 1 gaout init 0 gklfo init 0 instr 1 idur = p3 kenv linen 1, 1, idur, 3 kamp =gklfo a1 oscil kamp, 440, 1 a2 = a1 * kenv gaout = gaout + a2 out gaout endin instr 2 klfo lfo 1, .5, 0 ;klfo = klfo + .5 gklfo = gklfo + klfo printk .1, gklfo endin </CsInstruments> <CsScore> f 1 0 4096 10 1 f 2 0 4096 10 1 .5 .333 .25 .2 .166 .142 .125 .111 .1 .09 .083 .076 .071 .066 .062 f 3 0 4096 10 1 0 .333 0 .2 0 .142 0 .111 0 .09 0 .076 0 .066 0 i 1 0 10 i 2 0 60 </CsScore> </CsoundSynthesizer> |
Date | 2019-03-12 08:25 |
From | "Jeanette C." |
Subject | Re: [Csnd] gk variables performs oddly |
Hey hey Kim, Mar 12 2019, Kim공학하는 음대생 Toby has written: ... > klfo lfo .5, .5 0 > klfo = klfo + .5 > > gklfo = gklfo + klfo ... The above is the wrong line, you add klfo's value to the value already stored in gklfo. So the value gets bigger. I suppose the best way to write this code could be: klfo lfo .5, .5 0 gklfo = klfo + .5 One less assignment operation. 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 There's no time to loose And next week, You might not see me here <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-03-12 21:53 |
From | Kim공학하는 음대생 Toby |
Subject | Re: [Csnd] gk variables performs oddly |
Thanks a lot !!! On Tue, 12 Mar 2019 at 5:24 PM Jeanette C. <julien@mail.upb.de> wrote: Hey hey Kim, |