On Feb 7, 2020, at 1:26 PM, herman verbaeten <hverb54@hotmail.com> wrote:Hi Michael,Sorry for all the trouble but when i do as you told me :SinOsc lfo => blackhole;0.5 => lfo.freq;//…while (true){// ...lfo.next() => pan.pan;.....Console tells me sinOsc doesn't have a member .next()Kind regards,Herman_______________________________________________Van: chuck-users-bounces@lists.cs.princeton.edu <chuck-users-bounces@lists.cs.princeton.edu> namens Michael Heuer <heuermh@gmail.com>
Verzonden: donderdag 6 februari 2020 17:02
Aan: ChucK Users Mailing List <chuck-users@lists.cs.princeton.edu>
Onderwerp: Re: [chuck-users] Create a pause and gradualy shift pan from left to right and backOn Feb 6, 2020, at 10:41 AM, herman verbaeten <hverb54@hotmail.com> wrote: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".The ChucK mailing list is probably best.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.
Have you seen the miniAudicle? That is the official IDE for ChucKI personally use a mode for Emacs to provide syntax highlightingThere is support for other editors out there; I seem to remember a wiki with links to such somewhere but I can't find it.
- Is there a way to debug line per line to discover logical errors?
Not that I know of. My bit of advice is to not run a ChucK script with headphones on without trying it on speakers first. I learned that the hard way from a mis-configured filter.
- 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 general, to read from a function/value, use the version with paramsp.buf() => float f;To set a value, use the chuck operator into the version without params1.0 => p.buf;This is equivalent to making a single-argument function call (but the former is more ChucK-y)p.buf(1.0);
- 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?
Yes, you can use an oscillator as an LFO modulatorSinOsc lfo => blackhole;0.5 => lfo.freq;//…while (true){// ...lfo.next() => pan.pan;If you want to update the pan at sample rate or at a rate independent from your main while loop, create a new shredspork ~ _updateAtSampleRate();fun void _updateAtSampleRate(){while (true){1::samp => now;lfo.next() => pan.pan;}}Hope this helps!
- 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
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users