musikinformatik / SuperDirt

Tidal Audio Engine
GNU General Public License v2.0
521 stars 74 forks source link

MIDI note data dropout with SuperDirt MIDI #93

Open OscarSouth opened 6 years ago

OscarSouth commented 6 years ago

I'm getting pretty frequent MIDI note dropout with SuperDirt MIDI at the moment.

In trying to fix this, I set the scheduling priority for jackd and scsynth processes to FIFO priority 99, which seems to have no effect on the problem. I've also set my processor scheduling to performance, am running a real time kernel (AVLinux distro -- Debian based) and have a number of other audio performance optimisations applied.

I've tried with a few different MIDI targets to make sure that it's not an issue on the 'other end'.

Here's my startup file:

s.options.numBuffers = 4096 * 16;
s.options.memSize = 8192 * 16;
s.options.maxNodes = 1024 * 32;
s.options.device = "PreSonus AudioBox iTwo";
s.options.numOutputBusChannels = 16;
s.waitForBoot {
    ~dirt = SuperDirt(2, s);
    // ~dirt.loadSoundFiles("/home/oscarsouth/dirt_samples/*");
    s.sync;
    ~dirt.start(57120, [0,2,4,6,8]);
    MIDIClient.init;
    ~midiOut = MIDIOut.newByName("PreSonus AudioBox iTwo", "PreSonus AudioBox iTwo MIDI 1");
    ~latency = 0.05;
    ~midiOut.latency = ~latency;
    ~dirt.soundLibrary.addMIDI(\midi, ~midiOut);

I've recorded a clip of a generic drumbeat repeating for a few bars to give an example: https://www.dropbox.com/s/n8u55vde1kmgtrv/Ch%201%20-%20120%20bpm%20-%20001-trimmed-converted.m4a?dl=0

OscarSouth commented 6 years ago

Just an update:

I've repeated this test on a different OS now (Manjaro) and the results are identical (wanted to confirm to myself that it wasn't an OS issue on my personal machine).

telephon commented 6 years ago

It is a supercollider issue, perhaps. Could you post an example that is using only MIDIOut to https://github.com/supercollider/supercollider/issues?

OscarSouth commented 6 years ago

@telephon do you mean an example of the MIDI data itself? This example was audio recorded from an audio unit on a different device being triggered by MIDI (no SuperDirt Audio), but I can easily record some MIDI and provide both (just making sure I'm understanding correctly before I post it).

telephon commented 6 years ago

@OscarSouth sorry, I wasn't very clear. What I meant was: could you try a simple example and see if the timing is off, too?

Something like:


// first, initialize your midi device.
(
MIDIClient.init;
MIDIClient.list; // to check, which are there, you can query them
)

(
// create a midi out connection
~midiOut = MIDIOut.newByName("FastLane USB", "Port A"); // substitute your own device here

 // you may want to adjust the latency here
~midiOut.latency = 0.0;
)

// and then:
(
Pbind(
    \type, \midi,
    \midiout, ~midiOut,
    \degree, Prand([1, 2, 3, [0, 5]], inf), 
    \dur, 0.1
).play
)
OscarSouth commented 5 years ago

I was giving a talk yesterday and have been very busy with prep for that so haven't done this yet. Sound check clip!:

https://twitter.com/oscarsouth/status/1024710325386588161

Will do it once I set my equipment back up at home.