Hung notes with the 'offer' object

Tom Law's icon

Does anybody here use the 'offer' object?   I've spent the last week trying to get it keep track of my noteoffs as I modify the pitch of incoming MIDI notes, but I still end up with frequent hung notes.   

For one thing, the offer object doesn't seem to delete the pairs as I retrieve them.   
Also, is there any way to view the stored pairs of numbers it's holding?   I know that a 'bang' will cause it to print all the 'y' numbers, but I'd like to see all the *pairs*.

Here's the patch I've been working on, in case anyone is willing to look it over:

offer-hungnotes.maxpat
Max Patch

I could well be going about this all wrong, and I'm open to any ideas/suggestions/criticism!
Thanks!

Tom Law's icon

(or if somebody could just point me to a patch where the offer object is actually used to handle noteoffs, that'd be great too!)

Mark's icon

sorry, i don't know about [offer], but i had used [midiflush] to get rid of hanging notes:
https://docs.cycling74.com/max5/refpages/max-ref/midiflush.html

Tom Law's icon

Thanks, but I'm really hoping to get [offer] working like the reference guide says it's supposed to. i.e. if I hold a note for 2.5 seconds and then release it, the note I create in Max will do the same thing. (And if other notes overlap with it, they'll retain their durations as well. And so on.)

Mark's icon
Bill 2's icon

Tom, I've modified my "transpose" abstraction for you, hopefully without adding mistakes in the process. It's been rock solid for me.

Max Patch
Copy patch and select New From Clipboard in Max.

Tom Law's icon

Yes, thanks so much! That first one seems to do what I'm looking for... now I just need to study it and see how it works.
(I'm still learning how to search the forums... what criteria did you use to locate those threads? Is there a way to search specifically for Max patches that use a certain object? That'd sure be handy.)

Bill 2's icon

PS: AFAIK there's no way to see the stored pairs.

Mark's icon

what criteria did you use to locate those threads?

[offer]
instead of
offer
which mostly had results about job-offers, hehe

Tom Law's icon

offer]
instead of
offer
which mostly had results about job-offers, hehe

Great tip, Mark! Thanks for the help!

Tom Law's icon

I've modified my "transpose" abstraction for you

Bill, thanks so much! I can't look at it right now, but I'm definitely going to study it later on tonight. Really do appreciate this! (I'd seen some other postings from you about this object, and was thinking you might be a good source of info...)

Tom Law's icon

OK, Bill, thanks again! I studied your patch... I had to relearn what the solitary [==] does, and what the [t] object does... very handy things to know. Anyway, your solution is way more elegant than mine. (And besides that, it works!)