Esempio n. 1
0
    def panic(self):
        self.send_osc('/renoise/transport/panic')
    
    def note_on(self, instrument, track, note, velocity):
        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
Esempio n. 2
0
            time.sleep(1.0/16)

class FadersApp(monome.Monome):
    def __init__(self, address):
        monome.Monome.__init__(self, address)
        self.faders = [Fader(self, i) for i in range(8)]
        for f in self.faders:
            f.start()
    
    def grid_key(self, x, y, s):
        if s:
            self.faders[x].goal = 7 - y

# 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 = FadersApp((host, port))
m.start()

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

Esempio n. 3
0
                heldSand.append(sandnum)

                if sandnum >= 0:
                    sand = dune[now].sands[sandnum + dune[now].offset] + " "

                    print sand

                    putOut(sand)


# connect the monome, from pymonome/examples
# see https://github.com/artfwo/pymonome

print "looking for a monome..."
host, port = monome.find_any_monome()
m = desert((host, port))
m.start()

print('monome started on ' + host + ':' + str(port))

m.led_intensity(brightness)
m.led_all(0)

time.sleep(.01)

width, height = m.getsize()

maxX = width - 1
maxY = height - 1
maxKey = width * height - height - 3