
The recent discussion about Markoff chains inspired me to try to train one with all the Bach midi's I have on my disk, collecting statistics on what intervals tend to get played simultaneously, which follow others and in which way the pitch offsets from its mean, so that melodies fall and raise "naturally". The rationale is that if it's Bach, it's harmonious but not respecting any kind of usual chord progression. So far, I got (a bit confused around the edges): getMid mf = do mid <- MidiLoad.fromFile mf return $ MidiRead.retrieveTracks mid toMelody :: MidiMusic.T -> StdMelody.T toMelody = Music.mapNote f where f note = let body = MidiMusic.body note in Melody.Note StdMelody.na (MidiMusic.pitch body) main = do args <- Env.getArgs let mf:[] = args m <- getMid mf putStr $ Format.prettyMelody $ Optimise.all $ Music.chord $ map (\m -> Music.line $ map toMelody m) m which results in chord [e 3 bn na, chord [b 2 wn na, line [hnr, d 3 wn na, hnr, cs 3 hn na, a 2 hn na, chord [cs 3 hn na, line [b 2 hn na, c 3 hn na]]]]] , for a set of random clicks in rosegarden's matrix editor. Right now, I'm desperately searching for functions that can help me analyse this beast, which afaict right now works best by having a multitude of transformations (e.g. one big top-level chord with maximum polyphony and a hell a lot of rests) that provide easy access to whatever information is needed. Does anyone of you know about previous work in this area? I don't want to break cultural imperatives by not being as lazy as possible. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

a somewhat random sample of work done in this direction: http://arts.ucsc.edu/faculty/cope/experiments.htm On Thu, 5 Jun 2008, Achim Schneider wrote:
The recent discussion about Markoff chains inspired me to try to train one with all the Bach midi's I have on my disk, collecting statistics on what intervals tend to get played simultaneously, which follow others and in which way the pitch offsets from its mean, so that melodies fall and raise "naturally".
The rationale is that if it's Bach, it's harmonious but not respecting any kind of usual chord progression.
So far, I got (a bit confused around the edges):
getMid mf = do mid <- MidiLoad.fromFile mf return $ MidiRead.retrieveTracks mid
toMelody :: MidiMusic.T -> StdMelody.T toMelody = Music.mapNote f where f note = let body = MidiMusic.body note in Melody.Note StdMelody.na (MidiMusic.pitch body)
main = do args <- Env.getArgs let mf:[] = args m <- getMid mf putStr $ Format.prettyMelody $ Optimise.all $ Music.chord $ map (\m -> Music.line $ map toMelody m) m
which results in chord [e 3 bn na, chord [b 2 wn na, line [hnr, d 3 wn na, hnr, cs 3 hn na, a 2 hn na, chord [cs 3 hn na, line [b 2 hn na, c 3 hn na]]]]]
, for a set of random clicks in rosegarden's matrix editor.
Right now, I'm desperately searching for functions that can help me analyse this beast, which afaict right now works best by having a multitude of transformations (e.g. one big top-level chord with maximum polyphony and a hell a lot of rests) that provide easy access to whatever information is needed.
Does anyone of you know about previous work in this area? I don't want to break cultural imperatives by not being as lazy as possible.
-- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

David Cope's early research seems relevant. Some LISP code to train a
Markov chain on Bach is available from the web page for his current
class.
http://arts.ucsc.edu/faculty/cope/music206b.html
He eschews higher-order functions; using them, you should be able to
port it to very concise and readable Haskell. For the musical side of
things, the powerpoint presentations hint at additional data you can
put into your states and transitions to get better results for e.g.
cadences, characteristic embellishments, and melodic arcs.
Hope this is helpful,
- Kenn
On Thu, Jun 5, 2008 at 11:27 AM, Achim Schneider
The recent discussion about Markoff chains inspired me to try to train one with all the Bach midi's I have on my disk, collecting statistics on what intervals tend to get played simultaneously, which follow others and in which way the pitch offsets from its mean, so that melodies fall and raise "naturally".
The rationale is that if it's Bach, it's harmonious but not respecting any kind of usual chord progression.
So far, I got (a bit confused around the edges):
getMid mf = do mid <- MidiLoad.fromFile mf return $ MidiRead.retrieveTracks mid
toMelody :: MidiMusic.T -> StdMelody.T toMelody = Music.mapNote f where f note = let body = MidiMusic.body note in Melody.Note StdMelody.na (MidiMusic.pitch body)
main = do args <- Env.getArgs let mf:[] = args m <- getMid mf putStr $ Format.prettyMelody $ Optimise.all $ Music.chord $ map (\m -> Music.line $ map toMelody m) m
which results in chord [e 3 bn na, chord [b 2 wn na, line [hnr, d 3 wn na, hnr, cs 3 hn na, a 2 hn na, chord [cs 3 hn na, line [b 2 hn na, c 3 hn na]]]]]
, for a set of random clicks in rosegarden's matrix editor.
Right now, I'm desperately searching for functions that can help me analyse this beast, which afaict right now works best by having a multitude of transformations (e.g. one big top-level chord with maximum polyphony and a hell a lot of rests) that provide easy access to whatever information is needed.
Does anyone of you know about previous work in this area? I don't want to break cultural imperatives by not being as lazy as possible.
-- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hofstadter (he of Godel Escher Bach) naturally has a lovely essay on Chopin reproduced in Metamagical Themas, which might be helpful as well. Regards, Sterl. On Jun 5, 2008, at 2:46 PM, Kenn Knowles wrote:
David Cope's early research seems relevant. Some LISP code to train a Markov chain on Bach is available from the web page for his current class.
http://arts.ucsc.edu/faculty/cope/music206b.html
He eschews higher-order functions; using them, you should be able to port it to very concise and readable Haskell. For the musical side of things, the powerpoint presentations hint at additional data you can put into your states and transitions to get better results for e.g. cadences, characteristic embellishments, and melodic arcs.
Hope this is helpful,
- Kenn
On Thu, Jun 5, 2008 at 11:27 AM, Achim Schneider
wrote: The recent discussion about Markoff chains inspired me to try to train one with all the Bach midi's I have on my disk, collecting statistics on what intervals tend to get played simultaneously, which follow others and in which way the pitch offsets from its mean, so that melodies fall and raise "naturally".
The rationale is that if it's Bach, it's harmonious but not respecting any kind of usual chord progression.
So far, I got (a bit confused around the edges):
getMid mf = do mid <- MidiLoad.fromFile mf return $ MidiRead.retrieveTracks mid
toMelody :: MidiMusic.T -> StdMelody.T toMelody = Music.mapNote f where f note = let body = MidiMusic.body note in Melody.Note StdMelody.na (MidiMusic.pitch body)
main = do args <- Env.getArgs let mf:[] = args m <- getMid mf putStr $ Format.prettyMelody $ Optimise.all $ Music.chord $ map (\m -> Music.line $ map toMelody m) m
which results in chord [e 3 bn na, chord [b 2 wn na, line [hnr, d 3 wn na, hnr, cs 3 hn na, a 2 hn na, chord [cs 3 hn na, line [b 2 hn na, c 3 hn na]]]]]
, for a set of random clicks in rosegarden's matrix editor.
Right now, I'm desperately searching for functions that can help me analyse this beast, which afaict right now works best by having a multitude of transformations (e.g. one big top-level chord with maximum polyphony and a hell a lot of rests) that provide easy access to whatever information is needed.
Does anyone of you know about previous work in this area? I don't want to break cultural imperatives by not being as lazy as possible.
-- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Thu, 5 Jun 2008, Achim Schneider wrote:
The recent discussion about Markoff chains inspired me to try to train one with all the Bach midi's I have on my disk, collecting statistics on what intervals tend to get played simultaneously, which follow others and in which way the pitch offsets from its mean, so that melodies fall and raise "naturally".
I don't know, if you already found that one: http://darcs.haskell.org/haskore/src/Haskore/Example/Kantate147.hs Surprisingly I also tried Markov Chain on a Bach song. But my approach was too simplistic in order to produce a nice new song.

Henning Thielemann
On Thu, 5 Jun 2008, Achim Schneider wrote:
The recent discussion about Markoff chains inspired me to try to train one with all the Bach midi's I have on my disk, collecting statistics on what intervals tend to get played simultaneously, which follow others and in which way the pitch offsets from its mean, so that melodies fall and raise "naturally".
I don't know, if you already found that one: http://darcs.haskell.org/haskore/src/Haskore/Example/Kantate147.hs
Surprisingly I also tried Markov Chain on a Bach song. But my approach was too simplistic in order to produce a nice new song.
Yes, you need to take both dimension of music into account, that is time and polyphony. Bach uses quite exceptional polyphony from time to time, but it always stays harmonious: You have to have eg. a 0% probability of ever playing a note and its minor second. The probability of a note and its quint will most likely be at least 50%, but then there are chords that sound atrocious if it's there. What I need is basically one view of the data as list of used chords, and one graph of all possible time-linear progressions... that is, voices, for a definition of "voice" that makes the guitarist in me shudder. Seems like I'm going to make close acquaintance with fgl, after all. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

What I need is basically one view of the data as list of used chords, and one graph of all possible time-linear progressions... that is, voices, for a definition of "voice" that makes the guitarist in me shudder.
Seems like I'm going to make close acquaintance with fgl, after all.
Sorry if this is too far off-topic but have you seen this? http://music.princeton.edu/~dmitri/ I’ve yet to dig into the paper but it looks kind of fun. Clarence Barlow has an interesting algorithm for generating stochastic musical data with “harmonicity” being one of the parameters. It is implemented in an Atari ST (there’s *got* to be a better way!) programme called Autobusk http://www.musikwissenschaft.uni-mainz.de/Autobusk/. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Open your ears and your mind will follow. ~ ~ - www.sonology.net - ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Murray
What I need is basically one view of the data as list of used chords, and one graph of all possible time-linear progressions... that is, voices, for a definition of "voice" that makes the guitarist in me shudder.
Seems like I'm going to make close acquaintance with fgl, after all.
Sorry if this is too far off-topic but have you seen this?
For the cafe, yes. Follow up to gmane.comp.lang.haskell.backstage, please ;)
http://music.princeton.edu/~dmitri/
I’ve yet to dig into the paper but it looks kind of fun.
It looks... mathematical. It also looks strikingly right, I just spend a good quarter hour staring at the diagram and currently try to convince my visualisation that the geometry is possible. The key points to look out for are the diagonal lines featuring the same numbers, vertical lines featuring series and where (_,n) changes into (n,_), to get the mind accept the möbiusness. I could show you why it's mirrored and twisted around the tritone using a guitar and gnuplot, but I won't spoil the fun. Just observe that you can easily play a flageolet on the 5th, 7th and 12th fret but not on the 6th. Western music is defined by fifth and fourths. It's all wave mechanics, especially this darn problem of merging a linear scale to a logarithmic one and trying to make sense while doing such an insane thing.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Open your ears and your mind will follow. ~ ~ - www.sonology.net - ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You listen too much Stockhausen. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.
participants (6)
-
Achim Schneider
-
Dipankar Ray
-
Henning Thielemann
-
Kenn Knowles
-
Murray
-
Sterling Clover