How to use the musictheory.genericCWeights function in musictheory

To help you get started, we’ve selected a few musictheory examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joaoperfig / mikezart / source / mikezart2.py View on Github external
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)    
    for inst in miminsts:
        for them in themes:
            toCopy = rselect(them._voices["chordic"] + them._voices["smelodic"])
            centre = rselect(musictheory.listNotes(inst))
            ncount = wselect(musictheory.chordicCWeights())
            voic = musictheory.voice(inst, centre, scale, "chordic", 0, 0)
            try:
                voic.mimic(toCopy)
                them.addVoiceAsIs(voic)                  
            except:
                print("could not mimic!")
    for t in themes:
        t.shuffleSort()
            
    filezart.makeFolder("../exports/song_" + name)
github joaoperfig / mikezart / source / mikezart2.py View on Github external
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)    
            
    for t in themes:
        t.shuffleSort()
            
    filezart.makeFolder("../exports/song_" + name)
    palett.infoToFolder(bpm, "../exports/song_" + name)
    
    #play(palett._n1.previewAudio(bpm))
    #play(palett._n2.previewAudio(bpm))
    #play(palett._bg.previewAudio(bpm))
    #play(palett._ch.previewAudio(bpm))
    
    print("done with", name)
            
    return palett
github joaoperfig / mikezart / source / mikezario.py View on Github external
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")