def genTransition(): chords = [[4,6,8],[4,6,8],[0,2,4],[0,2,4],[4,6,8],[4,6,8],[0,2,4], [0,2,4]] phrase = gp.genPhrase(prev_note = 0, chords=chords, authentic_cadence=True) for i in range(0,4): phrase.cells[i].setKey(7) phrase.sub_chunks[0].setKey(7) return phrase
import gencell as gc import counterpoint as counter import genbass as gb from chunk import * #define instruments instr_cells = OrderedDict() instr_cells['Flute'] = [] instr_cells['Piano 1'] = [] instr_cells['Piano 2'] = [] instrs = ['Flute', 'Piano 1', 'Piano 2'] octaves = {'Flute':5, 'Piano 1':5, 'Piano 2':4} #generate content period1phrase1 = (gp.genPhrase(authentic_cadence=False)) instr_cells['Flute'].extend([gc.genBlankCell(2.0) for cell in period1phrase1.cells]) instr_cells['Piano 1'].extend(period1phrase1.cells) instr_cells['Piano 2'].extend(acc.genAlbertiEighths(period1phrase1)) period1phrase2 = (gp.genPhrase(basicIdea=period1phrase1.sub_chunks[0], authentic_cadence=True)) instr_cells['Flute'].extend(period1phrase2.cells) instr_cells['Piano 1'].extend(acc.genAlbertiEighths(period1phrase2)) instr_cells['Piano 2'].extend(acc.genQuarters(period1phrase2)) period2 = (gper.genPeriod()) period2phrase1 = period2.sub_chunks[0] instr_cells['Flute'].extend(counter.genCounter(period2phrase1)) instr_cells['Piano 1'].extend(period2phrase1.cells) instr_cells['Piano 2'].extend(acc.genAlbertiEighths(period2phrase1))