MIDIApps icon indicating copy to clipboard operation
MIDIApps copied to clipboard

Add dedicated message type for MIDI Show Control messages

Open spark404 opened this issue 5 years ago • 9 comments

Heya,

I've been using show control for some shows recently and found that MidiMonitor doesn't have a dedicated parser for it. As i'm using it fairly frequently to test and diagnose it proved handy for me to add it. If you are interested in having this in the main distribution i'll happily work with you to get this code into shape for inclusion.

Based on MIDI Show Control 1.1 specification image

Tests included in a new scheme SnoizeMIDITests

spark404 avatar Dec 23 '18 11:12 spark404

Thank you! I’m glad you could add this. I’m busy for the next few days but will take a look when I can.

On Dec 23, 2018, at 4:59 AM, Hugo Trippaers [email protected] wrote:

Heya,

I've been using show control for some shows recently and found that MidiMonitor doesn't have a dedicated parser for it. As i'm using it fairly frequently to test and diagnose it proved handy for me to add it. If you are interested in having this in the main distribution i'll happily work with you to get this code into shape for inclusion.

Based on MIDI Show Control 1.1 specification

Tests included in a new scheme SnoizeMIDITests

You can view, comment on, or merge this pull request online at:

https://github.com/krevis/MIDIApps/pull/67

Commit Summary

Introduce the SMShowControlMessage Move parsers to a utility file and complete the parameter parsing for most common shocwontrol messages Refactor cue item parser to not depend on the 0xF7 marker File Changes

M Frameworks/SnoizeMIDI/SMMessageParser.m (7) A Frameworks/SnoizeMIDI/SMShowControlMessage.h (19) A Frameworks/SnoizeMIDI/SMShowControlMessage.m (308) A Frameworks/SnoizeMIDI/SMShowControlUtilities.h (53) A Frameworks/SnoizeMIDI/SMShowControlUtilities.m (67) A Frameworks/SnoizeMIDI/ShowControlCommandNames.plist (74) M Frameworks/SnoizeMIDI/SnoizeMIDI.xcodeproj/project.pbxproj (215) A Frameworks/SnoizeMIDI/SnoizeMIDITests/Info.plist (22) A Frameworks/SnoizeMIDI/SnoizeMIDITests/SMShowControlMessageTest.m (160) A Frameworks/SnoizeMIDI/SnoizeMIDITests/SMShowControlUtilitiesTest.m (106) Patch Links:

https://github.com/krevis/MIDIApps/pull/67.patch https://github.com/krevis/MIDIApps/pull/67.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

krevis avatar Dec 23 '18 17:12 krevis

Sorry for the delay... holidays, and then I got the usual post-holiday cold.

This generally looks really good. I'd like to tweak a few things:

  • Adding a new message class means that newly created files won't be compatible with older versions of the app, and older files won't show show control messages. I'll see what we can do about that. Perhaps we can just change SMSystemExclusiveMessage to detect when it's a show-control message, and change how it formats itself. May need to cache some things internally.

  • Shouldn't assume anything about the length of the sysex data.There are a few places where you do things like (((Byte *)newData.bytes)[4]), which will crash if newData is too small.

But otherwise this fits in nicely. Thanks for doing all the hard work, especially in such an antique codebase.

I'll take a closer pass over this when I can, and tweak the PR.

krevis avatar Jan 03 '19 06:01 krevis

Hey, happy new year :) Thanks for the feedback. I'll see if i can fix the issue you mentioned on the assumption of data length. I can make some more asserts to check packet length before and while parsing.

spark404 avatar Jan 07 '19 18:01 spark404

Good point about reading old files. I started off doing what you mentioned but later made it into a separate message. If they can be stored as SysEx messages but parsed on the fly as show control it would be compatible right?

spark404 avatar Jan 07 '19 18:01 spark404

If they can be stored as SysEx messages but parsed on the fly as show control it would be compatible right?

Yes, that should work.

krevis avatar Jan 08 '19 05:01 krevis

Finally got a little time to work on this. Pushed a change that does the following:

  • Perhaps we can just change SMSystemExclusiveMessage to detect when it's a show-control message, and change how it formats itself. May need to cache some things internally.

Done.

  • Shouldn't assume anything about the length of the sysex data.There are a few places where you do things like (((Byte *)newData.bytes)[4]), which will crash if newData is too small.

I fixed this in a couple of places, but need to do more.

I haven't really tested it, though -- I don't typically use show control and I don't even know where to start. If you have time, could you send me a MIDI Monitor document with some show control messages in it? What software do you use to generate show control messages?

krevis avatar Jan 21 '19 10:01 krevis

QLab is a good example for an application that uses show control (https://figure53.com/qlab/) - to use for testing it’s completely free and very straight forward to set up.

Sent from my iPhone

On 21 Jan 2019, at 10:15, Kurt Revis [email protected] wrote:

Finally got a little time to work on this. Pushed a change that does the following:

Perhaps we can just change SMSystemExclusiveMessage to detect when it's a show-control message, and change how it formats itself. May need to cache some things internally. Done.

Shouldn't assume anything about the length of the sysex data.There are a few places where you do things like (((Byte *)newData.bytes)[4]), which will crash if newData is too small. I fixed this in a couple of places, but need to do more.

I haven't really tested it, though -- I don't typically use show control and I don't even know where to start. If you have time, could you send me a MIDI Monitor document with some show control messages in it? What software do you use to generate show control messages?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

sammysmallman avatar Jan 21 '19 10:01 sammysmallman

Works like a charm :-)

I've attached a mmon file with a few show control commands in it. And a demo movie of how i generated the commands from QLab.

MSC_examples.zip

spark404 avatar May 05 '20 11:05 spark404

Rebased on latest master / no rebase issues

spark404 avatar May 05 '20 13:05 spark404