From CCRMA Wiki
Revision as of 19:30, 19 May 2009 by Jshenker (Talk | contribs) (How to Play)

Jump to: navigation, search

by J3 (Jason Riggs, Jacob Shenker, and Jay Bhat)



This instrument works by displaying a GUI (shown at top of page) through which the slorker plays with algorithms for note-playback. Extensive real-time controls affect the texture and rhythm of the sound.

Live Performances

May 9, 2009 - SLOrktastic Chamber Music I @ The CCRMA Stage:

Recording: permutations1.mp3

Code used:

May 16, 2009 - SLOrktastic Chamber Music II @ The CCRMA Stage:

Recording: permutations2.mp3

Code used:

How to Play

Performance Paradigm

The GUI displays a series of rows of boxes, each box corresponding to an relative interval. The blue LEDs indicate the current location of the beat in each of the rows. Depending on the keys one has pressed, the beat will either be advanced by the server, or will be advanced manually. A note is played every time the beat is advanced corresponding to the sum of the relative intervals with respect to middle C. Note that while the internal representation of the intervals are relative intervals in semitones (as integers, in the array int rows[][]), there are many display modes that will show effective notes (i.e., summing the intervals from middle C) and other information.

Sections are presets of row configurations. While rows can be different sizes, corresponding rows of each section must be the same size. Selecting a section and modifying it will change the section, such that re-selecting the section will not revert to the original configuration.

The various timbres control the mechanism for sound generation, and there are many keyboard and trackpad controls for modifying the sound.

Keyboard Controls

Selecting timbre, envelopes, or sections is possible by holding down "t", "e", or "s", respectively, and pressing number keys "1"-"9", "0" to select the parameter values 0-9. Holding down shift when pressing a number key accesses the second bank, 10-19. (i.e., to select envelope 10, press shift+e+1)

With the stock configuration, the lowest-numbered envelopes are the shortest and most percussive, while envelopes 6-9 are pads of increasing length. One can add up to 20 different envelopes and sections by modifying the code (in, an array of ADSR vectors on lines 52-61, and the rows for each section on lines 85-90). Adding more timbres is also possible, but will remain undocumented for the time being (feel free to contact the authors for instructions). As configured currently, timbre 0 is a supersine, 1 is a supertriangle, 2 is a supersquare, and 3 is a supersaw oscillator bank. Timbres 4-11 are samples, listed on lines 127-136 in

Timbre Sound/Sample
0 supersine
1 supertriangle
2 supersquare
3 supersaw
4 data/bell.aif
5 data/toy_piano.aif
6 data/glockenspiel.aif
7 data/clarinet.aif
8 data/kalimba.aif
9 data/xylophone.aif
10 data/piano.aif

The stock configuration has four sections, corresponding to the tonic, subdominant, dominant, and supertonic major triads of C major.

Additionally, holding down "t", "e", or "s" and pressing "[" or "]" will scroll though the available parameter values, wrapping around (i.e., if you are on timbre 0, pressing "[" will go to the highest-numbered timbre available).

Without holding down "t", "e", or "s", the number keys default to changing envelope, and "["/"]" default to changing timbre.

Holding down "i", "j", "k", or "l" while pressing up or down arrow keys modify attack, decay, sustain, and release parameters, respectively, for the ADSR envelope. Selecting an envelope (with number keys or "["/"]") clears the modifications one has made to it (e.g., if I press 2, I'll play with envelope 2, then if I hold down "i" and press down arrow twice, it'll play with my modified envelope. Pressing 2 again will reset the ADSR to the original envelope 2).

"<-" and "->" (arrow keys) change the register (in octaves). Holding down shift modifies the register (basenote) in semitones (100 cents), holding down apple does the same in quartertones (50 cents), and shift+apple does so by an eighth-tone (25 cents).

"-^" and "-v" (arrow keys) double and halve the tempo, respectively. Holding down shift does so by factors of 3, apple does so by factors of 5, and shift+apple does so by factors of 7. (i.e., to reach an 7:8 polyrhythm from a tempo of 8, press down arrow three times [reaching a tempo of 1] then press shift+apple+up once [to get a tempo of 7]). Note that in the current implementation, one should only have integer tempos (although this restriction is not enforced!); press "escape" to return to the nearest power of 2. Polyrhythm support and robust synchronization will be added in a future version.

Trackpad Controls

With "." held down: X-axis: controls the cutoff frequency of a low-pass filter Y-axis: For the oscillator timbres (0-3), traversing the y-axis detunes the pitch slightly around its base frequency. For the sampled timbres (3-11), traversing the y-axis increases the resonance of the low-pass filter.

With "g" held down: X-axis: controls gain

With "r" held down: X-axis: controls mix of reverb

GUI Controls

The GUI contains a grid of boxes with associated LEDs that display the current location of the beat. The beat will advance the top row. Every time the one row's location reaches the end and wraps back to the beginning, the row below it advances by one. As such, the score can be considered a series of nested epicycles. The note that is triggered for every advancing of the top row is the sum of all the active boxes (where "active" means they correspond to the current location of the beat, displayed by blue LEDs). By default, there are three rows, the top row with 5 boxes, the second with 5, and the third with 3.

The boxes display pitches in Lilypond notation, so 'gis would be the G-sharp an octave above middle-C and ,,bes would be the B-flat one octave below middle C (note: ,bes is the note one semitone below c). The default format is for the top and bottom rows to display their absolute pitches (i.e., the note that would be triggered if they were active their row were the "top" row, so the notes in the top row really do display exactly what pitch would be triggered when the beat lands on them), and the second row to show the relative interval, e.g., if the current note on the middle row was displayed as P4, and the bottom note was 'd, the current note on the top row would be 'g (the D above middle C transposed up a fourth). This is all fully customizable by modifying the appropriate configuration parameters in (again, until this is documented, please contact the authors).

Clicking on a box swaps the value in that square with the value in the square immediately to its right (it wraps, so clicking on the last box will swap with the first). Holding down shift transposes the note up by a semitone, and holding down apple transposes the note down by a semitone. Holding down option does the same by an octave, control does the same by a perfect fifth, and control+option does so by a major third. Holding shift+apple and clicking a note will turn it into a rest (indicated by "r"), shift+apple+clicking again will turn it back to the original note. Note that a rest placed on an active (i.e., has a blue LED) note in a lower row will silence all notes while it remains active.

"`" (tilde) or clicking "play" sets the GUI to trigger note events when the beat is advanced. " " (spacebar) momentarily enables playing while it is held down, and disables playing when it is released (note: with tilde enabled, pressing spacebar will continue playing, and releasing it will 'stop' playing). "m", when held down, prevents the server beat from advancing the local beat. "n" advances the beat manually. This is best used by holding down "m", then tapping "n" to play a rhythm. "b", when held down, waits for the next server beat, advances once, and prevents subsequent server beats from advancing the local beat. This is best used by holding down "m" and "b", and is useful for playing an isolated note or notes together, like a sting at the end of a piece (esp. at a slow tempo).

Code Modification (how to add new tone rows, sections, and more)

TODO: talk about adding tone rows, sections, etc. This should be better once we clean up the code... TODO: describe the various row_format values

For right now, please contact the authors for help with making changes to the code...

Score/Performance Ideas

Jot down any ideas for a performance or its score here. Possible issues to consider:

1) The role of the conductor (which gestures? use a computer to spread information? control other players' sounds directly?)

2) The format of the score (gestures alone? hold up signs? server-based instructions sent to each player?)

3) Improvisation (to what extent should it be allowed? in what way(s)?)

4) Number of players (how many total? should they be split into sections? how many sections? should sections be fixed before the piece, or should we allow 'dynamic section allocation'? or both?)

List of Score/Performance Ideas

Conductor-controlled timbre w/ Server-based tone selection

A master server runs and controls the tonal evolution of the piece. As the piece transitions from one stage to the next, performers will see their GUIs transition from one set of permutations to another. The conductor can control parameters of the sound such as texture, density, etc., and performers are also left to improvise. The server can fade the piece away by itself when the score is over. Also, the conductor could be given high-level, real-time control over the messages that the server is sending out. The conductor could even have a midi controller and use it to send out permutations in a more spontaneous way. That could sound cool.

People should solo

Everyone not soloing is instructed to hold a certain texture, while the soloist improvises. In a large performance, this means that one computer should be up front and center, and soloists alternate by going up to the front laptop.

Known Bugs

Priority 1 (Absolutely needs to be fixed asap):

Priority 2 (Would make the instrument run more smoothly/efficiently):

- We can make the instrument able to handle more of a payload by eliminating MAUI entirely and using command-line Chuck to run it. This means that we need to use a different GUI via OSC messages from the command-line version.

Priority 3 (Minor issues):


Priority 1 (Should be in there asap):

Priority 2 (Would definitely be nice):

Priority 3 (Might consider experimenting with):

- Timbre selection does not need to be discrete. We could experiment with a slider.

- It might be worth experimenting with a Joystick for the x/y-axis control of the filter/detuning. It would be set up so that the trigger on the joystick needs to be held in order for the detuning (y-axis) to have any effect, while the filter (x-axis) would always have effect. The little circle thingy at the base makes a good way to control master volume as well. The joystick might make more sense than the touchpad, but the con is that everyone who's playing needs a joystick. Maybe we could have it use the joystick if one is plugged in and otherwise default to the trackpad.


Here is the set of chuck files. Set the miniAudicle's root path to a directory containing these files, and then simply add Only one machine should add the server.

Optimizing Performance

Rather than opening the entire piece in the miniAudicle, you can also download the command-line version of ChucK ( Then, you can run the sound-generating portion of the code from the command line while running the interactive portion within miniAudicle (sadly, you cannot run the GUI from the command line). It will boost performance by around 150%, and it's much more stable, so it's a good idea if possible. Here's what to do:

In your terminal, navigate to the permutations folder you get off of the wiki. Now, type "chuck --probe". This shows the list of all possible audio interfaces connected to your computer. Find the one you would like by id number, and then remember that number. Let's say that the number is "4".

In a command line, enter the following: chuck -c2 --dac4 class/ scripts/

(where the "4" in --dac4 is your number)

This will begin running the sound portion of the code.

Now, open up the miniAudicle. Go to preferences and click the "miscellaneous" tab. Set the file path to the permutations folder you unzipped. Click OK.

Still in the miniAudicle, go to file --> open, and open the following three files from the permutations folder:



Inside the "server_main_loop" window, look at line 11 of the code and make sure that it reads ["localhost"] @=> string clients[]; (if you are playing in a group, replace localhost by the players' computers' names. ex: ["jasoncomp.local", "ge.local", "cheesefoodsandwich.local"] @=> string clients[];

Save the file and close it.

Finally, click on "Start Virtual Machine," and click "add shred" once for each of the two files that are still open. Hit the "`" (tilde) key to start making sound. Now you can play the instrument (beginners, see the "How to Play" section of this page).

Related Projects

This permutations project was created out of a merging of three prior projects.

Jason's Supersaw project is located here: Supersaw

Jacob's Permutations code is located here:

Jay's Arpeggiator code is located here: