MIDI-OX User Forum (http://www.midiox.com/cgi-bin/yabb/YaBB.pl)
MIDI-OX >> Mapping Questions >> map file spec
(Message started by: haydxn on Apr 14th, 2005, 10:10am)

Title: map file spec
Post by haydxn on Apr 14th, 2005, 10:10am
hi there,

i've been working on mapping the mackie MCU spec to allow us less fortunate types to use any controller with Tracktion or other MCU compatible hosts.

however, making a general map and saying "edit this for your controller" is a little less helpful than i'd like to be, so i wish to write an app that can create a map with MIDI learn for the various MCU function commands.

therefore, i'd like to be able to generate the map files from outside MIDIOX, to be imported. the map editor is way too fiddly for an average user following a tutorial to remap a whole set of commands, especially as there's no way of labelling the map elements (which would be a great feature, btw).

would it be possible to have an overview of the file spec so that i can read/write/generate these files externally?

Title: Re: map file spec
Post by Jamie OConnell on Apr 19th, 2005, 2:17pm
Your best bet would be to write to the text based map format, .TXM.  A commented example is installed with MIDI-OX in the Map folder.  Look for Example.txm.

Here is the text of it:


MOXMAP Version 5

;  Any line beginning with a ';' is a comment, and will be ignored.
;  If you overwrite a map using MIDI-OX Translation Map [Save...], any
;  existing comments will be overwritten and discarded;

;  The Header and version# are mandatory.  
;  Currently the header is: 'MOXMAP Version 5'

;  Sections are enclosed in square backets ([]) on a line by themselves.
;  Any lines follwing a Section designator belong to that section.
;  Currently there are 2 sections: [Map] and [Options].

[Map]
;  Each line in the Map section defines a mapping step in the Data Map.
;  The only type that is very different is when mapping to a SysEx string.
;  See the last line in the [Map] section for an example.

;  Basically the format is:
;  SrcChan,SrcMsg,SrcV1Min,SrcV1Max,SrcV2Min,SrcV1Max,Clone(Y/N),TrgChan,TrgMsg,TrgV1Min,TrgV1Max,TrgV2Min,TrgV1Max
;  In addtion, if the "Use Input Value 1" flag should be set, the line should have ",>" tagged on.
;  Similarly, if "Use Input Value 2" flag should be set, the line should have ",<" tagged on.
; Example Mapping steps:

*,NoteOn,36,84,1,127,Y,0,*,NRPN,656,656,0,16383,>
*,NoteOn,36,84,*,*,N,0,*,*,*,*,*,*
*,Ctrl,1,1,0,127,N,0,*,NRPN,160,160,0,16256
*,NoteOn,36,84,1,127,Y,0,*,NRPN,656,656,0,16383,>,<
*,NoteOn,36,84,*,*,N,0,*,*,*,*,*,*
*,Ctrl,1,1,0,127,N,0,*,NRPN,160,160,0,16256
1,Ctrl,64,64,64,127,N,0,*,SysEx,F0 7E 7F 09 01 F7

; The format for mapping to SysEx is:
; SrcChan,SrcMsg,SrcV1Min,SrcV1Max,SrcV2Min,SrcV1Max,Clone(Y/N),*,SysEx,F0 XX XX XX ... F7
; In other words, the SysEx string is tacked on to the end of the message -- directly following "SysEx,".

; NOTES
; Channel: ranges from 1 - 16 (or *)
; Message Names: NoteOff, NoteOn, KeyAft, Ctrl, ProgChg, ChanAft, PitchB, NRPN, SysEx, Discard, or *
; Clone: Y or N
; Use Input Value 1: >
; Use Input Value 2: <
; Most Values: 0 - 127
; NRPN Numbers and Values: 0 - 16383

; Items must be seperated by commas (except the SysEx string). It's OK to insert spaces (example: 1, 2 , 3,4).
; In general, names and characters are case insensitive ('sysex' is the same as 'SysEx').
; If you're ever unsure how something might be specified, try entering it in the MIDI-OX Translation Map
; and then [Save...] it as an MIDIOX ASCII Text File (.txm).  Then open it in Notepad to see how it's
; specified.

[Options]
; Options are optional.  When specified, they cause the corresponding
; map level flag to be set to the value (0=off or 1=on).

; Following are the currently defined flags:
WaitForFullNRPN=0
MapNRPNDataIncr=1
SendFullNRPN=0
ReverseDataEntry=0

Title: Re: map file spec
Post by Larry Salomon Jr. on Jun 1st, 2005, 3:34pm
Jamie,

In the comments in your posting, it says that the parameter immediately following the Clone(Y/N) parameter is the Target Channel.

However in the sample data, there is an intermediary "0" specified.  What does that correspond to?

Title: Re: map file spec
Post by Jamie OConnell on Jun 1st, 2005, 6:02pm
Good catch.  The comment notes need to be brought up to date: Version 5 of Data Mapping added an optional Delay parameter.  By default there is no delay (0).

Title: Re: map file spec
Post by Larry Salomon Jr. on Jun 2nd, 2005, 11:28am

on 06/01/05 at 18:02:08, Jamie OConnell wrote:
Good catch.  The comment notes need to be brought up to date: Version 5 of Data Mapping added an optional Delay parameter.  By default there is no delay (0).


The delay value is specified in msecs?

Title: Re: map file spec
Post by Jamie OConnell on Jun 2nd, 2005, 12:05pm
Yes - Milliseconds.  When a delay is specified (> 0) the data is not transmitted immediately after being received, but is queued and a timer event is set to send it later.

Title: Re: map file spec
Post by Larry Salomon Jr. on Jun 2nd, 2005, 1:31pm
Since I'm at work and don't have MIDI-OX installed here, I don't have the manual either.

Does the rest of the Data Map processing get delayed as well while the delay plays itself out?  Or is it an asynchronous operation, i.e. the delay timer is set and the rest of the Data Map is processed?  If the timer pops in the middle of the rest of the processing, it's up to the map author to deal with it?

I'm curious what uses the delay has in real-world settings.

Title: Re: map file spec
Post by Jamie OConnell on Jun 3rd, 2005, 2:40pm
The delay applies only to the event mapping that specifies a delay.  Any other mapping lines are processed immediately.  An author needn't be concerned about the operation at all: any delayed events are placed in a separate queue and sent when the high resolution timer triggers.

Possible uses include delaying Note Offs to make a Legato effect, delaying drum machine Note Offs to make zero length durations trigger on plug-ins that can't handle zero length durations, delaying controllers for various purposes.  In any case, it was an often requested feature a few years ago.



MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.