Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
csize = wselect({2:5, 3:10, 4:20, 5:10, 6:5})
bpm = wselect({80:5, 100:10, 120:20, 140:10, 160:5, 180:5})
print("making",name)
palett = musictheory.palette(scale, progsize, progcount, csize)
palett._bpm = bpm
palett.autoProgs()
themes = (palett._n1, palett._n2, palett._bg, palett._ch, palett._ge)
for inst in cinsts:
for them in themes:
centre = rselect(musictheory.listNotes(inst))
ncount = wselect(musictheory.chordicCWeights())
them.addVoice(inst, centre, "chordic", ncount)
for inst in sminsts:
for them in themes:
centre = rselect(musictheory.listNotes(inst))
ncount = wselect(musictheory.smelodicCWeights())
them.addVoice(inst, centre, "smelodic", ncount)
for inst in lminsts:
for them in themes:
centre = rselect(musictheory.listNotes(inst))
ncount = wselect(musictheory.lmelodicCWeights())
them.addVoice(inst, centre, "lmelodic", ncount)
for inst in pinsts:
for them in themes:
centre = rselect(musictheory.listNotes(inst))
ncount = wselect(musictheory.percussionCWeights())
them.addVoice(inst, centre, "percussion", ncount)
for inst in ginsts:
for them in themes:
centre = rselect(musictheory.listNotes(inst))
ncount = wselect(musictheory.genericCWeights())
them.addVoice(inst, centre, "generic", ncount)
palett = musictheory.palette(scale, progsize, progcount, csize)
palett._bpm = bpm
palett.autoProgs()
themes = (palett._n1, palett._n2, palett._bg, palett._ch, palett._ge)
for inst in cinsts:
for them in themes:
centre = rselect(musictheory.listNotes(inst))
ncount = wselect(musictheory.chordicCWeights())
them.addVoice(inst, centre, "chordic", ncount)
for inst in sminsts:
for them in themes:
centre = rselect(musictheory.listNotes(inst))
ncount = wselect(musictheory.smelodicCWeights())
them.addVoice(inst, centre, "smelodic", ncount)
for inst in lminsts:
for them in themes:
centre = rselect(musictheory.listNotes(inst))
ncount = wselect(musictheory.lmelodicCWeights())
them.addVoice(inst, centre, "lmelodic", ncount)
for inst in pinsts:
for them in themes:
centre = rselect(musictheory.listNotes(inst))
ncount = wselect(musictheory.percussionCWeights())
them.addVoice(inst, centre, "percussion", ncount)
for inst in ginsts:
for them in themes:
def autoGen(voice, theme, pal):
typ = voice._mtype
if typ == "chordic":
ncount = wselect(musictheory.chordicCWeights())
elif typ == "percussion":
ncount = wselect(musictheory.percussionCWeights())
elif typ == "smelodic":
ncount = wselect(musictheory.smelodicCWeights())
elif typ == "lmelodic":
ncount = wselect(musictheory.lmelodicCWeights())
elif typ == "generic":
ncount = wselect(musictheory.genericCWeights())
voice.autoProg(theme._cprog, theme._progc, theme._csize, ncount, None, None)
print("Voice was auto-generated")