lid55
MidiFire Beta
Posts: 75
|
Post by lid55 on Oct 23, 2017 21:09:36 GMT
hi Nic, are delays possible in IF statements?
for example:
IF M0 == C5 00 SND B1 02 +D2000 END
- if i’m using an Event Monitor block, it displays the B1 02 message immediately, though the event visualization flashes about 2 sec later, as expected. I’m just testing this remotely, only with MidiFire, creating code for use with my system later when I get home. So is it just a limitation/bug of the Event Monitor, that it does not show exactly what MidiFire will output?
or for this kind of thing are the timing variables better?
Regards, - Brett
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 24, 2017 10:23:14 GMT
Hi lid55, The way the delay flag +D works is that the delay applies only to when the event leaves the MidiFire app because event delays are handled by CoreMIDI rather than MidiFire itself for performance reasons. Internally, the event is pushed immediately through to the next block (although, the flashing of the event is delayed as you note, because that is on a different thread), so delayed events will appear in an Event Monitor immediately even though they will be delayed by CoreMIDI. If you want to delay an event internally, there are really two options I can think of: 1. Use the CoreMIDI network port configured in loopback mode (you'll need MidiBridge to do this, although MidiFire will be getting this feature on the next update). You would send the delayed event to the network output port where it would be delayed by CoreMIDI and then presented back into MidiFire on the network input. This is definitely a kludge and won't be of much use if you are using the network ports for other purposes. 2. I change MidiFire to manually abort/delay/resume routing of delayed events being sent to connected modules instead of using CoreMIDI. If you think number 2 is something you're really going to need, then maybe add a post about this to the Suggestion Box and I will see what I can do. For now, you can try the workaround (number 1) or just be aware that delayed events will appear in the Event Monitor immediately but are delayed when sent on to a destination. Regards, Nic.
|
|
lid55
MidiFire Beta
Posts: 75
|
Post by lid55 on Oct 24, 2017 18:35:41 GMT
Thanks for the thorough clarification nic, that really does make sense now.
As far as what I’m using this Event Monitor setup for, which is basically just figuring out how MidiFire works, it’s not really so important that the situation #2 you outlined above is necessary (though I was reflecting that situation #2 WOULD be a more intuitive UI for future learners of MidiFire). The workaround described in situation #1 will be adequate for my purposes, so I’ll wait for that (I’ve already upgraded to iOS 11.3, so MidiBridge is no longer an option)
While we’re on the issue though, I was wondering: are there any other tags or messages sent directly to CoreMIDI, and therefore not real-time on Event Monitors? I’m guessing from what you mentioned earlier, the +H(old) tag maybe, and maybe the Timer Variables, since they have to do with timing issues?
Regards - Brett
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 26, 2017 11:21:44 GMT
Hi lid55, Only the +D flag uses CoreMIDI to do its stuff. The +H flag from MidiBridge isn't in MidiFire (waiting until someone says they really want this!). Can't think of anything else like the +D'd events. Regards, Nic.
|
|
lid55
MidiFire Beta
Posts: 75
|
Post by lid55 on Oct 26, 2017 13:38:47 GMT
Ah I see... thanks for the clarification. So far... I haven't been using the +H in MidiBridge because my MIDI foot controller has this feature and I'd rather deal with it "at the source" ... but I do use this feature all the time (through the foot controller I mean).
Correct me if I'm wrong, but I think I've come across another potential CoreMIDI element. In my remote testing (I have the luxury, at times, to work on MidiFire "code" while I'm at work), I've been trying to use delayed IF LOAD > SND messages as sort of "mock up" triggers (i.e. to emulate my MIDI foot controller triggers at home)... and I've noticed that I can't +D the MIDI Clock PLAY (hex = FA) and STOP (hex = FC) type messages that control MidiFire's Dynamic Clock. So I'm assuming the Clock signal is dealt with via CoreMIDI and is not routed through MidiFire blocks in the same way as standard MIDI messages (CC, PC, and Note messages)?
Anyways, I'll keep testing... I realize if you have to respond too much to these forum posts, you won't have any time to update MidiFire!
- Brett
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 26, 2017 13:44:59 GMT
Hi lid55, Like the Event Monitor (indeed any internal module) the +D will have no effect until the event leaves MidiFire. So, yes, the clock start/stop messages will hit the clock immediately since it's taking an internal path. Regards, Nic.
|
|
lid55
MidiFire Beta
Posts: 75
|
Post by lid55 on Oct 28, 2017 15:53:37 GMT
Oh yeah, that makes sense now, thanks.
- Brett
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 28, 2017 15:57:49 GMT
Hi lid55 , Just for completeness, I have just realised that the SND rule with the +I flag set (inject) *will* honour any delay flag set even though it is routed internally. Regards, Nic.
|
|
lid55
MidiFire Beta
Posts: 75
|
Post by lid55 on Oct 28, 2017 17:58:00 GMT
Hi nic, I'm not sure if I'm setting this improperly or what, but I couldn't get it to work.
My rules in a Stream Byter block sent to a Dynamic Clock block:
IF LOAD SND FA +I +D4000 SND FC +I +D8000 END
(I end up with "no events")
-Brett
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 28, 2017 18:08:07 GMT
Hi lid55, +I inside if/load will inject the event into the 'MidiFire' input port. Drop it onto the canvas and connect to the clock module and they should show up. Regards, Nic.
|
|
lid55
MidiFire Beta
Posts: 75
|
Post by lid55 on Oct 28, 2017 20:34:20 GMT
Awesome, it works! Now I can test StreamByter rulesets, emulating my foot controller setup but only using my iPhone... thanks nic
|
|