Exemplo n.º 1
0
                self.pressed = 'R'

    def run(self):
        self.running = True
        while self.running:
            self.turn()


    def close(self):
        self.running = False
        self.monome.led_all(0)
        a.close()
        m.close()

# print list_monomes()
m = Monome((u'Sergios-MacBook-Pro.local.', 19636))
m.start()
a = Arc((u'Sergios-MacBook-Pro.local.', 10143))
a.start()
s = Play(m, a)
s.start()

while True:
    s.turn()

try:
    while True:
        pass
except KeyboardInterrupt:
    s.close()
Exemplo n.º 2
0
        self.send_osc('/renoise/trigger/note_on', instrument, track, note, velocity)
    
    def note_off(self, instrument, track, note):
        self.send_osc('/renoise/trigger/note_off', instrument, track, note)
    
    def send_osc(self, path, *args):
        msg = OSCMessage(path)
        map(msg.append, args)
        self.client.send(msg)

print "looking for a monome..."
host, port = find_any_monome()
print "found!"

r = Renoise(('localhost', 8800))
m = Monome((host, port))
m.start()

def mycallback(x, y, s):
    m.led_set(x, y, s)
    if s == 1:
        r.note_on(-1, -1, x*8+y, 127)
    else:
        r.note_off(-1, -1, x*8+y)

m.grid_key = mycallback

m.led_all(0)
try:
    while True:
        for i in range(8):
Exemplo n.º 3
0
#! /usr/bin/env python

import time, random
from monome import Monome, find_any_monome

host, port = find_any_monome()

m = Monome((host, port))
m.start()

#def mycallback(x, y, s):
#    m.led_set(x, y, s)
#
#m.grid_key = mycallback
#
#m.led_all(0)
#try:
#    while True:
#        for i in range(8):
#            m.led_row(0, i, random.randint(0,255))
#            time.sleep(1.0/20)
except KeyboardInterrupt:
    m.led_all(0)
    m.close()

Exemplo n.º 4
0
#! /usr/bin/env python

import time, random
from monome import Monome, find_any_monome

# try to find a monome (you can skip this if you already know the host/port)
print "looking for a monome..."
host, port = find_any_monome()
print "found!"

m = Monome((host, port))
m.start()

def mycallback(x, y, s):
    m.led_set(x, y, s)

m.grid_key = mycallback

m.led_all(0)
try:
    while True:
        for i in range(8):
            m.led_row(0, i, random.randint(0,255))
            time.sleep(1.0/20)
except KeyboardInterrupt:
    m.led_all(0)
    m.close()

Exemplo n.º 5
0
import sys
import time

from consts import CHUCK_IN_PORT, CHUCK_OUT_PORT, CHUCK_HOST, LOOPS_COUNT
from row import Row
from topbar import Topbar
from patterns import Patterns

from monome import Monome

# setup chuck osc communication
chuck_in = liblo.ServerThread(CHUCK_IN_PORT, reg_methods=False)
chuck_out = liblo.Address(CHUCK_HOST, CHUCK_OUT_PORT)

# setup monome
monome = Monome()

# setup ui
rows = []


def chuck_send(path, loopId, *values):
    liblo.send(chuck_out, path, loopId, *values)


patterns = Patterns(chuck_send)

for i in range(LOOPS_COUNT):
    row = Row(i, i + 1, monome, patterns.on_msg)
    chuck_in.add_method("/status/" + str(row.id), "siiffffiff", row.on_osc_msg)
    chuck_in.add_method("/status_granular/" + str(row.id), "ffiii",
Exemplo n.º 6
0
#! /usr/bin/env python

import time, random, threading, monome, sched
import rtmidi
import loop16
from seq16 import Seq16
from monome import Monome
from midiout import *

# try to find a monome (you can skip this if you already know the host/port)
print "looking for a monome..."
host, port = monome.find_any_monome()
print "found!"
m = Monome((host, port))
m.start()

#init the MIDI port
midiout = rtmidi.MidiOut()
available_ports = midiout.get_ports()
print available_ports
if available_ports:
	midiout.open_port(1)
else:
	midiout.open_virtual_port("My virtual output")

#setup the clock
class Clock:
	bpm = 120
	s = sched.scheduler(time.time, time.sleep)
	print 'clockeventinit'