Skip to content
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

updated MIDI input handling and user interface. added features and fixed a couple issues #113

Open
wants to merge 7 commits into
base: phazerville
Choose a base branch
from

Conversation

beau-seidon
Copy link

@beau-seidon beau-seidon commented Dec 30, 2024

MIDI note and velocity input is now buffered to facilitate legato playing, and polyphony.
Notes are remembered in the order played, limited only by free memory.

Fixes #32

The following new output modes are added:

Note1, Note2, Note3, Note4:
V/Oct CV from the 4 most recent notes can be sent to individual outputs.
When less than 4 notes are played, notes are distributed somewhat evenly.
Eg., when only 2 notes are held, outputs 1 and 3 play the newer note, outputs 2 and 4 play the older note.

LoNote, HiNote:
V/Oct corresponding to the lowest and highest held note, pretty simple.

PdlNote:
V/Oct corresponding to the "pedal" note, or the earliest played note. If this note is released, the next earliest is played.
Useful as a drone over which other notes can be performed from a 2nd output.

InvNote:
V/Oct output corresponding to an "inverted" keyboard. High keys play low notes, and low keys play high notes.
(127 - MidiNote)

Trig1st:
Same as Trig, but only triggers on the 1st played note. Useful for interesting 1-shot effects.

TrgAlws:
Same as Trig, but also triggers when notes are released.

GateInv:
Same as Gate, but high with no notes held, and low when notes are held.
Tip: Try setting 2 outputs as Gate and GateInv respectively, then trigger 2 different voices in stereo.

Veloc1, Veloc2, Veloc3, Veloc4:
Outputs the velocity from the last 4 played notes.

Applet UI has been updated to allow more characters, and to fix the overlap issue with the right hemisphere activity monitor icon in MIDIOut. MIDIIn now monitors MIDI activity per ADC channel.
Logging has been updated to prevent duplicate note entries on the same MIDI channel.

I think some of the stuff at the bottom of HSIOFrame.h is showing changed because of the whitespace differences.

@beau-seidon
Copy link
Author

things i haven't tested thoroughly:

  • NoteStackClear(), triggered by usbMIDI.Stop
  • midi input passed to other applets on the back-end

@beau-seidon
Copy link
Author

beau-seidon commented Dec 30, 2024

i also intend to attempt the per-channel activity monitor icon in my next commit, so don't merge just yet
EDIT: done

@beau-seidon
Copy link
Author

beau-seidon commented Dec 30, 2024

ALSO, one thing I still don't like is that the new modes I put in are separate in the list from the others of the same type.
By that I mean the new trigger and gate modes are at the end of the list instead of up near the original Trig and Gate modes, etc.
But I'm worried that if I start shuffling things around in the MIDIFunctions enum that I'll break things that worked before i started rummaging around.

EDIT: rearranged and tested, all good. i like it better how i have it now, but i'm not the only one who uses the thing. also i didn't rename HEM_MIDI_NOTE_OUT in the enum because it is used by other things i didn't modify.

@djphazer
Copy link
Owner

Haha no worries, we'll let this one cook for a while. I was going to say, we don't need the old "Note#" output mode if it's identical to the new "Poly1" mode... I'd probably just rename those to "Note1", "Note2", etc.

If you reorder the enum, I think you just have to reorder the string labels as well... everything else should make safe assumptions, using switch statements, etc.

@beau-seidon
Copy link
Author

beau-seidon commented Dec 30, 2024

updated to include per channel monitoring, and fixed the mode list. let me know what you think of the updated applet!
i think i'm done with it for now, unless there are bugs

EDIT: nope, i think ill add the poly velocity afterall.

@beau-seidon
Copy link
Author

ok, added polyphonic velocity. its fun.
also fixed a graphical boo boo, and improved Note3-off behavior.

i'm done. do whatever you want with it. :)

@djphazer
Copy link
Owner

Excellent! We'll give this some testing to put it through its paces... I briefly tried out Note1 and Note2 with two different voices, and it seems solid!

For the sake of tidiness, I'd prefer to have this rebased against the main branch (drop the merge commit) and maybe squashed into fewer commits if possible... something like git rebase -i phazerville to rewrite the history, and then force-push to your feature branch after cleanup.

@beau-seidon
Copy link
Author

I'll give it a shot! i always seem to screw up a rebase tho. i suck at git. the only reason i can do any of it properly is the Source Control extension for VSCode. we'll see what happens.

do you want just a few major ones, without all the piddly "fixed a bug from last commit" stuff, or just squash the whole damn thing?

@djphazer
Copy link
Owner

Oh nooo, we're gonna have to get you acquainted with git in a terminal...
You could squash the whole thing into one, with notes in the commit message. But yeah, we don't need all the little fixups, just the high-level atomic feature!

@beau-seidon
Copy link
Author

im trying this one in a terminal. gotta saw off the training wheels.

@beau-seidon
Copy link
Author

git rebase -i opened in vim and now im mad at you.

added note buffer to improve playability

stuck velocity bug fixed, and code clean-up

note buffer is now a std::vector for simplicty and memory conservation.
might have broken note-off logging

fixed logging bug from last commit, also now prevents duplicate log entries.
moved some stuff around for readability
hMIDIIn polyphonic cv output working! saving broken...

updated polyphonic note priority. saving still broken

fixed polyphonic note-off bug

saving is fixed! thanks djphazer
added more note out functions, and improved code readability

adjusted ClockSetup SLIDEOUT_TIME

more gate and trig features. updated UI for more characters
added midi input monitoring per ADC channel, with midi channel filtering

updated labels and order of midi functions

added "polyphonic" velocity output
also fixed note-off poly3 behavior and activity icon overlap with log view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MidiIn - Polyphonic Note# may need further tweaking?
2 participants