class: bgleft right background-image: url(pics/pycharmer.jpg) # Charming Snake ## Python for Live Music .br[ [![Matthieu Amiguet](pics/ma.png)](http://www.matthieuamiguet.ch/) [![Les Chemins de Traverse](pics/logo-small.png)](http://www.lescheminsdetraverse.net/) ] --- class: center, middle ![Les Chemins de Traverse](pics/logo.png) --- background-image: url(pics/traverso.jpg) --- background-image: url(pics/harpejji.jpg) --- # From Renaissance Repertoire...
Your browser does not support the video tag.
.right[ - (From the DVD [Old Wine in New Bottles](http://www.lescheminsdetraverse.net/pages/commande/)) ] --- # ... To Free Improvisation
Your browser does not support the video tag.
.right[ - (From the DVD [Old Wine in New Bottles](http://www.lescheminsdetraverse.net/pages/commande/)) ] --- class: middle bgrt background-image: url(pics/luthier_augmente.png) # Augmented instruments ## "Extending the sonic possibilities of traditional
music instruments using new technologies." --- # Guidelines -- ## Music first -- ## An augmented instrument is a musical instrument -- ## History Matters -- ## Durability and independence --- # How does it sound?
.right[ - (From the DVD [Old Wine in New Bottles](http://www.lescheminsdetraverse.net/pages/commande/)) ] --- class: middle, center ## To explore augmented instruments we need: # A quick way to build prototypes of
realtime, ultra-low latency programs --- # Possible Solutions ## Using existing software ## Writing realtime C / C++ ## Visual programming environments ## Domain-specific programming languages ## Libraries for general-purpose programming languages --- # Possible Solutions ## .highlight[Using existing software] ## Writing realtime C / C++ ## Visual programming environments ## Domain-specific programming languages ## Libraries for general-purpose programming languages --- class: middle, center ![Guitarix](pics/guitarix.jpg) ![Sooperlooper](pics/sooperlooper.png) --- # Possible Solutions ## Using existing software ## .highlight[Writing realtime C / C++] ## Visual programming environments ## Domain-specific programming languages ## Libraries for general-purpose programming languages --- # "Audio Thru " in C (with jack) ```C #include
#include
#include
#include
#include
#include
jack_port_t *input_port; jack_port_t *output_port; int process (jack_nframes_t nframes, void *arg) { jack_default_audio_sample_t *out = \ (jack_default_audio_sample_t *) jack_port_get_buffer (output_port, nframes); jack_default_audio_sample_t *in = \ (jack_default_audio_sample_t *) jack_port_get_buffer (input_port, nframes); memcpy (out, in, sizeof (jack_default_audio_sample_t) * nframes); return 0; } // add many more lines ``` --- # Possible Solutions ## Using existing software ## Writing realtime C / C++ ## .highlight[Visual programming environments] ## Domain-specific programming languages ## Libraries for general-purpose programming languages --- # " Audio Thru " in PureData ![Simplistic pd patch](pics/pd-simple.jpg) --- # PureData in Real Life ![Real life pd patch](pics/pd-real.jpg) --- background-image: url(pics/spaghetti.jpg) --- # Possible Solutions ## Using existing software ## Writing realtime C / C++ ## Visual programming environments ## .highlight[Domain-specific programming languages] ## Libraries for general-purpose programming languages --- # " Audio Thru " in ChucK ```C adc => dac; while( true ) { 100::ms => now; }``` # " Audio Thru " in Faust ```C process = _;``` ## Don't forget SuperCollider, CSound, ... --- # Possible Solutions ## Using existing software ## Writing realtime C / C++ ## Visual programming environments ## Domain-specific programming languages ## .highlight[Libraries for general-purpose programming languages] --- class: center ![Real life pd patch](pics/pyohome.jpg) ## http://ajaxsoundstudio.com/software/pyo/ --- # " Audio Thru " in python/pyo ```python import pyo s = pyo.Server().boot() i= pyo.Input().out() s.gui(locals())``` -- ## On a properly configured computer... ### (for us: linux with rt-patched kernel and jackd running) ## ... this is all you need to get a reliable ultra-low latency audio treatment ### (for us: roundtrip latency < 10ms) --- background-image: url(pics/MonoPoly.jpg) class: bgright -- ## Backstage --- # In The Swiss Mountains... ```python import pyo server = pyo.Server(audio='jack', nchnls=1, duplex=1) server.boot().start() server.gui()``` --- # In The Swiss Mountains... ```python import pyo server = pyo.Server(audio='jack', nchnls=1, duplex=1) server.boot().start() *i = pyo.Input().out() server.gui()``` --- # In The Swiss Mountains... ```python import pyo server = pyo.Server(audio='jack', nchnls=1, duplex=1) server.boot().start() i = pyo.Input().out() *reverb = pyo.Freeverb(i, size=.8, damp=1, bal=1, mul=.8).out() server.gui()``` --- # In The Swiss Mountains... ```python import pyo server = pyo.Server(audio='jack', nchnls=1, duplex=1) server.boot().start() i = pyo.Input().out() reverb = pyo.Freeverb(i, size=.8, damp=1, bal=1, mul=.8).out() *delay = pyo.Delay(i, delay=[1, 1.1, 1.2], maxdelay=5, feedback=.2, mul=.2) # no out here! server.gui()``` --- # In The Swiss Mountains... ```python import pyo server = pyo.Server(audio='jack', nchnls=1, duplex=1) server.boot().start() i = pyo.Input().out() reverb = pyo.Freeverb(i, size=.8, damp=1, bal=1, mul=.8).out() delay = pyo.Delay(i, delay=[1, 1.1, 1.2], maxdelay=5, feedback=.2, mul=.2) *echos = pyo.Freeverb(delay, size=.5, damp=1, bal=1, mul=.8).out() server.gui()``` --- background-image: url(pics/contrabass.jpg) class: bgleft, right # Chilbi
Your browser does not support the audio element.
--- # Playing Canons ## (Using foococo for accessing the foot controller) ```python i = pyo.Input() b1 = foococo.Press(foococo.Button(1)).trig ti = pyo.Timer(b1,b1) d = pyo.SDelay(i, delay=ti, maxdelay=30).out()``` --- background-image: url(pics/telemann.jpg) class: right # Telemann, Canons Mélodieux (written in 1738)
Your browser does not support the audio element.
--- # Polyrythms ```python tab_percu = pyo.NewTable(15) rec_percu = pyo.TableRec(src, tab_percu) play_percu = pyo.Looper( tab_percu, dur=rec_percu['time'] / server.getSamplingRate(), xfade=0, pitch=[.5,1,.25] ).stop() # Record simple rythm rec_percu.play() # Stop recording rec_percu.stop() # Play polyrythm play_percu.out()``` --- # Voice Drone ```python play_voice = pyo.Looper( tab_voice, dur=rec_voice['time'] / server.getSamplingRate(), xfade=[50,43] ).out() ``` -- ![xfaders](pics/xfaders.jpg) --- # Time and transitions ```python def start(): Glob.sm = StateMachine() tab_percu = pyo.NewTable(15) Glob.rec_percu = pyo.TableRec(Glob.src, tab_percu) Glob.play_percu = pyo.Looper(...) #... Glob.sm.transitions( {fc.Press(fc.Button(1)).trig: rec_percu} ) def rec_percu(): Glob.rec_percu.play() Glob.transitions( {fc.Press(fc.Button(1)).trig: stop_rec_percu} ) # ... ``` --- background-image: url(pics/flute.jpg) class: right, middle # Traces d'Orient
Your browser does not support the audio element.
--- # Sound-controlled Wah effect ```python bass = pyo.Input(chnl=1) control = pyo.Input(chnl=2) fol = pyo.Follower(control, freq=30, mul=40000, add=200) f = pyo.Biquad(bass, freq=fol, q=5, type=2, mul=10).out()``` --- # Why reinvent the wheel? ## SooperLooper does loops sooo well... ```python def loop_state(address, *args): # args is loop_index, control, value state = args[2] if state > 0: Glob.running = True get_state = OscDataReceive(9901, '/loop_state', loop_state) register = OscDataSend('siss', 9951, '/sl/0/register_auto_update') register.send(['state',100,'localhost:9901', '/loop_state']) ``` --- background-image: url(pics/collaboration.jpg) # Putting it all together --- background-image: url(pics/bass_flute.jpg) class: bgleft, right # Snaking # Around
Your browser does not support the audio element.
--- # Conclusion ## pyo really supports our creative process -- ## All the flexibility of python with C efficiency -- ## Python in a very unexpected domain with pyo -- ## pyo is very actively developed --- background-image: url(pics/violoncelle.png) class: right bgleft # Questions? - [www.lescheminsdetraverse.net](http://www.lescheminsdetraverse.net) - [www.matthieuamiguet.ch](http://www.matthieuamiguet.ch) - [www.augmented-instruments.net](http://www.augmented-instruments.net) - [twitter](https://twitter.com/#!/MatthieuAmiguet)/[facebook](https://www.facebook.com/MatthieuAmiguet): MatthieuAmiguet ##
Picture Credits - title picture based on a [picture](https://www.flickr.com/photos/aftab/5331047355/in/photolist-9861Dz-5o8KMm-gpVt7-anbBmx-4AJSjR-jpCns1-jq1uQm-ooe2vz-dqfzt7-4XmXPt-DrHHs-5J34R7-2iCxSP-3Kyyzj-4ekRTt-yugxu-5wsnWj-5UrpWL-e5sXHe-axQCuK-eifRwS-ckijZh-nVPTN8-bCuxqG-4AJSyB-48dkLQ-9qDHoF-9d51Dz-7jG424-dVKrNK-4FQYWg-4tJYEf-9cCZn3-7Yiqfb-tza45t-GoqQV-sxgBFC-8TroK7-kWoKpk-2CUEHG-8Tna46-bMHfVM-7KWfHa-7Qj23F-63tHwW-86PR6C-7gVbbt-86PRcW-7ErC2D-2duLk3) by Aftab Uzzaman - PureData Patch by [Julien Ottavi](http://www.apo33.org/noise/doku.php?id=puredata) - Spaghetti by [I Believe I can Fry](https://www.flickr.com/photos/johnnystiletto/9521494467/in/photolist-fvo9zH-7C5KJq-9spjhF-7C5S1J-e8aChq-eFuVF5-8s8eBL-7C6gkd-8unyFa-7GVMym-8AeF8A-7Jq8bA-7v58RC-8y4joe-5K9nBF-2M77nV-tbvq4r-et54Ce-67wNj5-9FDGTz-9Kqgpe-8hDjTF-8uqFJ5-cFhrPj-e78ZLP-dzGXYU-5uek9M-q6HBB8-7C1YXT-4j7TzA-nEu9Ds-47fYur-6Y1oaq-6Y1nZ9-3rbv36-7C43rW-4nTCCe-58r1VP-88w1ie-7C5KrW-e7SsgU-6Y1nTS-6xL3SF-iaESNy-8jaH2a-4Z6933-7C5Nmh-bBLAoW-aAe8yN-3TXpok) - Music pictures (still & moving) by [Nicolas Meyer](http://nicolas-meyer.ch/)