Piano Forum

Topic: math & music project  (Read 3839 times)

Offline swagmaster420x

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 959
math & music project
on: September 19, 2013, 05:47:08 AM
I'm part of the IB (international baccalaureate) program at my school, and one of the things we have to do to get the diploma is a project that we then write an extended essay about. For my project i'm thinking of investigating a program based on markov chains that produces music.....

basically, a markov chain goes from state to state based only on the previous state it was in. To demonstrate how it could be applied to making music:

If note A is played: 50% chance to play C after, 50% chance to play F
If note F is played: 80% chance to play F again, 20% chance to play C

but the thing that makes markov chains kind of unsuitable for music is that markov chains are "memoryless", which is to say that the next state only depends on the state before that... so there is no "memory" of musical motifs that has been played.

pls help????? this area interests me a lot, anyone have suggestions??

Offline j_menz

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 10148
Re: math & music project
Reply #1 on: September 19, 2013, 06:16:33 AM
MIT Open course has a series of lectures on YT about Douglas Hofstader's book "Godel Escher Bach", which would be a good start.  You can view the first of them here.

You could also start here, and pursue the links, especially the external links at the bottom. There's also some interesting stuff and references here.

A much more basic starting point is here.
"What the world needs is more geniuses with humility. There are so few of us left" -- Oscar Levant

Offline ted

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 3986
Re: math & music project
Reply #2 on: September 24, 2013, 09:33:04 PM
Algorithmic composition can be purely heuristic. It is not really necessary to go to the academic lengths David Cope and others have in order to write a program to compose music.

https://www.pianostreet.com/smf/index.php?topic=18165.0

These were produced by a few lines of Basic. Once I realised it would be possible to produce music generally thought conventionally human by a listener, I couldn't be bothered actually improving my code. But you certainly don't need either mathematical or musical sophistication to do it to a reasonably listenable level. 
"Mistakes are the portals of discovery." - James Joyce

Offline swagmaster420x

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 959
Re: math & music project
Reply #3 on: September 25, 2013, 03:36:48 AM
dang, thats perfect. i was also thinking of doing baroque music for what the program composes, because it makes a lot of sense haha

give me ur secrits? ;)

Offline ted

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 3986
Re: math & music project
Reply #4 on: September 25, 2013, 04:38:54 AM
There is no secret about it, but as it involves little mathematics of any significance it might not be appropriate for you. Firstly, write a bank of thematic material. This is best kept small to impart discernible character. It can even comprise a known melody. I wrote a subroutine to analyse the vertical harmony at any one point and return a unique number corresponding to chord type and optionally voicing. A chord type is simply a partition of twelve, disregarding voicing and pitch. Start by filling in the fugue array at the end and at the beginning, as these are pretty much the same in fugues. Select subsets of the motif bank and run a subroutine to test all possible vertical placements of them, that is to say how it "fits in" with what has already been written, using the harmonic subroutine. The criteria of "optimal" placement are of course arbitrary. The order of placement doesn't matter, but I wrote from beginning to end through habit.

The main thing this exercise taught me was that the harmonic parts are dead easy but that effective phrasing and rhythm are exceedingly difficult things to write algorithmically. The placement criteria for these examples are very crude. Were I to do it again I would incorporate more complex and stringent placement routines. I also restricted myself to ordinary major and minor scales by and large. This of course is not necessary for the method to work.

As I say, there is precious little mathematics aside from recognising that a chord type is a partition over the cyclic group of twelve. The Polya Burnside theorem can effectively analyse all 352 piano chord types if really needed, but it wasn't necessary to write fugues.

"Mistakes are the portals of discovery." - James Joyce

Offline polishookm

  • PS Silver Member
  • Jr. Member
  • ***
  • Posts: 60
Re: math & music project
Reply #5 on: September 25, 2013, 08:31:22 AM
swagmaster,

there are a lot of composers who've worked with markov chains. to the point where it's common and just another tool in the box. this link perhaps speaks to the "common" side of it.

https://www.harvestworks.org/jul-1314-making-max-make-music-with-markov-chains-online-class/

having said that, it's not the markov chain that makes the music. it's the composer. meaning markov chains are an approach but it's how they're used that matters and not just that they're used.

counterpoint and harmony are in the exact same class. it's not whether or not a composer uses counterpoint or harmony. it's HOW they're used.

if you spend some time on google with "music markov chain" and "music composition markov chain" and etc. ... etc. meaning be creative with search terms, you'll find a million examples including stuff like this

https://algorithmiccomposer.com/2010/05/algorithmic-composition-markov-chains-in-max-msp.html

the short version of everything above markov chains are as useful as you make them .... which is the same for any technique that any composer anywhere has ever used.

hope this is helpful! .... ah! another resource is curtis roads' book on computer music. it's a little dated but there'll be a lot of useful info (and bibliography, etc.) there. ... the more you look at the better of you'll be!
Mark Polishook
For more information about this topic, click search below!
 

Logo light pianostreet.com - the website for classical pianists, piano teachers, students and piano music enthusiasts.

Subscribe for unlimited access

Sign up

Follow us

Piano Street Digicert