Hello Michael,Thanks a lot for your help. I don't know if i can reply to you with other questions or if i should use "chuck-users@lists.cs.princeton.edu".
In the meantime i found a solution for my "pause" problem in the use of ADSR. But i still have some general questions and some about the program that follows:
- Where can i find a chuck editor with the possibility to find words and replace them (all) and that also gives the colors for reserved words etc.
- Is there a way to debug line per line to discover logical errors?
- i discovered by accident that sometimes i can use "p.puf" but on other occasions i have to write "p.buf()" why is this?
- in the program hereby, is there a way to have the pan do it's job independantely from the note-envelope-flow? to go faster or slower?
- When i run this program it does what i want but i can't figure out why it says 2 times "p.pan = 1.000000" and 2 times "p.pan= -1.000000" (see below)
Please let me know if i have to address all my questions to the general email address. thanks a lot !!Herman// sound fileme.sourceDir() + "wavefile.wav" => string filename;if( me.args() ) me.arg(0) => filename;<<<me.sourceDir()>>>;// the patchSndBuf buf => ADSR e => Pan2 p => dac;// set attack time, decay time, release time and pause timedur attack; dur decay ; dur release; dur pauze;12::ms => attack ; 90::ms => decay ; 100::ms => release ; 5::ms => pauze ;// load file in buffilename => buf.read;// set gain.5 => buf.gain;// set a, d, s and re.set( attack, decay, 0.001, release );// switch is needed to stay in the "else" step untill p.pan = -10 => int switch;// begin pan extreme left-1 => p.pan;// time loopwhile( true ){Math.random2(0,900000) => buf.pos;Math.random2f(1.0,1.2) => buf.rate;if( p.pan() < 1.0 && switch == 0){p.pan() + .10 => p.pan;<<<"if p.pan = ",p.pan()>>>;}else{p.pan() - .10 => p.pan;<<<"else p.pan = ", p.pan()>>>;1 => switch;if (p.pan() == -1){0 => switch;}}// key on - start attacke.keyOn();attack + decay => dur ontime;ontime => now;// key off - start releasee.keyOff();// advance time by releasetime + pausetimerelease + pauze => now;}---------------------------------------------------------console result print----------------------------------------------------if p.pan = -0.900000if p.pan = -0.800000if p.pan = -0.700000if p.pan = -0.600000if p.pan = -0.500000if p.pan = -0.400000if p.pan = -0.300000if p.pan = -0.200000if p.pan = -0.100000if p.pan = -0.000000if p.pan = 0.100000if p.pan = 0.200000if p.pan = 0.300000if p.pan = 0.400000if p.pan = 0.500000if p.pan = 0.600000if p.pan = 0.700000if p.pan = 0.800000if p.pan = 0.900000if p.pan = 1.000000if p.pan = 1.000000else p.pan = 0.900000else p.pan = 0.800000else p.pan = 0.700000else p.pan = 0.600000else p.pan = 0.500000else p.pan = 0.400000else p.pan = 0.300000else p.pan = 0.200000else p.pan = 0.100000else p.pan = 0.000000else p.pan = -0.100000else p.pan = -0.200000else p.pan = -0.300000else p.pan = -0.400000else p.pan = -0.500000else p.pan = -0.600000else p.pan = -0.700000else p.pan = -0.800000else p.pan = -0.900000else p.pan = -1.000000else p.pan = -1.000000if p.pan = -0.900000if p.pan = -0.800000if p.pan = -0.700000if p.pan = -0.600000if p.pan = -0.500000if p.pan = -0.400000_______________________________________________Van: chuck-users-bounces@lists.cs.princeton.edu <chuck-users-bounces@lists.cs.princeton.edu> namens Michael Heuer <heuermh@gmail.com>
Verzonden: woensdag 5 februari 2020 15:42
Aan: ChucK Users Mailing List <chuck-users@lists.cs.princeton.edu>
Onderwerp: Re: [chuck-users] Create a pause of e.g. 2 seconds between notes or samples to be playedHello Herman,ChucK supports advancing time by chucking a duration to now, e.g.note.play();2::second => now;note.play();LiCK (a Library for ChucK) has a TimeSignature class, which provides static durationsTimeSignature.common(120) @=> TimeSignature ts;note.play();ts.q => now;note.play();and those that are dynamic to tempo changes, with anticipation and delay humanizationTimeSignature.common(120) @=> TimeSignature ts;ts.quarterProvider() @=> QuarterProvider q;0.1 => q.anticipation;0.0 => q.delay;while (true){note.play();q.get() => now;ts.tempo() - 1 => ts.tempo;}Cheers!michaelOn Feb 5, 2020, at 9:24 AM, herman verbaeten <hverb54@hotmail.com> wrote:Hi,I've only recentely started studiing ChucK and i'm looking for an easy way to integrate a pause between notes to be played in a "while()" loop. Could someone tell me in what direction to look for a solution? thanks in advance!Herman_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users