Originally Posted by
beatpete
Randy:
This is very cool! Let us know how it goes and maybe post a pic or two.
BTW, I've constructed a few TouchOsc templates for Cubase but could never figure out how the Mackie Control Protocol deals with track naming on the display. Can you shed any light on this?
Peter
Oh, you don't want to know about the display....
In theory, it's quite simple. SAC sends a sysex command of the form:
F0 00 00 66 14 12 <ofs> <text> F7
where <ofs> is a value in the range 0..112 (56*2) and <text> is the sequence of ASCII characters to write to the display.
The hard part is figuring out what to do with the text when it arrives.
On the C4, I had to extract the text from a single MCU display and spread it around four separate C4 displays. Figuring out which display to write the data to was the hard part.
Here's the code I use to write to the C4 display:
Code:
// writeDisplay:
//
// Writes a string to one of the Mackie C4's four different displays.
//
// display:
// 1..4 specifying the display to change (1 is top display, 4 is bottom).
//
// offset:
// zero-based offset into the specified line on the display.
// Must be in the range 0..111.
//
// Note that character positions 0..55 are the first line of the display and
// character positions 56..111 are the second line of the display.
method mackieC4_t.writeDisplay( display:dword; offset:dword; theString:string );
var
zLen :dword;
c4Buf :byte[256];
begin writeDisplay;
push( eax );
push( ecx );
push( edx );
if( display in 1..4 ) then
thread.enterCriticalSection( this.midiCS );
if( offset > 2*56 ) then
mov( 2*56, offset );
endif;
str.length( theString );
mov( offset, ecx );
add( 2*56, ecx );
if( eax > ecx ) then
mov( ecx, eax );
endif;
mov( eax, zLen );
mov( (type byte display), al );
add( $2f, al );
mov( offset, ecx );
mov( sysex_c, c4Buf[0] );
mov( 0, c4Buf[1] );
mov( 0, c4Buf[2] );
mov( $66, c4Buf[3] );
mov( $17, c4Buf[4] );
mov( al, c4Buf[5] );
mov( cl, c4Buf[6] );
mov( theString, edx );
for( mov( 0, ecx ); ecx < zLen; inc( ecx )) do
mov( [edx+ecx], al );
mov( al, c4Buf[ ecx+7 ]);
endfor;
mov( $f7, c4Buf[ ecx+7] );
add( 8, ecx );
this.sendSysexNoCS( c4Buf, ecx );
thread.leaveCriticalSection( this.midiCS );
endif;
pop( edx );
pop( ecx );
pop( eax );
end writeDisplay;
Connect With Us