示例#1
0
def main():
    if len(sys.argv) < 4:
        script_name = sys.argv[0]
        print "Usage: %s <midi client> <midi port> <file1, ...>" % script_name
        sys.exit(1)

    print "Press # track then enter to toggle track"
    client = int(sys.argv[1])
    port = int(sys.argv[2])
    file_paths = sys.argv[3:]

    if len(file_paths) <= 0:
        print "No MIDI files specified"
        sys.exit(1)

    looper = make_looper(file_paths, client, port)

    while True:
        track_idx = read_toggle()
        if track_idx is not None:
            if track_idx >= len(looper.tracks):
                print "Track %d does not exist!" % track_idx
                continue
            if looper.tracks[track_idx].playing:
                looper.stop(track_idx)
            else:
                looper.play(track_idx)
        looper.think()
示例#2
0
def main():
    midi_client = 20
    midi_port = 0
    port = serial.Serial(None, baudrate=1000000, bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=False, rtscts=False, dsrdtr=False)
    looper = make_looper(server.MIDI_TRACKS, midi_client, midi_port)
    picture_frames = server.PICTURE_FRAMES
    hc = PyGHardwareChain([port] * len(picture_frames), [pf.real_address for pf in picture_frames])
    sb = pictureframe.Storyboard(picture_frames, server.track_listing(server.MIDI_TRACKS))
    manager = PyGManager(hc, sb, looper)
    manager.run()
示例#3
0
def main():
    looper = make_looper(MIDI_TRACKS, MIDI_CLIENT, MIDI_PORT)
    addresses = []
    serial_ports = []
    picture_frames = []
    for tty_dev in ROUTING:
        tty = serial.Serial(tty_dev, baudrate=1000000)
        for human_address in ROUTING[tty_dev]:
            real_address = human_address - 1
            addresses.append(real_address)
            serial_ports.append(tty)
            picture_frame = [pf for pf in PICTURE_FRAMES if pf.real_address == real_address][0]
            picture_frames.append(picture_frame)
    hc = biscuit.HardwareChain(serial_ports, addresses)
    manager = ss.SSManager(hc, pictureframe.Storyboard(picture_frames, track_listing(MIDI_TRACKS)), looper)
    manager.run()