Interpolating two melodies into a single melody

I have been experimenting with an algorithmic/mathematical approach to combine two melodies into a single, new melody and want to ask if there are other approaches to this problem.

Example combination of two known melodies

The code can be found here, and the method is described here

Edit: I could interpolate two simple melodies to generate this piece: audio, score

• In the other post you are asking an awkward question: "My mathematical question is, if there is a musically better way to combine these melody-matrices". That's really confusing, and actually pointless in my opinion. What you're asking in "musical terms" seems mostly about aesthetics and: 1. that's clearly not something relateable in mathematical functions; 2. aesthetics is a very broad and highly subjective aspect, and in most cases simple algorithms (no matter how the involved math is complex) are not able to be involved in such aspects (machine learning is usually a preferred path). Apr 25, 2021 at 19:23
• @musicamante: you are wrong with that. see: en.wikipedia.org/wiki/Twelfth_root_of_two The perceived aesthetics is because of "simple" rational numbers which are captured by the formula described in the other post. Apr 25, 2021 at 19:33
• And where's the relation to music aesthetics in that? I'm not talking about the relation between intervals, that's a completely different subject. Apr 25, 2021 at 19:38
• Difficult to describe. It is based on measuring simple rational numbers and converting them to vectors. Then doing matrix singular value decomposition. Apr 25, 2021 at 19:44
• Have you compared it to the algorithm "give both melodies to a musician and ask him/her to improvise based on them" ?
– Emil
Apr 26, 2021 at 5:59