-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request midi 14bit (fine adjustment CC/CC+32 pairs) #63
Comments
Thanks for the request. It is not a trivial one: a large amount of the 16n firmware assumes that 7-bit data is being used everywhere. The internal data is filtered down to 7-bit quite early on in the analog read. To support this, we'd need to port to 14-bit everywhere, and then have a toggle to filter down, as well as update the MIDI output code. It also would necessitate a patch to the editor, so as to ensure that CCs could be matched with pairing 'MSB' CCs correctly. I'm not interested in offering an alternative mode that has hardwired CCs, given the 'regular' mode is editable. I'd welcome PRs to both editor and firmware that approach a solution, though, if someone wants to take it on. |
I've been meaning to ask about appetite for a PR on this and somehow didn't see (or more likely, forgot about) this thread! I have been using this 14-bit branch for a while now main...Dewb:16n:14bitCC It implements fixed CCs (0-31 are always 14-bit, paired according to spec with the Cc number +32 higher), but I can tackle the editor patch as well to make it configurable. Some questions about that:
|
So, I appreciate the editor made things a little harder for hacking/futzing, so let me think out loud to document process:
Here's the other thing: I personally am not convinced 14-bit data is reasonable with the hardware provided. Let me argue with myself:
That said: 10 bits of usable data, scaled up to 14 ( Adding two bytes to the data payload is a reasonable ask there; the editor tweak is a faff but doable. There's also a way I can see to keep some backwards compatibility, but I need to think about that harder. So: I'm actually inclined to explore this now I've argued myself into the two-bit version. I'm also happy to explore in parallel with 16nx. And it might be an opportunity to port the editor to Svelte 5, replace some ungainly stores with runed variables. Interesting. This week I'm jam-packed but it could be a thing we explore. @Dewb , what do you think? |
Awesome! Yes, I'm happy to iterate on this on whatever timeline. I've been sitting on this for a while so no urgency, but lately I'm trying to make an effort to finish & upstream dangling projects like this. I do think we have empirical evidence that the 14-bit data is valuable, despite the limitations of the hardware, from all the Teletype i2c users. I'm one, and I'm pretty happy with it -- you definitely can't reliably hit a specific integer in the 0-16383 range, but it's smoother than 12 bits. (Isn't the Teensy 3.2 DAC 16-bit, with 13 bits usable?) If it's useful for Teletype users I don't see why MIDI users shouldn't also have the option on Teensy hardware. And yes, exactly, even if it's only 10 or 12 bits usable with the RP2040, ten bits is a lot better than seven, and left-shifting to 14 is still appropriate and expected, to map the entire range, even if it jumps in the low bits. The editor backward compatibility issue seems solvable. You've already got a version field in the config struct/type, and if the editor always requests configuration before sending configuration, you could select the appropriate configuration struct and hide/show UI based on what the firmware supports. This of course makes the editor a little more complicated, but that seems inevitable unless the featureset remains static. |
@Dewb You're right, the editor could version features relatively easily - and actually also do stuff per device. We do actually have a config data per device that says what it's capable of, so it's easy to add "supports hi-res output". I'd like to take this on, I think, it's a nice way to refresh the editor code a little. I'm also agreed on the idea that 14-bit output is not about 14-bit adcs, or 14 bits of information; it's about more than 7 bits of information. And I am happy that this can be added with minimal impact to older devices. It's likely the bitmask will be inverse, simply because |
Great! So you'll handle the editor work? I can update my branch with the proposed config struct change and draft a PR. |
Couple of observations now that I've done a pass over the code:
Having said that though, I took a stab at the config support (code here: d7a6d8d), and aside from the high bit problem, this strategy appears to work fine in limited testing (sending sysex from Max to configure.) By adding a check if the sysex message is shorter than expected, I can still use the existing editor to configure everything except the new flags. |
@Dewb thank you! This is looking interesting. I agree on four extra bytes, absolutely fine with that, still fits into memory on a Teensy LC. So this is probably going to take longer to merge in than you'd like, but here's what I propose:
I'll be honest and say I'm quite chocka right now, but also quite enthuisastic as a way into this, and it looks like your PR is in a really good place, so it's something nice to frame the editor against. |
Awesome! Again, no rush. If we get confident in the sysex layout, I could release the 14-bit support in VCV Rack before the editor is finalized (Rack could handle setting the 14-bit flags as requested.) If the editor will keep you busy, I can probably also take a swing at the 16nx firmware changes once I get around to building one. We do need to solve point 2 above though, I should have called that out more clearly. With a 16 bit field we can’t send that over sysex as two bytes; the high bits have to be zero, so it’s currently impossible to set fader 8 or 16 high in the bit field. I see a couple strategies: the bit field could be split into 3 or 4 bytes instead of 2, or the bitfield could remain densely packed in EEPROM and it could be split across twice as many bytes when going in and out over sysex. The latter would be more space efficient, but it would make the sysex de/serialization code more complex. |
Urgh, you're right about the sysex issue - curse the stupid 7-bit spec. I will think on that. |
Another possible solution: there are |
Ah, it looks like MIDI channel is being stored as 1-16, not 0-15, so that only leaves two unused bits. |
Please make it possible to output 14-bit midi over USB.
I don't need NRPN, only the "fine adjustment" allready in the conventional MIDI controller specification, where any of the first 32 controls can be paired with a control offset 32 higher. I found an example here:
fixed CC's are OK for me {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15} paired with {32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47}.
I plan on using it with VCV Rack 2
Cheers,
Jens Peter
Ps: I bought the AtoVproject-Reworked - and asked them too.
The text was updated successfully, but these errors were encountered: