background preloader

SuperCollider

Facebook Twitter

SynthDefs and Synths - SuperCollider 3.2 help files. SynthDefs and Synths Now that we've covered some basic information we're going to start looking at server abstractions, which are the various classes in the language app which represent things on the server. When looking at these it is important to understand that these objects are just client-side representations of parts of the server's architecture, and should not be confused with those parts themselves. Server abstraction objects are simply conveniences.

Distinguishing between the two can be a little confusing, so in general I refer herein to the client-side classes with uppercase names, and the corresponding aspects of server architecture with lowercase names, i.e. Synth vs. synth. You've already met one kind of server abstraction, class Server itself. The objects referred to by Server.local and Server.internal (and whichever one is stored in the interpreter variable 's' at any given moment) are instances of Server. Now it's time to get familiar with the rest of them. SynthDefs vs. MCLD blog. One of the classic rave synth sounds is the "hoover", a sort of slurry chorussy synth line like the classic Dominator by Human Resource. I decided to recreate that sound from scratch, by reverse engineering the sound and recreating it in SuperCollider.

Here's how to do it: Analytical listening doesn't come naturally but it gets easier with practice. Listen to the target sound again and again, and try and get a feel for the different technical aspects of it. When I listened to the opening sound in Dominator I made the following notes: There's a main sound (the slightly fuzzy chorussy synth) plus also some added bass underneath.

There are various programs that can visualise the contents of audio. So that's what I did. If you find a pitch detector in the Transform menu you can get an computerised estimate of the fundamental frequency ("f0") and how it changes over time. OK, so it's quite likely that our bass notes are around 70--80 Hz and our synth notes are around 280--300 Hz.

OK. 3: EQ. Dewdrop world > supercollider 3 > tutorials. Download code examples This is the first in a planned series of documents explaining how to use the chucklib add-on to the dewdrop library. I've been working on chucklib for about a year and a half as of this writing (January 2006) and it will continue to grow as I use it in compositions and discover new needs for it. It takes its name from the chuck operator, which I brazenly stole from Ge Wang and Perry Cook's ChucK audio programming language (though the usage in my case is nothing so radical as theirs). Note: Before reading this tutorial, make sure you understand the streams-patterns-events helpfiles in the SuperCollider main help. This is not going to make sense to you until you do! Chucklib exists for several purposes: Proper organization of compositional code. This article will only scratch the surface, showing how to open up a simple pattern to outside experimentation, then demonstrating the use of some of the predefined drum machine process prototypes. 1.

PR(\cmaj).v.asPattern 3. 4. Adam Jansch : Supercollider a day. Buffers. A is a contiguous region of memory that is addressible by index. In SC, buffers share some general characteristics with arrays but are not arrays. In particular, buffer memory is allocated on the server and so the getting and setting of buffer values are asynchrouous operations. In addition: buffer memory not allocated by Buffer.new server must be running to allocate memory for buffer buffers are one dimensional (vectors) buffer values are floats Buffers can be created without the server running, but allocating their storage (memory) requires a running server. . ( Server .default=s= Server .internal; s.boot; ) b= Buffer .alloc(s,66150); c= Buffer .alloc(s,100,2); Once memory has been allocated buffer instance variables are updated with values that reflect the allocated memory. b.bufnum; b.numChannels; b.sampleRate; c.bufnum; c.numChannels; c.sampleRate; As always, you can use use the .query method to get information about server-side objects: b.query; c.query; Buffer frames Buffer duration BufRd.

SynthDef client-side representation of a synth definition - SuperCollider 3.2 help files. SynthDef client-side representation of a synth definition superclass: Object The server application uses synth definitions as templates for creating Synth nodes. (Methods such as Function-play, etc. are simply conveniences which automatically create a def for you.) The SynthDef class encapsulates the client-side representation of a given def, and provides methods for creating new defs, writing them to disk, and streaming them to a server. SynthDef is one of the more complicated classes in SC and an exhaustive explanation of it is beyond the scope of this document.

UGen Graph Functions and Special Argument Forms The core of a def is its unit generator graph function. There are three special types of arguments, which are treated differently: initial rate - Arguments that begin with "i_" (e.g. i_freq), or that are specified as \ir in the def's rates argument (see below), will be static and non-modulatable. See the examples below for more detail on how this works.

Static versus Dynamic Elements. Pbind - SuperCollider 3.2 help files. Pbind superclass: Pattern Pbind(pattern pairs) The class Pbind provides a bridge between value patterns and event patterns. It binds symbols in each event to values obtained from a pattern. Pbind takes arguments in pairs, the first of a pair being a Symbol and the second being a value Pattern. The Pbind stream returns nil whenever the first one of its streams ends or if nil is passed in. // example: a = Pbind(\x, 77, \y, Pseq([1, 2, 3])); x = a.asStream; 4.do { x.next(Event.new).postln }; x.next; // this returns nil. An event stream is created for a Pattern by sending it the asEventStream message.

This uses the default event. Pbind( \degree, Pseq([1,3,5,7], inf), \dur, 0.125, \octave, 4, \root, 3 ).play To use another than the default SynthDef, we need to read the synth description library so that event know's what kind of arguments there are in each SynthDef. Special control name conventions which should be used so that the SynthDef works with the default system: out output bus index #a, b = out; How to Program in SuperCollider: Working with Buffers. Let's say you want to open a short audio file and play it back.

You can do this with a Buffer. s.boot; b = Buffer.read(s, "sounds/a11wlk01.wav"); Don't run both of those lines at once. Wait for the server to finish booting before reading the Buffer. The reason you need to wit is because the Buffer actually lives with the server. The first argument, is therefore the server that will hold the buffer. Because the Buffer lives with the server, the command to read it is asynchronous. PlayBuf To play the Buffer, you can use the UGen PlayBuf: When Buffers are allocated on the server, they're given a unique ID number, so we can reference them later. Some Buffers may have unusual sample rates or otherwise be unusual. Note that when we play at half speed, it takes twice as long to play the sample and pitches are all an octave lower. The PlayBuf UGen is the one that actually plays the buffer.

To figure out which SynthDef to use, you can send the message numChannels to a buffer object: Dialogs Summary. SampleRadar: 355 free breakbeat samples. It's the weekend, you're ready to make some music and you're looking for inspiration. Fortunately, MusicRadar is here to kickstart the creative process with a selection of pro-quality, royalty-free samples. This week, our sonic microscope is zooming in on breakbeat, which means not drums but melodic sounds, too. This is a genre that covers a lot of ground, so to give you an idea of what each of our sample kits contains, there are demo mixes for you to listen to below.

What you need to know The samples are split across four construction kits, each of which contains breaks, basslines and synths (some contain FX sounds, too). All the samples are supplied as WAV files so can be imported directly into your DAW of choice. The breakbeat kits are supplied as separate zip files, so you'll need to extract them before you can see the samples. Example loops Breakbeat kit 125bpm Breakbeat kit 130bpm Breakbeat kit 135bpm Breakbeat kit 140bpm Breakbeat kits: click to download Breakbeat kit 125bpm. Dewdrop world > supercollider 3 > tutorials. Download code examples This tutorial lists out the effects I use almost all the time when composing. Many of them are very simple, but I write them in a way that I can call on them very easily by name, without having to think a lot about the specific implementation. Preliminary: Instr/Patch/FxPatch All of these effects are written using the Instr class, which is found in the crucial library (part of the main distribution).

Arguments to the UGen function do not have to be synthdef arguments. This tutorial is not intended to be a complete lesson on Instr and Patch, but I should point out a few things at the outset: The name is not limited to a single symbol. Spec.specs.asSortedArray.do(_.postcs) When patching an Instr, the arguments are supplied in an array.

For a brief example, This distortion effect has four arguments: the first two defining the audio bus and the number of channels, and the last two being audio parameters. In FxPatch #2, all four arguments have hard-coded values. The effects. How to Program in SuperCollider: Pbinds. If you've been using tasks to control rhythmic sounds, you may have noticed that sometimes the timing can wander a bit. If you have two separate tasks running at the same time, they can also get out of sync. Tasks don't guarantee exact timing. Also, remember that the language interpreter and the audio server are separate programs. There is a small delay between telling the server to play something and when it actually plays it.

It's possible to compensate for this, by giving it instructions slightly ahead of time. P = Pbind.new.play; That will repeat forever until you stop it. p.stop; A Pbind is a sort of a pattern. Pbind(\freq, 660).play Pbind.new takes an even number of arguments, as many or as few as you would like. Pbind(\freq, 660, \dur, 0.2 + 0.3.rand).play Note that the expressions are evaluated when the Pbind's constructor is called. Repeating the same note over and over is rather dull, so there are some patterns that can help. ( Pbind( \freq, Prand([330, 440, 660], 6) ).play ) PlayBuf sample playback oscillator - SuperCollider 3.2 help files. Superdupercollider: Simple Drum Machine. After shamelessly flashing my Moog synth, I think it's time to reveal another SuperCollider creation. A very simple drum machine, made up of two parts. A SynthDef, defining my drums and a pattern template to play them.

Here's the SynthDef (SynthDef(\drums, {|out = 0, bassLevel = 0 , snareLevel = 0, hatLevel = 0, tomLevel = 0, pan1 = 0, pan2 = 0, pan3 = 0, pan4 = 0| var env1, env2, env3, env4, bass, snare, hat, tom, bassOut, snareOut, hatOut, tomOut, mixer; env1 = EnvGen.kr(Env.perc(0.001, 0.2, 1, -4), 1, doneAction:2); env2 = EnvGen.kr(Env.perc(0.001, 0.5, 1, -1), 1, doneAction:2); env3 = EnvGen.kr(Env.perc(0.002, 0.3, 1, -2), 1, doneAction:2); env4 = EnvGen.kr(Env.perc(0.001, 0.1, 1, -5), 1, doneAction:2); I have four sound sources, four envelopes and four panners.

I have to admit that the drum sounds are a bit crappy and need some more work, they've got a certain Casio feel to them, and not in a good way, but they do the job. Here's the pattern I use to control it. Like that.