Jump to content


Photo

LPMG (Lemon's Procedural Music Generator)


  • Please log in to reply
13 replies to this topic

#1 Lemon Pie

Lemon Pie

    GMC Member

  • GMC Member
  • 194 posts

Posted 18 April 2012 - 07:54 PM

Lemon's Procedural Music Generator, or LPMG as I've now dubbed it ;), is a music composition program that makes music from a mathematical algorithm. I have always loved fractal music & procedurally generated music so I decided to make my own generator. Check it out =)

Posted Image

Posted Image

Posted Image

Q: What is Algorithmic Music Composition?
A:Algorithmic music composition is the process of making music from an algorithm or process. This has been around for ages, from Pythagora's music theories, to Mozart's Musical Dice game, to advanced procedures & programs like cgMusic, or Lexikon-Sonate, & SoundHelix.

Q: How does this process work?
A: Lets say you have this algorithm:
count = count + 1;
//Play note w/ piano key count
Every time a beat is counted this algorithm would play the next note up every time a beat is counted. Although this is a fairly simple algorithm it is still technically an algorithmic composition.
Here's another one that's a little bit more advanced:
note[0] = 0;
note[1] = 2;
note[2] = 4;
count = irandom_range(45,85)
for (i=0; i<=2; i+=1)
{
     if round(note[i]/count)=note[i]/count
     {
          //Play note[i]
     }
}
This example will only play certain notes on a scale. This is a random choice, though, and the procedure is likely to never return the same results twice.

Here's a final example:
//
note[0] = 0;
note[1] = 2;
note[2] = 4;
note[3] = 5;
note[4] = 7;
//
step = 5
count += step*count;
while count > 12
{
     count -= 12
}
for (i=0; i<=4; i+=1)
{
     if note[i] = count
     {
          //Play note[i]
     }
}
This is will check if the note falls on the scale, and play if it does. This will always return the same result. By changing some variables (in this case step) you can change the outcome.

For more on Algorithmic/Procedural Music Composition/Generation check out this: Algorithmic Composition on Wikipedia

Change log:
v.1.2-B: New features: Pause, Randomize all tracks, Randomize all seeds, Vary all seeds, Randomize track, Randomize track seeds, Vary track seeds. New Save & load functions. Updated visuals. Fixed a few small UI issues, fixed a program breaking error regarding Delete Track.
V.1.1: Added save & load, Record (buggy), Single track pause, 5 new algorithms, ability to switch between algorithms
v.1: Initial release

Download here! (includes some tracks I made).
YoYo Games Sandbox

Old Downloads
v.1.1
v.1.0

Tell me what you think =)

Edited by Lemon Pie, 21 April 2012 - 10:59 PM.

  • 3

#2 junhalestone

junhalestone

    GMC Member

  • GMC Member
  • 432 posts
  • Version:GM8.1

Posted 18 April 2012 - 08:07 PM

Looks awesome!
I was working on one, but yours looks far, far better so I suppose I'll drop mine now :P
  • 0

#3 JAk HAk

JAk HAk

    sepius fidelis

  • New Member
  • 713 posts
  • Version:GM:HTML5

Posted 18 April 2012 - 08:19 PM

Nice work. Although, I found listening to the music it produced to be very tense. Which is to say that the music never had any sort of release. Anyway, I'm hoping you keep at it and continue to improve upon it.
  • 0

#4 Lemon Pie

Lemon Pie

    GMC Member

  • GMC Member
  • 194 posts

Posted 18 April 2012 - 08:21 PM

Looks awesome!
I was working on one, but yours looks far, far better so I suppose I'll drop mine now :P

Don't do that! Or if your going to please let me see your algorithm for generating music =) If it's good I'd add it in with my algorithms and give you credit for it :3
  • 2

#5 Daddio

Daddio

    GMC Member

  • GMC Member
  • 267 posts

Posted 18 April 2012 - 08:45 PM

Lemon, could you check your DL link? Not working.
  • 0

#6 Lemon Pie

Lemon Pie

    GMC Member

  • GMC Member
  • 194 posts

Posted 18 April 2012 - 09:14 PM

Lemon, could you check your DL link? Not working.

Added Sandbox download.
  • 1

#7 junhalestone

junhalestone

    GMC Member

  • GMC Member
  • 432 posts
  • Version:GM8.1

Posted 18 April 2012 - 09:29 PM

Yeah - don't worry, yours is a LOT better than mine. I didn't use the DLL and it only had 16 notes, 1 instrument, the melodies created were fairly poor, etc :0

This is really good - nice work!
  • 0

#8 Lemon Pie

Lemon Pie

    GMC Member

  • GMC Member
  • 194 posts

Posted 18 April 2012 - 11:20 PM

Nice work. Although, I found listening to the music it produced to be very tense. Which is to say that the music never had any sort of release. Anyway, I'm hoping you keep at it and continue to improve upon it.

That has to do with the DLL. AFAIK there is no way to add release easily & on the fly.

Yeah - don't worry, yours is a LOT better than mine. I didn't use the DLL and it only had 16 notes, 1 instrument, the melodies created were fairly poor, etc :0

This is really good - nice work!

Not bad for like 3 days, eh? Haha
Anyways I still would like your algorithm if you don't mind =3 I plan to add alot of algorithms for the user to choose from & you'd get credit if I use it of course =)

Edit: Here's a test of the record function! Wewt!
It runs flawlessly in Windows Media Player, however it reads as "Corrupted" in Anvil Studio, and in TunaFish does not import correctly. I believe this has to do with the way the DLL records notes with it's most basic function. I'mma try with the more advanced functions and see if that solves the problem.

Edited by Lemon Pie, 19 April 2012 - 07:11 AM.

  • 1

#9 Lemon Pie

Lemon Pie

    GMC Member

  • GMC Member
  • 194 posts

Posted 19 April 2012 - 06:07 PM

Updated to v.1.1
Features added:
Record (buggy, but its there)
Save and Load (w/ Custom File Extension)
Single Track Pause/Mute
More algorithms
Changing of algorithms

And some songs I made if you download from MediaFire :D (my personal favorite is called This Feeling)

Com'on peeps! Post your tracks or screen shots of them! :)
  • 1

#10 junhalestone

junhalestone

    GMC Member

  • GMC Member
  • 432 posts
  • Version:GM8.1

Posted 19 April 2012 - 06:09 PM

Cool - I might PM you my algorithm then. But seriously it's something I'm not too proud of ;)
  • 0

#11 Lemon Pie

Lemon Pie

    GMC Member

  • GMC Member
  • 194 posts

Posted 19 April 2012 - 06:26 PM

Cool - I might PM you my algorithm then. But seriously it's something I'm not too proud of ;)

Haha its all cool. Before I got the idea from MusiNum to parse the output numbers through a binary converter my algorithm sucked a big one and was slow as hell (it was probably worse & slower than yours TBH)
See as long as yours can output a number then I can use it. If it out puts a large number then thats even more awesome cause I can parse it through binary like a boss and be even more likely to get a note playing.

...
Oh yea something I may have forgot to add into the help file: After starting a record you have to press 'Enter' to end it.
  • 1

#12 Lemon Pie

Lemon Pie

    GMC Member

  • GMC Member
  • 194 posts

Posted 21 April 2012 - 10:53 PM

Updated to version 1.2-B
New features: Randomize all tracks, Randomize all seeds, Vary all seeds, Randomize track, Randomize track seeds, Vary track seeds. New Save & load functions. Updated visuals
Bugs/fixes: Fixed a few small UI issues, fixed a few program breaking errors regarding Delete Track.

This version is not backwards compatible w/ v.1.1 and you cannot load the songs from 1.1 into 1.2b. However if you download from MediaFire there is a converter that will take your old .lpmg files and convert them into .lsf
  • 0

#13 junhalestone

junhalestone

    GMC Member

  • GMC Member
  • 432 posts
  • Version:GM8.1

Posted 25 April 2012 - 09:44 PM

The new visuals look awesome!
  • 0

#14 Lemon Pie

Lemon Pie

    GMC Member

  • GMC Member
  • 194 posts

Posted 26 April 2012 - 06:46 AM

The new visuals look awesome!

Thanks =) Although the background was done to simply make it look nicer, adding the opaque-ness to the track-windows was done out of practicality, so that you could see tracks underneath of others.

Well since I'm at it...
An Update: I am trying to get the record function to work properly, however I cannot seem to figure out the problem that causes the MIDI headers to corrupt. :-/ If anyone has experience using Midi Notes' record MIDI record functions I would gladly appreciate some help.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users