jtackaberry / reaticulate

An articulation management system for REAPER
Other
101 stars 46 forks source link

O=note shoots a note twice, and can't output two notes #20

Closed avlearning closed 6 years ago

avlearning commented 6 years ago

I seem to be getting an issue where I want to use Berlin Woodwinds and with Inspector I had a keyswitch for the patch with no vibrato in Capsule, and I would then route it with a JS note filter and mapper to also trigger another keyswitch at the same time - allowing me to crossfade between the no vib and molto vib patches.

image

When I try the same with Reaticulate, it seems to shoot two notes of the keyswitch, because in Capsule I see 4 patches now loaded for crossfading image which is something I can't replicate by manually keyswitching on my keyboard - I guess it has to be fast. Also, after that, once I swtich to another articulation, it puts it at the end of the 4-selection chain. image

And the first three notes seem to be hanging - playing and pausing resets the whole thing and selecting another articulation after the reset works fine - UNLESS it's the Legato articulation (which should trigger another one.)

I realized that Reaticulate could have a built in solution for this by allowing me to trigger two notes, but o=note24/note:25 doesn't seem to be working - it only triggers the last one. Are they shot at the same time/playing back at the same time?

There's a workaround for my situation, but it'd be great if I could have it this way.

avlearning commented 6 years ago

UPDATE: This probably confirms that it shoots two notes: Using JS MIDI Duplicate Note Filter solves the double double image

But the problem with these two notes hanging still persists.

jtackaberry commented 6 years ago

Can you insert a ReaControlMIDI in between Reaticulate and Kontakt and use the log panel to verify exactly what Reaticulate is sending to Kontakt, for both the single note case, and the double note case (e.g. o=note24/note:25)? This will help quite a lot with troubleshooting. :)

jtackaberry commented 6 years ago

Oh, and also provide the full bank file you're using?

avlearning commented 6 years ago

Wow, I never realized ReaControlMIDI had that option. Fantastic. God, I love Reaper.

For every articulation it's this image

And after the Note reroute it's this for the LEGATO image

After the Duplicate note filter it's this for the LEGATO which goes to the reroute image

But it's the same for all other articulations - still double notes, even though they go through the duplicate filter. However, the two legato notes that come out of the rerouter seem to be hanging as clicking the articulation again does nothing, but it'll send once after I play and pause.

EDIT: Here's the FULL bank file reaticulate.txt

avlearning commented 6 years ago

And here's with image

It sends image But this time BWW only receives the last one image

blawler commented 6 years ago

I would like to see this feature implemented as well. I am having a similar issue in Palette for Kontakt where I want to use combined articulations (staccato+tenuto) The note-hold command still invokes a note-off MIDI event just before the next output action. I need it to simulate holding two keys down at the same time. If the last "note-hold" sent it's note off event AFTER THE NEXT "note" command sent a note on event, it would work for me. Would that screw it up for other applications?

Great utility BTW- thank you. I have my articulation library "finished" for Red Room Audio / Palette with BrushPack 1, except for these "custom articulations" that I would like to add.

EDIT - It has been a LONG time since I wrote any code, so forgive me if I am way off base. It looks like you are just tracking the last (single) held note per channel/group, correct? I fiddled with your code and got the result I wanted as far as activating multiple keyswitch events, but it looked like I could only get a note-off event for the last key pressed.

// Array to track active held note-based keyswitches (for note-off // deferral), indexed by source MIDI channel and group. LSB of value contains // the note number, and next 16-bits contains the dstchannels bitmap. A value // of 0 means no keyswitch is held. held_keyswitches = 20100; // size: 16 * NUM_GROUPS = 64

Here is where I did my surgery. I just struck the send_deferred_note_off. I think "past you" was on my wavelength :)

(output_type == OUTPUT_TYPE_NOTE_HOLD) ? (
    off_program = get_articulation_off_program(articulation);
    (program != off_program || off_program > 127) ? (
        // Past me: FIXME: should we really merge dstchannel into existing channels?
        //     No, need to support multiple held keyswitches per source channel.
        // Future me: sure sounds like past me knew what he was talking about.
        //     Unfortunately future me seems to have gotten dumber.  Will keep
        //     the comment around until I figure out what I was on about, because
        //     AFAICT we're ok: we're tracking held keyswitches per group per channel.
        held_keyswitches[4 * channel + group] = param1 | ((1 << dstchannel) << 8);
        midisend(mpos, MIDI_EVENT_NOTE_ON + dstchannel, param1, param2 ? param2 : 127);
    ) : (
        held_keyswitches[4 * channel + group] = 0;
    );
);
jtackaberry commented 6 years ago

Ah, yes, thank you for helping me make sense of "past me." I believe this is indeed exactly the thing I had intended. Future me misinterpreted the "multiple held keyswitches" comment to refer to a held note per group, but in fact the "past me" comment was added before I introduced groups into the code.

Fixing this will require a lot more work than just removing send_deferred_note_off() which, as you've done it, will undoubtedly end up with stuck notes (i.e. a note-on that never receives a note-off). Minimally I'll have to expand held_keyswitches to track multiple notes per channel per group, and then make emit_output_event() a bit cleverer.

@aaronventure can you confirm this is what you had intended when you originally opened the issue, i.e. that given two note output events, both note-on events should be sent before either of the note-off events, simulating both notes being pressed at the same time?

avlearning commented 6 years ago

@jtackaberry Yes. I'm sorry if I wasn't clear on that.

It still triggers both articulations (although twice) for Berlin Woodwinds the way it is right now, but these two notes would then seem to hang.

Were you able to confirm or recreate the double note issue?

blawler commented 6 years ago

@jtackaberry Yep, you understand completely. By dropping the note off from the note-hold routine I have to hit the individual articulations (note events) to close the "hangers". Thanks for looking into it!

Just read your post on another forum (Reaper?) considering note_pin. Good idea. Leaves note_hold with current functionality.

jtackaberry commented 6 years ago

Related to #26 (which talks about note-hold) which I consider to be more a bug whereas this more a feature. Still, I intend to solve them both at the same time as they involve the same area of the code.