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.
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.
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))
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.
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. .....
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.
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?
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.
Onderstekop 3 years ago
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.
WhiteDragon103 3 years ago
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.
WhiteDragon103 3 years ago
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*
WhiteDragon103 3 years ago
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))
WhiteDragon103 3 years ago
It sounds interesting, but how would you get the fitness for for instance D, E, F when you are looking for C, E, G?
Onderstekop 3 years ago
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.
WhiteDragon103 3 years ago
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. .....
WhiteDragon103 3 years ago
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.
Onderstekop 3 years ago
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?
WhiteDragon103 3 years ago