Closed oggy22 closed 5 years ago
This problem is known as Smallest Grammar Problem in Chomsky grammars, and there are papers on its applications in music.
The input should be midi files with fugal-like works. Fugal like work is a composition where each track has no more than a single tone in a time.
The output should be a graphical layout of DAG with each node being a musical sheet snippet without clef. Each node will include stats as:
Each node will provide interface for modifications, so you can modify it and replay the composition.
You should be able to sort nodes based on:
The program should work nicely on Bach inventions, especially C major, D minor, F major, G major and A minor.
The program should be able to analyze multiple compositions in parallel, e.g. all the 15 inventions by Bach and therefore provide some insights, possibly, to entire corpus.
Here is code design:
interface IDuration { Fraction duration; }
class note : IDuration
{
}
class ChromaticPassage : IDuration, IEnumerable<note>
{
List<IDuration> parts;
duration => parts.Sum(part => part.duration);
int offset;
}
class DiatonicPassage : IDuration
{
}
If there were only chromatic melodies:
interface IMelodyPart
{
Fraction duration;
IEnumerable
class note : IMelodyPart
{
Fraction duration => duration;
IEnumerable
class MelodyPartList : List
class ChromaticMelodyPart : IMelodyPart
{
Int offset;
MelodyPartList list;
IEnumerable
To add diatonic: class DiatonicMelodyPart : IMelodyPart { int offset; TwevleToneSet scale; MelodyPartList list; }
More songs which should be analyzed nicely: Winter wonderlands Mozart 6th symphony 1st movement Albinoni adagio
This is mostly done by #29, and partly by #50, #63 etc, so I am closing it.
However, as of now, there are some missing parts as #36, #44 etc.
Given a melody, create a DAG which breaks the melody down, looking for similarities. If multiple DAGs are possible, take one with the fittest score based on a criteria. A criteria should be probably one of the following:
This may be a hard AI/NP problem.
p.s. DAG is representation of melody as Directed Acyclic graph such that nodes represent parts of the melody, and edges represent containment i.e. "this part is composed of these smaller parts". The root node represent the whole melody.