I'm working on Python bindings for Fluidsynth. The following code, in
Cython, makes no sound and locks up my ALSA until the connection times out.

    cpdef test(self):
        cdef fluid_event_t* event
        cdef int ticks

        ticks = self.ticks

        event = new_fluid_event()
        fluid_event_set_dest(event, 1)

        for i in range(10):
            fluid_event_noteon(event, 0, 45, 127)
            fluid_sequencer_send_at(self.seq, event, ticks + 72, 1)
            fluid_event_noteon(event, 0, 50, 127)
            fluid_sequencer_send_at(self.seq, event, ticks + 288, 1)
            fluid_event_noteon(event, 0, 60, 127)
            fluid_sequencer_send_at(self.seq, event, ticks + 360, 1)
            fluid_event_noteon(event, 0, 55, 127)
            fluid_sequencer_send_at(self.seq, event, ticks + 576, 1)
            fluid_event_noteon(event, 0, 60, 127)
            fluid_sequencer_send_at(self.seq, event, ticks + 720, 1)

            ticks += 720

        delete_fluid_event(event)

This is a near-exact transcription of the sequencer example in the API
docs. The synth number is hard-coded since I'm only testing one synth.

Do I need to make a new fluid_event_t for each sent event? The docs say
fluid_sequencer_send_at makes a copy of the event, and making copies
doesn't appear to help...

Any tips are appreciated.
~ C.


_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/fluid-dev

Reply via email to