Experimenting with a Generalized Rhythmic Density Function for Live Coding

Renick Bell, Tama Art University

May 2, 2014

introduction

My name is Renick Bell.

I'm a doctoral student at Tama Art University in Tokyo.

I'm researching live coding.

To do live coding, I use, among other things, a Haskell library I have written called Conductive.

(photo: me live coding at Soup in Tokyo on 14/04/05, visuals on the right by Yousuke Fuyama)

the paper I'm presenting

"Experimenting with a Generalized Rhythmic Density Function for Live Coding"

My library didn't give me as much freedom in generating rhythm patterns as I wanted, so I'm experimenting with a pattern-generation function that has been generalized to get greater modularity.

outline

  1. intention
  2. brief review of Conductive concepts in order to explain how rhythms are performed
  3. immediate problem to solve: inflexible function for rhythm patterns
  4. my solution: a higher-order function that takes as arguments two functions: one for a basic rhythm pattern and another to produce density variations of that pattern
  5. example density function: density by ratio
  6. example pattern function: L-systems for rhythm patterns
  7. how I do live coding in Haskell
  8. demonstration
  9. conclusions and directions for future research

intention

I'm trying to get a set of abstractions to maximize my freedom while performing.

Right now my focus is mostly on rhythm.

I had been targeting this...

Butch Morris conducting an ensemble of Paal Nilssen-Loves and Han Benninks.

Photo of Butch Morris by Claudio Casanova. Photo of Paal Nilssen-Love by Heiko Purnhagen. Photo of Han Benninks by Mark A. Lunt.

What I was actually getting was this...

Photo of robot drummer by m anima: https://www.flickr.com/photos/banky177/2790867763 Photo of me by Xavier Ho.

So I made some revisions

I modified my functions for generating rhythm patterns to make them more flexible, particularly to generate more styles of rhythms.

a brief review of Conductive

If you want to know more about how Conductive works, check my 2011 and 2013 LAC papers.

rhythm in Conductive

IOI function

interonset interval (IOI) = the time between the onset of two events, determines rhythm

density

rhythmic density = a number describing the relative quantity of events within a particular period of time

relationship between IOIs, density, and rhythm

previous problems, more specifically

An IOIMap is a data type that combines a looping rhythm pattern and its variations at different rhythmic densities.

a generalized function for patterns and variations

higher-order functions

"a function that takes a function as an argument or returns a function as a result is called higher-order." Graham Hutton. 2010. Programming in Haskell.

one of two important kinds of "glue" that increase modularity, "the key to successful programming", according to John Hughes in "Why functional programming matters", a 1989 article in The Computer Journal.

how the generalized function works

One function generates the base rhythmic pattern according to a specified pattern length.

Another function uses that base rhythmic pattern and generates an ordered collection of variations at different densities. The function describes how the density should be increased.

examples

density by ratio

This function increases density by reducing IOIs by one of a specified number of ratios.

*> densifier 0.25 [0.5] [1,1,1,1]
[1.0,1.0,1.0,0.5,0.5]
*> densifier 0.25 [0.5] it
[0.5,0.5,1.0,1.0,0.5,0.5]
*> densifier 0.25 [0.5] it
[0.5,0.5,1.0,0.5,0.5,0.5,0.5]
*> densifier 0.25 [0.5] it
[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]
*> densifier 0.25 [0.5] it
[0.25,0.25,0.5,0.5,0.5,0.5,0.5,0.5,0.5]

L-systems

Lindemayer systems, abbreviated to L-systems, were developed by Aristid Lindenmayer in 1968 as "a theory of growth models for filamentous organisms" (Lindenmayer, 1968).

They are string-rewriting systems in which an input string is transformed according to a set of rules in which each item in the string is rewritten. By inputting this output back through the rule-set, successive generations can be obtained (DuBois, 2003).

Image: © Nevit Dilmen found at Wikimedia commons

L-system example

rules: a -> b
       b -> ab

input: a

output: b
        ab
        bab
        abbab
        bababbab
        abbabbababbab
        bababbababbabbababbab

selected usage of L-systems in computer music

L-system functions implemented here

L-system example, direct generation

*LSystem> getGeneration2 5 rules "a" 
"abbab"
*LSystem> let a = it
*LSystem> randomFinalizer2 [0.25,0.5..1.25] a
[1.25,0.25,0.25,1.25,0.25]
*LSystem> randomFinalizer2 [0.25,0.5..1.25] a
[1.25,1.0,1.0,1.25,1.0]
*LSystem> randomFinalizer2 [0.25,0.5..1.25] a
[0.5,0.75,0.75,0.5,0.75]

L-system example, value transformation

*LSystem> getGeneration2 5 "a:b b:ab" "a"
"abbab"
*LSystem> let a = it
*LSystem> let b = nub a
*LSystem> b
"ab"
*LSystem> let c = zip (map (\x -> [x]) b) [(1+),(0.5*)]
*LSystem> let d = flatFinalizer c a
*LSystem> :t d
d :: [Double -> Double]
*LSystem> transform 2 d
[2.0,3.0,1.5,0.75,1.75,0.875]

L-system example, value transformation, expanded

"abbab"
[(1+),(0.5*),(0.5*),(1+),(0.5*)]

*LSystem> transform 2 [(1+),(0.5*),(0.5*),(1+),(0.5*)]
[2.0,3.0,1.5,0.75,1.75,0.875]

how I do live coding with Haskell

demonstration

conclusion

It works, and the ugly code is available from my website.

It needs to be cleaned up and then properly packaged for Hackage.

I need practice with it to use it effectively when performing live.

fractal beats

I have been using these two example functions to make a series of "fractal beats".

http://www.renickbell.net/doku.php?id=fractal_beats

directions for future research

thanks

I would like to thank my advisors Akihiro Kubota and Yoshiharu Hamada for research support.

questions and feedback

My explanation might have been unclear. What questions do you have?

Do you have comments? Criticisms?

You're welcome to ask me questions by email: renick at gmail.com.

If I make changes, I'll mention updates on Twitter at least: @renick

My website gets updated sometimes: http://renickbell.net