[Csnd] Problem with control signals (k-cycle evaluation?)
Date | 2019-02-28 21:30 |
From | "Jeanette C." |
Subject | [Csnd] Problem with control signals (k-cycle evaluation?) |
Hey hey, I am experimenting with vdel_k to test a strategy for random triggering. The idea: set a delay time, delay a trigger, if delayed trigger is active, execute code, set new delay time, active trigger again... Where's the logic fault in the code below? I'm sure it's got something to do with execution/evaluation of code and k-cycles. This is the code: *** delayed_trigger.csd *** |
Date | 2019-02-28 22:12 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] Problem with control signals (k-cycle evaluation?) |
Just a quick guess. The delay seems to be interpolated, so perhaps the delayed signal does not actually reach 1. Also, it will not be as crisp and clean as the original. A more robust trigger, like >0.1 or something might work better. Den tor. 28. feb. 2019, 10:30 p.m. skrev Jeanette C. <julien@mail.upb.de>: Hey hey, |
Date | 2019-02-28 22:33 |
From | "Jeanette C." |
Subject | Re: [Csnd] Problem with control signals (k-cycle evaluation?) |
Feb 28 2019, Oeyvind Brandtsegg has written: > Just a quick guess. The delay seems to be interpolated, so perhaps the > delayed signal does not actually reach 1. Also, it will not be as crisp and > clean as the original. A more robust trigger, like >0.1 or something might > work better. If I understand correctly, you mean that I should change the if condition to something like: if kdel > x then or: if kdel >= x then I tried with the original code (ktrig 1 or 0) and kdel >=1. No luck. Of course, the issue is that instr 2 is triggered far too often. As the time of instr 1 (the triggering instrument) progresses, more and more notes get triggered with overlap. I also tried using trigger with an appropriate threshold and mode 0 (only trigger when value crosses from below threshold to above). Best wishes, Jeanette > > Den tor. 28. feb. 2019, 10:30 p.m. skrev Jeanette C. |
Date | 2019-03-01 07:46 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] Problem with control signals (k-cycle evaluation?) |
Yes, I was thinking you need the trigger, in the manner you describe. But it is unclear to me if you solved the problem or not(?). Thinking a bit more about it, the delay of trigger impulses is not a neat way to go about this, I think. Perhaps better to use event with a delay (positive p2), and then you can also recursively let the control instr trigger itself for repeated action. Pseudocode: idel = (random delay amount) gistop = (a global flag indicating if the process should continue) if gistop == 0 then event_i "i", p1+1, idel, p3, p4 ... event_i "i", p1, idel, p3, p4 ... endif Den tor. 28. feb. 2019 kl. 23:33 skrev Jeanette C. <julien@mail.upb.de>: Feb 28 2019, Oeyvind Brandtsegg has written: Oeyvind Brandtsegg Professor of Music Technology NTNU 7491 Trondheim Norway Cell: +47 92 203 205 http://www.partikkelaudio.com/ http://crossadaptive.hf.ntnu.no http://gdsp.hf.ntnu.no/ http://soundcloud.com/brandtsegg http://flyndresang.no/ http://soundcloud.com/t-emp |
Date | 2019-03-01 08:03 |
From | "Jeanette C." |
Subject | Re: [Csnd] Problem with control signals (k-cycle evaluation?) |
Hi Oeyvind, thanks again for your support. Due to my final requirements, I opted for a solution using timek and a random interval: know = timek kinterval init 2 knext init 2 * kr if know == knext then ... krandom rand 1 kinterval = round((krandom + 2) * kr) knext = know + kinterval endif This yields good results and looks efficient enough, I guess. :) 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 You know I'm one of a kind, There'll never be another 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-03-01 08:38 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] Problem with control signals (k-cycle evaluation?) |
That looks good too! Den fre. 1. mar. 2019 kl. 09:03 skrev Jeanette C. <julien@mail.upb.de>: Hi Oeyvind, Oeyvind Brandtsegg Professor of Music Technology NTNU 7491 Trondheim Norway Cell: +47 92 203 205 http://www.partikkelaudio.com/ http://crossadaptive.hf.ntnu.no http://gdsp.hf.ntnu.no/ http://soundcloud.com/brandtsegg http://flyndresang.no/ http://soundcloud.com/t-emp |