monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
621 stars 144 forks source link

Missing note off messages using Arturia KeyStep #609

Closed markwheeler closed 4 years ago

markwheeler commented 5 years ago

Having trouble getting the Arturia KeyStep working correctly with norns. The midi event frequently doesn't seem to get called for note offs. It happens consistently and even at very low tempos (1/4 notes) causing lots of hung notes.

I'm not having the same problem with an Akai MPK Mini or when sending notes from Ableton Live via an iConnectivity mio. It all points towards the KeyStep being the issue... but it works perfectly when connected to my Mac.

Any ideas how to debug further? Could there be something different about the way the KeyStep sends its data?

tehn commented 5 years ago

i've also noticed this with the keystep. i'll try adding some debug prints to https://github.com/monome/norns/blob/master/matron/src/device/device_midi.c and see what i find

tehn commented 5 years ago

added to line 108:

fprintf(stderr,"midi %d %d %d\r\n", msg_buf[0], msg_buf[1], msg_buf[2]);

weird repeat data coming in:

midi 145 60 30
midi 145 60 30
midi 145 60 30
midi 129 60 64
midi 129 60 64
midi 129 60 64
midi 129 60 64
midi 129 60 64
midi 145 48 36
midi 145 48 36
midi 145 48 36
midi 129 48 64
midi 129 48 64
midi 129 48 64
midi 129 48 64
midi 129 48 64
midi 145 60 30
midi 145 60 30
midi 145 60 30
midi 129 60 64
midi 129 60 64
midi 129 60 64
midi 129 60 64

this seems to only happen when the arpeggiator is on. normal note-pressing just sends one note.

and somehow, despite the repeat sends, only one note event is generated?

it's a start...

malacalypse commented 5 years ago

See https://github.com/raspberrypi/linux/issues/2687 for some details - I'm having the same exact issues with my Keystep. I was able to mitigate the problem under certain circumstances but a real fix is not yet available.

malacalypse commented 5 years ago

I don't have a Norns but on my Pi I have a hardware MIDI input, and for my Keystep I'm just using that hardware input port and powering the keystep via USB only. That seems to solve the problem. Not sure if the Norns has a hardware MIDI port but that might be a workaround if it's available to you. I have no idea why Arturia cheaped out so hard on the USB MIDI implementation - devices that cost far less than the Keystep implement it just fine.

tehn commented 5 years ago

@malacalypse thank you for the tip! much appreciated.

markwheeler commented 5 years ago

FWIW I did email Arturia about this to hear their take on it. Of course they don't officially support Linux so I didn't learn too much. They suggested to either switch to USB 1 speeds with dwc_otg.speed=1 or compare to a Linux desktop to track down if the issue is hardware or OS related (which I've not done so far).

tehn commented 5 years ago

nice that they wrote you back. has arturia ever offered firmware updates for any of their controllers? (just curious). keystep is one of the nicer cheap controllers, so it'd be great if we had it working correctly some day.

markwheeler commented 5 years ago

Yes I'm surprised it's an issue, seems like a nice match. It looks like they did release a few bug-fix firmware updates for the KeyStep but nothing new since 2016.

malacalypse commented 5 years ago

Yes, they updated their Beatstep Pro quite heavily in the first few years, adding a ton of features. Nothing much for the KeyStep though, as @markwheeler mentions. It is disappointing that they don't have a more robust USB implementation. And, unless I'm wrong, there isn't another 37 key controller that's got playable keys with aftertouch that is so compact, so not only is it a nicer cheap controller, it's the only option at any price if you need more than two octaves and still ultraportable. I tried setting the USB speed to 1 with dwc_otg.speed=1 as @tehn mentioned (as part of the debugging process with the Pi team) but it didn't do anything for me. nak_holdoff=1 did help quite a bit, but didn't solve the problem entirely. There are reports that the 4.19 kernel that's out now has some improvements but I haven't tried it yet. And there are also reports that the pre-4.14 kernels (4.09?) were fine too.

jonnybutler commented 4 years ago

Arturia released a new firmware for the Keystep today, so maybe someone can test it out and see if it fixes these issues. Doesn't mention any bugs, but worth a shot? Personally don't have one but have held off since reading through this issue.

tehn commented 4 years ago

thanks for the heads up. do we have a script that can reproducibly fail?

markwheeler commented 4 years ago

This was always an issue with Molly the Poly in the past, I can test it out again in the next few days. There are some bug fixes listed on the Arturia site although they are fairly vague.

markwheeler commented 4 years ago

I just did the Keystep update and spent 10mins testing - and didn't get the problem at all! Obviously I'd want to live with it a bit longer before declaring this 100% fixed but it seems hopeful :)