Skip to content

Instantly share code, notes, and snippets.

@edeleflie
Created August 18, 2011 11:17
Show Gist options
  • Save edeleflie/1153864 to your computer and use it in GitHub Desktop.
Save edeleflie/1153864 to your computer and use it in GitHub Desktop.
playing 2 synths together
// Use this file as a template for Assignment 1
//
// Vimeo tutorial of everything: http://vimeo.com/user2299201
// Synthesiser definitions
// LoopSound: https://gist.github.com/1138857
// Auditory_s_s: https://gist.github.com/1153861
//
// This file: https://gist.github.com/1153864
//
// To get everything playing, all you need to do is hit 'enter' once for each line
// This will effectively go through every line in this file and run it.
// Then, tweak tweak tweak to get different sounds, different rythms, different mixes
// Any problems, email me on etienne@uow.edu.au
// Load the sound file. This sound file be used for 4 LoopSound synths.
// The last (the 5fth) LoopSound synth will use a different sound file (whichever you like)
// NOTE: the soundfile you load up MUST BE MONO
~sound_file = Buffer.read(s, "sounds/a11wlk01.wav");
// FIRST SOUND
// create a filter, and pass in a looper synth
~first_filter = Synth("auditory_s_s", [ \in, 100, \out, 0, \pan, 0 ]); // try a rate of 0.1
~first_loop = Synth("LoopSound", [ \out, 100, \soundFile, ~sound_file, \speed, 1.0, \vol, 1, \duration, 4, \triggerEvery, 4]);
// make some changes
~first_loop.set(\speed, 0.1);
~first_loop.set(\startPos , 0.3);
~first_filter.set(\room, 0.1);
~first_filter.set(\pan, -0.8);
~first_filter.set(\stereoWidthVol, 0.1);
~first_filter.set(\stereoWidthAmount, 0.01);
~first_loop.set(\vol , 3);
// SECOND SOUND
// create a second filter, and pass in an other looper synth
~second_filter = Synth("auditory_s_s", [ \in, 101, \out, 0, \pan, 0 ]); // try a rate of 0.1
~second_loop = Synth("LoopSound", [ \out, 101, \soundFile, ~sound_file, \speed, 2, \triggerEvery, 2]);
// make some changes
~second_loop.set(\speed, 4);
~second_loop.set(\duration, 0.05);
~second_loop.set(\vol , 2.0);
~second_filter.set(\room, 0.9);
~second_filter.set(\damp, 0.8);
~second_loop.set(\triggerEvery, 2);
~second_filter.set(\pan, 0.8);
~second_filter.set(\stereoWidthAmount, 0.002);
~second_filter.set(\stereoWidthVol, 0.9);
// THIRD SOUND
// create a third filter, and pass in an other looper synth
~third_filter = Synth("auditory_s_s", [ \in, 102, \out, 0, \pan, 0 ]); // try a rate of 0.1
~third_loop = Synth("LoopSound", [ \out, 102, \soundFile, ~sound_file, \speed, 1, \triggerEvery, 0.1]);
// make some changes
~third_loop.set(\duration, 4);
~third_loop.set(\triggerEvery , 4);
~third_loop.set(\speed , 0.4);
~third_filter.set(\room, 0.5);
~third_filter.set(\pan, -0.1);
~third_filter.set(\hp_cutoff_freq, 500);
~third_loop.set(\vol , 3.0);
// FOURTH SOUND
// create a fourth filter, and pass in an other looper synth
~fourth_filter = Synth("auditory_s_s", [ \in, 103, \out, 0, \pan, 0 ]); // try a rate of 0.1
~fourth_loop = Synth("LoopSound", [ \out, 103, \soundFile, ~sound_file, \speed, 1, \triggerEvery, 0.1]);
// make some changes
~fourth_loop.set(\duration, 0.2);
~fourth_loop.set(\speed , 0.9);
~fourth_loop.set(\triggerEvery, 0.666);
~fourth_loop.set(\vol , 1);
~fourth_loop.set(\startPos, 0.07);
~fourth_filter.set(\room, 0.6);
~fourth_filter.set(\damp, 0.1);
~fourth_filter.set(\pan, -0.2);
~fourth_filter.set(\lp_cutoff_freq, 10000);
// FIFTH SOUND
// For this one, we are going to load up a different sound file
// load our custom mono sound file (NOTE: you need to change the path to the sound file)
~myOwnSample = Buffer.read(s, "sounds/a11wlk01.wav");
// create a fourth filter, and pass in an other looper synth
~fifth_filter = Synth("auditory_s_s", [ \in, 105, \out, 0, \pan, 0 ]); // try a rate of 0.1
~fifth_loop = Synth("LoopSound", [ \out, 105, \soundFile, ~myOwnSample, \speed, 2, \triggerEvery, 4, \vol, 0.8]);
// Ultimately ... once you have started to get the feel of SuperCollider
// you can start setting the Synth settings (or parameters, or args, whatever you want to call them)
// using Patterns
// ... then it gets a bit more interesting
// NOTE: to run the below code, you need to highlight the whole block)
(
p = Pbind( \type, \set, \id, ~fourth_filter.nodeID,
  \args, #[lp_cutoff_freq],
\lp_cutoff_freq, Pseq( [10000, 5000, 1000, 500], 40),
\dur, 0.666
).play;
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment