s.boot
//We evalauate the above line of code s.boot in SC this enures systems are up and running.
//This particular compositon works in conjunction with Logic, SuperCollider acts as a effective Midi Controller. Screenshots of Logic and the Midi Instrument used can be seen at the bottom of this Blog page.
MIDIClient.init(0, 1);
m = MIDIOut(0, MIDIClient.destinations[0].uid);
//Note that in previous blogs the Pdef, Pbind, Ppar and ++ features of SC have been explained.
This was to be my first composition using SuperCollider and my first attempt to implement a simple key change into a composition. Firstly I needed to make up my own scale that was unlike any of the common modes that were looked at over the course of the first semester e.g. Dorian, Phydrian, Ionian etc. I looked at the different tone and semi tones patterns and noticed that none of them used the following.
My 1st Scale – T S T S T S T S
Using a Piano preset in Logic I trialed this scale and found it sounded much like a major scale because it sounded happy rather than a minor scale that would normally sound sad.
At first I was not sure how wanted the Key to change all knew was that wanted to take my piece from Happy to Sad and back again.
What I have done; explained.
////////////////////////////
Track 1:
(//Open brackets opens new event.
Pdef(\Softstab,
//Here I’ve created a new Pattern definition called \Softstab. This means anything that follows can be recalled simply by asking for \Softstab and the complicated code that follows is not required for it to play.
Pbind( \type, \midi, \chan, 0, \midiout, m,
//The line above is simply connecting the following group of code with Logic and the 0, after \chan corresponds to the Midi channel in Logic. 0 in SC is matched to 1 in Logic.
\scale, [0, 2, 3, 5, 6, 8, 9, 10, 11],
T S T S T S T S
([C, D, D*,F, F*,G*, A, A*, B])
//As clearly stated this is my 1st scale that I have chosen to use for the Happy part of the composition. Starting from note C represented as 0 each semitone up from C is seen in SuperCollider in ascending order i.e. C is 0, CSharp is 1, D is 2 and so on.
\octave, Pxrand([2, 3, 2, 5],inf),
//In this line I have asked SC to change the Octave of my instrument at random from the 4 specified numbers. A Prand function is way of asking the assigned track to change value at random based on the values specified. Pxrand is similar but makes sure that no value is repeated until all values have been used once, twice etc. In this case at random my instruments octave will alternate between an Octave below Middle C as (2), 2 Octaves above as (5) and of course within the Octave that middle C lies (3).
\degree, Pseq([ (2), (5), (2), (7), (2), (9), (2), (11) ]-1, 2),
[0,(2), 3, 5, (6), 8, (9), 10, (11)]–(14)
//Degree is the order or choice of keys I wish the instrument to play in relation to my scale. If the degree of 1 was shown in the line above then 0 or C would play from my scale as it is the 1st degree in my scale. I could have chosen degrees 1-9 and play every note in my scale in order but instead I have asked for the 2nd, 5th, 2nd, 7th, 2nd, 9th, 2nd and 11th creating a simple arpergiated feel. Notice before I used a Pxrand to change my Octave at random in this case I have used Pseq which is similar argument but instead asks the instrument to play each degree in in order as you would read it. Note that a Pseq, Prand or other Pattern argument can be used within any field of a Pbind i.e. \degree,\octave,\dur etc etc.
\dur, 1/2
//The Tempo of this piece is set to a SC default of 120 beats per minute you can choose to change the tempo telling SC that you want a different Tempo but for ease I chose not to change any Tempo settings.
//The above line \dur is for duration of each degree. In this case 1/2 for 1/2 of 120Bpm so each degree will sound once every second at 60Bpm. You can choose to have multiple durations within the line.
))
)//Close Brackets closes first event.
////////////////////////////
Track 2:
(
Pdef(\Softstab2,
Pbind( \type, \midi, \chan, 0, \midiout, m,
\scale, [0 , 2, 3, 5, 6, 8, 9, 10, 11],
\degree, Pseq([2, 5, 2, 7, 0, 2, 7, 2]-1, 2),
\dur, 1/2
)).play
)
////////////////////////////
Track 3:
(
Pdef(\Keys,
Pbind( \type, \midi, \chan, 1, \midiout, m,
\octave, Pseq([3, 4, 4, 4],inf),
\scale, [0 , 2, 3, 5, 6, 8, 9, 10, 11],
\degree, Pstutter(2,Pseq([[2, 5, 2],[5, 2, 7], [2, 5, 9],[0, 2, 7]]-1,2),2),
//Notice the degree within this event is shown very differently from any of the previous events. Firstly I have used a Pstutter argument, a Pstutter is way of telling SC to repeat each degree a number of times before moving to the next in this case each degree will repeat will twice {Pstutter(2,Pseq}.
//When a group of numbers are given between [] square brackets within the degree field it means that each degree will play at the same time. So as you can see you are able to write out a sequence of chords.
\dur, 1/2,
\db, -8
//Here I have open a new field called \db. \db is for Decibells or Volume. If 0 was the maximum volume then -8 db is 8 times quieter.
))
)
////////////////////////////
Track 4:
(
Pdef(\Perc,
Pbind( \type, \midi, \chan, 2, \midiout, m,
\scale, [0, 2, 3, 5, 6, 8, 9, 10, 11],
\degree, Prand([2, 5, 7, 0]-13, 32),
\dur, 1/4,
\db, -2
))
)
////////////////////////////
Track 5:
(
Pdef(\drums,
Pbind( \type, \midi, \chan, 3, \midiout, m,
\scale, [0 , 2, 3, 5, 6, 8, 9, 10, 11],
\midinote, Pseq([60, 63, 63, 63, 62, 63, 63, 63, 60, 63, 63, 63, 62, 63, [63,65],63]-24,2),
//This field uses \midinote over \degree as I want the instrument to play Midinotes in Logic for this channel, I have used a simple Drum-Kit. 60 represent Middle C and is my Kick Drum, 63 is for a Hi Hat midi key and of course 62 is for a Snare sound. When I first wrote this line 60 was 2 Octaves above so as you can see I have asked SC to bring the list down by adding -24 to the end of the list. This has shifted midinote 60 down from 84.
\dur, 1/4,
\db, Pseq([-3, -18, -18, -18], inf)
//Here I have Pseq’d the Volume of my instrument and each volume is relative to a \degree or \midinote. -3 is the 1st in the list so it will tell SC to play the 1st of my degrees or midinotes at -3db the 2nd at -18 and so on. Once the list is complete it reverts back to the 1st so each Kick and Snare is Louder than the Hi Hats.
))
)
////////////////////////////
//Part 2 Key Change;
////////////////////////////
Track 6:
(
Pdef(\Softstab3,
Pbind( \type, \midi, \chan, 4, \midiout, m,
\octave, Pseq([3, 4, 4, 4],inf),
\scale, [0, 4, 7, 11, 14],
[C, E, G, B, D ]
//Here I have changed my scale, I knew I wanted it to sound Sad and have that Minor feel so I opened Logic to trial a new scale. I looked at the notes I had already and starting from C tried to use a different array of numbers causing the scale to sound entirely different. I played around with different sequences until I found something that sounded minor.
\degree, Prand([5, 4, 5, 4, 3, 4, 3, 2]-1,16),
//Notice how I have used the Prand argument on the list of degrees this means that each degree will be played at random and no sequence will ever repeat giving the piece that Jazz feel or improvised part.
\dur, 1/2
))
)
////////////////////////////
Track 7:
(
Pdef(\Keys2,
Pbind( \type, \midi, \chan, 1, \midiout, m,
\octave, Pseq([3, 4, 4, 4],inf),
\scale, [0, 4, 7, 11, 14],
\degree, Pstutter(2, Pseq([[2, 5, 2], [5, 2, 7], [2, 5, 9], [0, 2, 7]]-1, 2), 2),
\dur, 1/2
))
)
/////////////////////////////
//Pdef Sequence:>
/////////////////////////////
//Using exactly the same techniques explained in my previous blogs I have sequenced all the different parts so they play simultaneously.
(
(Ppar ([Pdef(\Softstab), Pdef(\Keys)], 1)
++
Ppar ([Pdef(\Softstab), Pdef(\Keys), Pdef(\Softstab2)], 1)
++
Ppar ([Pdef(\Softstab), Pdef(\Keys), Pdef(\Softstab2), Pdef(\drums)],1)
++
Ppar ([Pdef(\Perc), Pdef(\Keys), Pdef(\drums)], 1)
++
Ppar ([Pdef(\Softstab3), Pdef(\Perc), Pdef(\drums), Pdef(\Keys2)], 1)
++
Ppar ([Pdef(\Softstab3), Pdef(\Keys2)], 1)
++
Ppar ([Pdef(\Softstab), Pdef(\Keys), Pdef(\Softstab2), Pdef(\Perc), Pdef(\drums)],1)
++
Ppar ([Pdef(\Softstab), Pdef(\Keys)], 1)
++
Pdef(\Keys)
).play;
)
Logic and SuperCollider as a jpg.


0 Responses to “SuperCollider Composition”