예제 #1
0
파일: thirst.py 프로젝트: ilzxc/thirst
for chord in chords:
    notes = prepareChord(chord)
    instruments = ['violin', 'viola', 'cello']
    time = abs(window(4.)) + 1.
    note, notes = oneOf(notes)
    bundles = [perc(note[0], time, 'oboe')]

    while len(instruments) > 0 and len(notes) > 0:
        note, notes = oneOf(notes)
        possible_instruments = intersect(instruments, check(note))
        instrument = one(possible_instruments)
        instruments.remove(instrument)
        voiceTime = window(time) * .2 + time
        note_used = note[0]
        if one([0, 1]) is 0: note_used = round(note_used)
        bundles.append(moans(note_used, voiceTime, instrument))

    oscore = o.message('/score', bundles)
    file_prefix = prefix()
    oprefix = o.message('/prefix', file_prefix)
    otime = o.message('/time', time + 1.)
    result = o.bundle(messages = [oscore, otime, oprefix])
    f = open('./scores/' + file_prefix + '_score.txt', 'w')
    f.write(str(result))
    f.close()
    send(result)
    print(result)
    print('-' * 100)
    sleep(time + 4.)

print("Finished...")
예제 #2
0
            chords.append(parse_line(line))

lownotes = []
for chord in chords:
    freqs, amps = split(chord)
    notes = ftom(freqs)
    for note in notes:
        if note > lowest_notes["violin"] and note < (lowest_notes["oboe"] + 24):
            lownotes.append(round(note))

print(len(lownotes))

for note in lownotes:
    instruments = ["violin"]
    time = abs(window(4.0)) + 1.0
    bundles = [moans(note, time, "violin")]

    oscore = o.message("/score", bundles)
    file_prefix = prefix()
    oprefix = o.message("/prefix", file_prefix)
    otime = o.message("/time", time + 1.0)
    result = o.bundle(messages=[oscore, otime, oprefix])
    f = open("./scores/" + file_prefix + "_lm_score.txt", "w")
    f.write(str(result))
    f.close()
    send(result)
    print(result)
    print("-" * 100)
    sleep(time + 4.0)

print("Finished...")
예제 #3
0
from engine_moans import moans

test = moans("Vc-trem_ord-A#2-mf-3c.aif", 1.2)