Learn to design and develop unique music interfaces and music instruments. The basis is the free real-time audio programming language SuperCollider and your smartphone.
Learn to use your smartphone to generate and control sounds. Sonify motions of your smartphone or use them to alter and control sound.
You still have no idea what I am talking about?
Have a look here: http://tinyurl.com/opwlsbk
For individual training, individual design requests, get in touch with me: codemusicians@gmail.com
Some fancy interfaces: codemusicians.blogspot.de
Music Interface Design with SuperCollider and smartphones
1. Music Interface Design
Introduction to
SuperCollider & OSC
Amir Rahimzadeh
codemusicians@gmail.com
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
2. Music Interface Design – What my brain looks like.
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
3. Music Interface Design – What is SuperCollider?
• Free
• Real-time
• Cross-Platform
• Programming Language
• Audio Synthesis & Algorithmic Composition
http://supercollider.github.io/
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
4. Music Interface Design – SuperCollider Basics
2 basic components
Server <-OSC-> Client
“scsynth” <-OSC-> “sclang”
OSC … Open Sound Control
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
5. Music Interface Design – Download & Install
• Download: http://supercollider.github.io/
• Download all Tutorials: http://tinyurl.com/qhv49aw
• Install
• Open SuperCollider
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
6. Music Interface Design – Warning
To protect your ears and loudspeakers always set your system
to the lowest level before starting a sound !!!
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
7. Music Interface Design – Making sound
1) Boot the server: s.boot;
2) Make a sound: ({SinOsc.ar(440)}).play;
3) Execute a command: mark all code, “shift+enter”
4) Stop Playback: “cmd + .”
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
8. Music Interface Design – Manipulating sound via Mouse
MouseX.kr(220,440)
Maps horizontal mouse cursor position
to the values between 220 and 440.
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
9. Music Interface Design – Review
What have you learned so far?
• Functions/Ugens take arguments
• Function arguments can be constant or other functions/Ugens
(e.g. MouseX.kr())
• The difference between audio rate and control rate
• How to find the arguments of a function using the help
browser
• How to use function MouseX as control value
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
10. Music Interface Design – Assignment 1
Assignment 1: Difficulty: Easy
• Add to the preceding example a control over the amplitude of
the sinusoid using the vertical mouse position on your screen.
The amplitude shoud vary between 0 and 1.
Hint: To change the amplitude the sinusoid has to be multiplied. There are 2 ways
to achieve that. Make use of the help browser to determine which argument has
to be changed. Argument “phase“ can be set to 0.
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
11. Music Interface Design – Assignment 2
Assignment 2: Difficulty: Medium
• Replace the manual control over the amplitude (MouseY.kr)
from the previous example by a sine oscillator with a
frequency of 1 Hz that continuously varies the amplitude.
• Would you use SinOsc.ar or SinOsc.kr for the amplitude
control? Why?
Hint: There are 2 ways to achieve that.
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
12. Music Interface Design – Assignment 3
Assignment 3: Difficulty: Advanced
• Replace the constant frequency of 1Hz of the SinOsc that
controls the amplitude in the previous assignment by MouseY.
The frequency of amplitude change should vary between 1
and 10Hz according to the position of the mouse cursor in
vertical direction.
Hint: There are 2 ways to achieve that.
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
13. Music Interface Design – Setting up control from iPhone (1)
• iPhone/iPad: Download & Install GyrOSC
• Other smartphones: Download & Install qOSC
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
14. Music Interface Design – Setting up control from iPhone (2)
Get the IP address of your pc/mac
Mac: “Terminal” -> “ifconfig”
Search for: “inet 192.168.2.102” (actual numbers will vary)
Windows 2000 / XP / Vista:
“Start Menu” -> “Run” -> “cmd /k ipconfig /all”
Search for: “IPv4 Address”
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
15. Music Interface Design – Setting up control from iPhone (3)
Configure GyrOSC qOSC
Ziel IP Adresse:
set it to match the
IP address of your Mac/PC.
Port: set it to 57120
the standard port
SuperCollider listens
to incoming messages.
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
16. Music Interface Design – Setting up control from iPhone (4)
Receiving GyrOSC control values in SuperCollider
• Set up an OSC Responder in SuperCollider
• Output the received control values (from pressing buttons in
GyrOSC) to SC’s “Post Window”
s.boot;
OSCresponder(nil, "/gyrosc/button",
{
arg t, r, msg;
msg.postln;
}
).add;
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
17. Music Interface Design – Setting up control from qOSC (5)
Receiving qOSC control values in SuperCollider
• Set up an OSC Responder in SuperCollider
• Output the received control values (from pressing buttons in qOSC)
to SC’s “Post Window”
s.boot;
OSCresponder(nil, "/btn14/0",
{
arg t, r, msg;
msg.postln;
}
).add;
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
18. Music Interface Design – Synth Definitions
• Until now Ugens to create sound
{ SinOsc.ar(440) }.play;
• For more flexibility and control -> SynthDef
Synth Definitions tell the server how various Ugens are interconnected.
SynthDef(SineSynth, // Define the synth
{
arg freq=440;
var sig;
sig = SinOsc.ar(freq);
Out.ar(0, sig);
}).send(s);
x = Synth.new(SineSynth); // Create an instance of the synth
x.set(freq, 220); // Change the frequency of the running synth to 220 Hz
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
19. Music Interface Design – Change the frequency from iPhone
Change frequency on button press
OSCresponder(nil, "/gyrosc/button",
{
arg t, r, msg;
msg.postln;
x.set(freq, 110*msg[1]); // msg[1]…button number
}
).add;
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
20. Music Interface Design – Play MIDI scale from iPhone
Mapping button numbers to MIDI notes
• Changing: x.set(freq, 110*msg[1]);
• to: x.set(freq, midicps(69+msg[1]));
“midicps” … maps MIDI notes to frequency in Hz.
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
21. Music Interface Design – Envelopes ADSR & Perc
EnvGen.ar(Env.adsr(0,0.1,1,0.3)) *sig;
EnvGen.ar(Env.perc) * sig;
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
22. Music Interface Design – Playing Chords
Create Amin7 chord on button1 press
Corresponding MIDI notes are: 69, 72, 76, 79
Synth.new(SinSynth, [freq1, midicps(69)]);
Synth.new(SinSynth, [freq1, midicps(72)]);
Synth.new(SinSynth, [freq1, midicps(76)]);
Synth.new(SinSynth, [freq1, midicps(79)]);
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
23. Music Interface Design – Trigger Samples from iPhone (1)
• Samples have to be *.wav files.
• Set the path to the sample directory:
~path = "~/Desktop/Super Collider Tutorials/Samples/".standardizePath;
• Load sample into a variable
a = Buffer.read(s,~path ++ "BD.wav" );
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
24. Music Interface Design – Trigger Samples from iPhone (2)
• Define a synth for sample playback
SynthDef(Samples,
{
arg buf = 0;
var sig;
sig = PlayBuf.ar(1, buf, BufRateScale.kr(buf));
sig = sig*EnvGen.ar(Env.adsr(0,0.1,1,0.3), doneAction: 2);
Out.ar([0,1], sig);
}).add;
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
25. Music Interface Design – Trigger Samples from iPhone (3)
• Playback Sample
Synth.new(Samples, [buf, a]);
• Put that command into an OSCResponder
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
26. Music Interface Design Course
Music Interface Design Course
8 week Course – Start: September 2015
Dates:
05.09. / 12.09. / 03.10. / 10.10
17.10. / 24.10. / 31.10. / 07.11.
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com
27. Music Interface Design Course
Details
• 1 interface per workshop including:
– automatic melody generation
– automatic chord generation
– touchless interaction using magnets
– real-time voice processing
– air drums
– air guitar
– Understand physics of the sensors used
• last 2 workshops:
develop your instruments
What‘s possible?
http://tinyurl.com/opwlsbk
http://tinyurl.com/iTraktor
Register NOW at
codemusicians@gmail.com
Course Fee: 320 € / 8 weeks
Music Interface Design - Amir Rahimzadeh
codemusicians@gmail.com