Пример #1
0
def monitor_beat(parent):
    while watchman.active == True:
        global main_beat
        main_beat += 1
        threading.Thread(target=play_note,
                         args=(mixer.get_channel("metronome"), 37,
                               tempo_in_time)).start()
        time.sleep(float(0.5))
Пример #2
0
def enqueue_melody(parent):
    if watchman.active == True:
        if len(melodylines) < buff: add_melody(tacet)

        if len(melodylines) > 0:
            thisone = melodylines[0].split()
            play_melody(mixer.get_channel("melody"), tempo_in_time, list(thisone))
            if parent.user_sheetmusic: lily.add_melody_bar(thisone)
            if parent.user_midioutput: recorder.add_melody_bar(thisone)
            melodylines.pop(0)
Пример #3
0
def enqueue_bass(parent):
    if watchman.active == True:
        if len(basslines) < buff: add_bass(tacet)

        if len(basslines) > 0:
            thisone = basslines[0].split()
            play_bass(mixer.get_channel("bass"), tempo_in_time, list(thisone))
            if parent.user_sheetmusic: lily.add_bass_bar(thisone)
            if parent.user_midioutput: recorder.add_bass_bar(thisone)
            basslines.pop(0)
Пример #4
0
def enqueue_chords(parent):
    if watchman.active == True:
        if len(chordlines) < buff: add_chords(tacet)

        if len(chordlines) > 0:
            thisone = chordlines[0].split()
            play_chord(mixer.get_channel("chords"), tempo_in_time, list(thisone))
            if parent.user_sheetmusic: lily.add_chords_bar(thisone)
            if parent.user_midioutput: recorder.add_chords_bar(thisone)
            chordlines.pop(0)
Пример #5
0
def enqueue_drums(parent):
    if watchman.active == True:
        if len(drumlines) < buff: add_drums(drumtacet) 

        if len(drumlines) > 0:
            current_bar = drumlines[0].split()
            beatarray = [list(current_bar[0][1:]),list(current_bar[1][1:]),list(current_bar[2][1:])]
            play_drums(mixer.get_channel("drums"), tempo_in_time, beatarray)
            if parent.user_midioutput: recorder.add_drums_bar(beatarray)
            drumlines.pop(0)
Пример #6
0
def fire():
    key = conductor.relativekey
    mode = conductor.relativemode
    octave = str(3)

    scale = tools.make_scale(key, mode, octave)

    scalenote = scale[random.randrange(len(scale))]
    scalenote = scalenote[:-1]
    stabnote = tools.letter_to_midi(scalenote, 3)

    performer.play_note(int(mixer.get_channel("stabs")), stabnote, 0.01)
Пример #7
0
def fire():
    key = conductor.relativekey
    mode = conductor.relativemode
    octave = str(3)

    scale = tools.make_scale(key, mode, octave)

    scalenote = scale[random.randrange(len(scale))]
    scalenote = scalenote[:-1]
    stabnote = tools.letter_to_midi(scalenote, 3)

    performer.play_note(int(mixer.get_channel("stabs")), stabnote, 0.01)
Пример #8
0
def enqueue_drums(parent):
    if watchman.active == True:
        if len(drumlines) < buff: add_drums(drumtacet)

        if len(drumlines) > 0:
            current_bar = drumlines[0].split()
            beatarray = [
                list(current_bar[0][1:]),
                list(current_bar[1][1:]),
                list(current_bar[2][1:])
            ]
            play_drums(mixer.get_channel("drums"), tempo_in_time, beatarray)
            if parent.user_midioutput: recorder.add_drums_bar(beatarray)
            drumlines.pop(0)
Пример #9
0
def kill_chord(chord):
    for note in chord:
        midiout.send_message([mixer.get_channel("chords"), note, 0])
Пример #10
0
def kill_chord(chord):
    for note in chord: 
        midiout.send_message([mixer.get_channel("chords"), note, 0])
Пример #11
0
def monitor_beat(parent):
    while watchman.active == True:
        global main_beat
        main_beat += 1
        threading.Thread(target=play_note, args=(mixer.get_channel("metronome"), 37, tempo_in_time)).start()
        time.sleep(float(0.5))