-
Notifications
You must be signed in to change notification settings - Fork 259
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
Active sensingv2 #155
base: master
Are you sure you want to change the base?
Active sensingv2 #155
Conversation
reworked ActiveSensing using input from a variety of device MIDI Implementation manuals (Roland, KORG, Yamaha) found on the internet. Receiving ActiveSensing: Once an Active Sensing message is received, the unit will begin monitoring the intervalbetween all subsequent messages. If there is an interval of ActiveSensingPeriodicity ms or longer betweenmessages while monitoring is active, the same processing as when All Sound Off, All Notes Off,and Reset All Controllers messages are received will be carried out. The unit will then stopmonitoring the message interval. Sending ActiveSensing: send x ms after the last sent command
Good reading on Active Sensing Another reading on impact of Active Sensing (in Dutch)
Translated with www.DeepL.com/Translator (free version) |
The terminology for timeouts could be improved, it's not an error but a valid event of the lifetime of the MIDI stream. An error would be if something unparsable or very much unexpected happened, like one of the few unreachable places in the parser. |
I kinda agree, the naming for the handler arduino_midi_library/src/midi_Defs.h Line 64 in ff3052c
to Also the Exception-bits should be in an enum.... |
Could it be its own event ? void onActiveSensingTimeout()
{
// Loss of MIDI activity detected
}
MIDI.handleActiveSensingTimeout(onActiveSensingTimeout) This would make it opt-in and avoid writing additional code to figure out the type of error or exception in a generic handler. |
Just implemented the 'having it's own handler' and its memory neutral (balanced the additional bit checking code calling the error handler) |
How do we call this thing?
or
... |
I'd go for active, |
removed ErrorActiveSensingTimeout
return mReceiverActiveSensingActive in SensingTimeout Handler: - true when all is OK and active sensing is received on time - false when active sensing is **not** received on tome
Active Sensing tested (both receiver and sending) |
@franky47 This has been out for a while (a reworked and optimized version of the current ActiveSensing), is this something to be considered for the next update? |
Yes we can include this in the next release. |
Active Sensing
2 types of Active Sensing, receiving and sensing of Active Sensing. Work has been based on re-reading literature and online MIDI implementation manuals from various manufacturars.
receiving Active Sensing
Once an Active Sensing message is received, the unit will begin monitoring the interval between all subsequent messages. If there is an interval of Settings::ReceiverActiveSensingTimeout ms or longer between messages while monitoring is active, the
ErrorActiveSensingTimeout
flag is set and the Error callback is called. It is up to the application to stop All Notes. The unit will then stop monitoring the message interval.Turn on receiving Active Sensing using the overwritten
UseReceiverActiveSensing
in SettingsSending Active Sensing
ActiveSensing is send
Settings::ActiveSensingPeriodicity
ms after the last commandTurn on sending Active Sensing using the overwritten
UseSenderActiveSensing
in SettingsNote:
Both
UseReceiverActiveSensing
andUseSenderActiveSensing
can't be set to true, it's one or the other.Serial Settings Example (Hairless MIDI)
Add Hairless example (but currently unrest as hairless is not supported on MaxOS Catalina 64bit)