Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////// LOOP AUDIO FILES //////////////////////////
- s.boot;
- s.meter;
- s.scope;
- s.plotTree;
- // Only use when necessary. It isn't always needed.
- s.reboot;
- s.quit;
- ///////////////////// Things To Know Before Running Code /////////////////////
- /*
- All my original SC documents are in the "dracula" color.
- To find or change this, go To SuperCollider ––> Preferences ––> Editor ––> Font & Colors.
- ––> Select under Color, dracula.
- Arguments in Synths are represented with a backslash, "\", in green under the "dracula" color font. Values presented with these arguments can be changed. Only remember to NEVER cross 0, when using an exponential method like "exprand."
- Arguments also precede a colon ":", as seen in a list of a UGen following a variable, "var."
- Example: sig = PlayBuf.ar(2, buf, rate, startPos: spos);
- Argument and variable names can be changed to your liking.
- Please be careful with volume output. Always have SuperCollider run through headphones. If you're unsure what the output will be, keep headphones away, with your main volume all the way down. Check your level meter and Stethoscope for visual cues. If everything looks safe (e.g. level meter is NOT in the red), proceed.
- You can always execute a hard stop with Command Period.
- */
- // Audio File
- ~audio = Buffer.read(s, "insertaudiofilehere");
- ~audio.play;
- ~audio.free; //free the synth
- ~audio.duration; // audio file's duration
- ~audio.numChannels; // audio file's channel number
- ~audio.sampleRate; // audio file's sample rate
- (
- ~tortoDrums = SynthDef(\playDrums, {
- arg buf=0, rate=1, spos=0, loop=1, pan=0, amp=0.5, out=0;
- var sig;
- sig = PlayBuf.ar(
- numChannels: 2,
- bufnum: buf,
- rate: BufRateScale.kr(buf) * rate,
- startPos: spos,
- loop: loop,
- // Note: My loop argument is set to 1, which means true, or that it will loop.
- // If the loop argument is set to 0, it means false, or that it won't loop.
- );
- sig = Pan2.ar(sig, pan, amp);
- Out.ar(out, sig);
- }).add;
- )
- ~tortoDrums = Synth(\playDrums, [\buf, ~drums]);
- ~tortoDrums.set(\loop, 0); // Evaluating this will stop the loop.
- ~tortoDrums.free; // Free the synth, since there is no doneAction value.
- // If you want a doneAction value, the loop argument must be set to 0, or the doneAction value will not be evaluated.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement