Added: 3 years ago
From: Onderstekop
Views: 753
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (10)

Sign In or Sign Up now to post a comment!
  • That's okay.

  • I'll try and split the message to see if that helps (the textarea just gets disabled, but nothing seems to get posted).

    You can give it a key and a progression in shorthand - like the one mentioned above: I, vi, ii and V.

  • A single call to a mingus function will then provide the corresponding notes in the chords, which are then converted to integers to make serialization easy (in fact: that's all the serialization there is; just a simple list of integers).

  • By god, it worked!

  • Perhaps I am not fully understanding the terms you are using, but if you can use a function to determine the next set of chords, why use a genetic algorithm to find it?

  • You are understanding correctly that this is not an algorithm that finds _some_ chord, because a lot of random notes make up some kind of exotic chord so that GA would be done in 1 or 2 generations and thus not so interesting.

    I was more interested in the semi chaotic process that you could play against when you know what chord you are looking for. It introduces variations.

    It's evolving from a random collection of notes to the one you 'want' and plays the best chord in every generation.

  • Okay, I see.

    However, I have something I want you to try:

    Have fitness be determined by the amount of time it would take for the chord to reach a repetition point in the waveform. A harmonious chord is one where the waveform comes to a repetition sooner than a non-harmonious chord, relative to the same note. For example: C sounds harmonious when played with a G, because they are fifths, meaning that mathematically G is 1.5 times the wavelength of C. .....

  • Imagine frequencies and harmony as something like planets orbiting around the sun. If planet A orbits the sun 1.5 times sun then planet B, it will take planet A 3 revolutions for planet B to make 2 revolutions, and after that point you would be back where you originally were. However, if the ratio was something like 2:5.5123 rather than 2:3, it would take much longer for the planets to meet up again at the same point they originally were.

  • I am guessing that because you are a programmer that you know what sin() and cos() do.

    Well, imagine this formula:

    y = sin(x) + sin(x * 1.5)

    If you graphed this out, y would equal 0 when X is 0, 3, 6, 12, and so on (assuming sin(1) meant one whole revolution, like sin(360 degrees) or sin(pi * 2))

  • err, i made a mistake:

    If you graphed this out, sin(x) AND sin(x*1.5) would both equal zero when X is 0, 3, 6, 12 and so on*

  • but if you graphed out:

    y = sin(x) + sin(x*1.4173759), it would take many, many revolutions for both sin functions to equal 0.

  • It sounds interesting, but how would you get the fitness for for instance D, E, F when you are looking for C, E, G?

  • Well, the point of this kind of genetic algorithm, where fitness is determined by the harmony of the chord, the point would be to have good-sounding chords randomly generated as if the computer was the composer. But I suppose intervention would be possible, as genetic algorithms are flexible.

  • What I'm getting at is that a chord is made up out of more than one frequency, so how would you make that work. Should you still solve for 0 or should you just compare on a per note basis? Maybe it would be easier to have a fitness function that just counts thirds and fifths.

  • What determines fitness?

  • The fitness value is the absolute distance in half notes from the chord that is being looked for. If the chord has been found then the next chord in the progression (I-iv-ii-V or C-Am-Dm-G) is chosen and the evolution process resets.

  • How does it know what chord to look for?

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more