16
7
Just an idea I had the other day: Making beats following a Markov Chain of predefined sounds.
I remember someone did a beatbox with Google Translate and the German language (follow the link and press listen).
So, the challenge is to build a text input to Google Translate from a given chain. Or you can use musical notes and play it yourself :).
You can make a program reading a line with the number of beats, another with their names and a matrix representation of the probabilities (you can choose the representation).
You may also make a function with those three arguments.
E.g.
[input]
20
pv zk bschk kkkk
[[.1, .4, .5, 0.],
[.3, .2, .3, .2],
[0., .3, .2, .5],
[.1, .8, .1, 0.]]
[output] something like:
pv zk bschk zk pv bschk zk pv zk bschk kkkk pv bschk zk bschk bschk bschk zk kkkk bschk
The starting probability is the same for each beat.
That's not a code-golf challenge because I would like to see some nice solutions (be creative).
Extra points if you invent new beats and/or choose a table of probabilities that gives nice beats most of the time.
If you want, you can use real beats (In many languages it's easy to open .wav
files, like the wave
module in Python) and generate music! Here are some free sample beats.
I may post a reference implementation if needed.
Would it be acceptable to use multiple-note prefixes in the model? – Sparr – 2016-03-17T17:52:57.880
@Sparr Yes, if you want to. – JBernardo – 2016-03-17T20:23:41.213
Do you allow preprocessed forms of the matrix? That is, a form in which the numbers as such do not occur any more? – Hans-Peter Störr – 2011-09-27T19:05:22.880
@hstoerr Yes. You can have it as function argument if you want – JBernardo – 2011-09-27T19:49:09.367
Please suggest a file hosting for sharing our random .WAVs :) – Dr. belisarius – 2011-09-29T01:38:05.153
@belisarius Well I know Songcloud is good for that, but you can use any file hosting.
– JBernardo – 2011-09-29T03:17:47.667