public List<Note> GenerateNotes()
{
var g = Gene as NoteGene;
if (this.Children == null)
{
//No choice, no children, you gonna have to be an argument
g.GeneType = GPGeneType.Argument;
return new List<Note>() { g.GenerateNote() };
}
if (Gene.GeneType == GPGeneType.Argument)
return new List<Note>() { g.GenerateNote() };
else
{
switch (g.Function)
{
case NoteGene.FunctionTypes.Concatenation:
var childnotes = this.Children[0].GenerateNotes();
childnotes.AddRange(this.Children[1].GenerateNotes());
return childnotes;
case NoteGene.FunctionTypes.DurationShift:
this.ShiftDuration(g.FuncArg);
return this.Children[0].GenerateNotes();
case NoteGene.FunctionTypes.PitchShift:
this.ShiftPitch(g.FuncArg);
return this.Children[0].GenerateNotes();
case NoteGene.FunctionTypes.Repeat:
this.Repeat(g.FuncArg);
return this.Children[0].GenerateNotes();
case NoteGene.FunctionTypes.Swap:
this.Swap();
return this.Children[0].GenerateNotes();
default:
throw new Exception("Eh wena");
}
}
}