Gigging with python!

publié le 29 October 2015

[fr] Lors de mes concerts de la semaine dernière, j'ai utilisé pour la première fois des programmes python/pyo pour produire du son en live. Un petit retour d'expérience sous forme d'extraits sonores et de bouts de code...

I've been toying with pyo for quite some time now, and I've been using it on stage for midi processing for a few months, but it was not until last week that I asked the python to actually deliver some sound on stage. For my latest solo program, I wrote a couple of new pieces and I thought this was a great time to put python/pyo to the test.

Une flûte...
(Photo: Nicolas Meyer)

Telemann's pet snake

As a warm-up, I tried to investigate how hard it would be to play a canon with myself. I chose one of Telemann's Canons mélodieux and tried to make out how to get a delay whose duration would be determined by the time between two successive presses on my foot controller's button 1.

Using FooCoCo and pyo, it's so easy it's almost disappointing. The heart of the program is:

i = pyo.Input(0)
b1 = foococo.Press(foococo.Button(1)).trig
ti = pyo.Timer(b1,b1)
d = pyo.SDelay(i, delay=ti, maxdelay=30).out()

The complete code is slightly longer, especially because I want to be able to reset the delay for the second and third movements without restarting the program, but there isn't much more to it.

Here is a sample of the first movement (play mp3) to hear how it sounds.

Recycling loops

One of my major concern when writing a song for an augmented instrument is that the "setup time" is not too long. I don't like songs where the musician records several loops at the beginning, with a strong feeling that the piece hasn't really started yet. I've strongly decided against pre-recording loops before the gig, yet I still want my song to be music from the beginning.

One way of getting very efficient with loop recording is re-using the loop material several times. In this song, titled Traces d'orient (play mp3), the drone is a short voice loop played by two parallel players with strong crossfade values

play_voice = pyo.Looper(
    tab_voice, 
    dur=rec_voice['time'] / server.getSamplingRate(), 
    xfade=[50,43] 
).out()

while the complex percussion pattern is a single short monophonic loop played simultaneously at 3 different speeds

play_percu = pyo.Looper(
    tab_percu, 
    dur=rec_percu['time'] / server.getSamplingRate(), 
    xfade=0, 
    pitch=[.5,1,.25]
).out()

This allows for a complex sonic texture with a minimal "setup time".

If it quacks like a duck... it might be a python

For my song Snakin' Around (play mp3), I wanted to play with an unusual wah effect variant: a sound controlled wah effect. So I record one loop with the bass pattern and one with the "control pattern". Then I apply a quite classical wah effect:

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()

Quite a simple code for getting a sound so different from the original bass flute sound that it gets almost unrecognizable!

There are a few more things happening in this song, but I'll keep the details for a next post!

Voir aussi: