Exemplo n.º 1
0
def drums(ritmo, tempo, compases):
    "Output one measure to queue."
    global incoming
    tiempoms = alsamidi.tuple2time(alsaseq.status()[1]) * 1000
    t = pista.construye(ritmo, tempo, compases, tiempoms)
    final = alsamidi.time2tuple(pista.duracion(ritmo, tempo, compases, tiempoms) / 1000.0)
    t.append((alsaseq.SND_SEQ_EVENT_ECHO, 1, 0, 0, final, (0, 0), (alsaseq.id(), 0), (1, 2, 3, 4, 5)))

    for evento in t:
        alsaseq.output(evento)
        incoming.append(evento)  # record it
Exemplo n.º 2
0
def drums(ritmo, tempo, compases):
    'Output one measure to queue.'
    global incoming
    tiempoms = alsamidi.tuple2time(alsaseq.status()[1]) * 1000
    t = pista.construye(ritmo, tempo, compases, tiempoms)
    final = alsamidi.time2tuple(
        pista.duracion(ritmo, tempo, compases, tiempoms) / 1000.)
    t.append((alsaseq.SND_SEQ_EVENT_ECHO, 1, 0, 0, final, (0, 0),
              (alsaseq.id(), 0), (1, 2, 3, 4, 5)))

    for evento in t:
        alsaseq.output(evento)
        incoming.append(evento)  # record it
Exemplo n.º 3
0
    def test(self):
        from alsamidi import time2tuple

        self.assertEqual((1, 500000000), time2tuple(1.5))