;Add measures to short Main variations. Copy the notes to the elongated area, ;but switch notes between ChordNote2 and ChordNote3 to get more variety. Define PartName1-4 String Define Elongation Numeric Define Octave Numeric Define OldOctaveNote Numeric Define NewOctaveNote Numeric Define StyleModified Numeric ForEachStyle Print '.' Let StyleModiFied = 0 ForEachPart Let Elongation = -1 Let PartName1-4 = SubString PartName 1 4 If PartName1-4 = 'Main' If MeasuresInPart < 4 Let StyleModified = 1 Let Elongation = MeasuresInPart Let MeasuresInPart = Add MeasuresInPart Elongation ForEachTrack ForEachEvent If EventType <= 2 ;Note-on Note-off If TranspositionType <> 3 ;Do not transpose the bass If DrumTrack = 0 ;Do not transpose the drumtrack Let Octave = Divide DataByte1 12 Let OldOctaveNote = Modulus DataByte1 12 Let NewOctaveNote = -1 If OldOctaveNote = ChordNote2 Let NewOctaveNote = ChordNote3 EndIf If OldOctaveNote = ChordNote3 Let NewOctaveNote = ChordNote2 EndIf If NewOctaveNote > -1 Let DataByte1 = Multiply Octave 12 Let DataByte1 = Add Databyte1 NewOctaveNote EndIf EndIf EndIf Let Measure = Add Measure Elongation InsertEvent EndIf NextEvent NextTrack EndIf EndIf NextPart If StyleModified = 1 PrintLine StyleName SaveStyle EndIf NextStyle