Author |
Topic: Capturing to .syx file (Read 1714 times) |
|
rgonzale
New Member

 MIDI-OX Rules!
Posts: 3
|
 |
Capturing to .syx file
« on: Oct 1st, 2005, 6:35am » |
Quote Modify
|
Hi, is there a way with the COM interface to capture sysex data and save to a binary .syx file? GetSysExInput() apparently gets an ASCII string but I don't think this can be used to write a binary .syx file? Thanks, Ralph
|
|
IP Logged |
|
|
|
Jamie OConnell
Administrator
    


Gender: 
Posts: 2027
|
 |
Re: Capturing to .syx file
« Reply #1 on: Oct 2nd, 2005, 3:32pm » |
Quote Modify
|
Using COM, you'd have to convert the ascii to binary while writing your own binary file.
|
|
IP Logged |
--Jamie Music is its own reward.
|
|
|
rgonzale
New Member

 MIDI-OX Rules!
Posts: 3
|
 |
Re: Capturing to .syx file
« Reply #2 on: Oct 5th, 2005, 8:13am » |
Quote Modify
|
Thanks for the answer Jamie. Forgive my denseness, but how would I convert the ascii to binary? IE is the ascii that midiox returns simply a per-byte coding or something? I'd like to do this from Perl... Thanks, Ralph
|
|
IP Logged |
|
|
|
rgonzale
New Member

 MIDI-OX Rules!
Posts: 3
|
 |
Re: Capturing to .syx file
« Reply #3 on: Oct 9th, 2005, 4:15pm » |
Quote Modify
|
To answer my own sort of naive question, here is perl code to receive sysex and write to a binary .syx file. This uses Perl/Tk gui: Code: eval { require Win32::OLE; import Win32::OLE }; my $haveWin32 = !$@ && ($^O eq "MSWin32"); my $mox=($haveWin32 ? Win32::OLE->new('MIDIOX.MOXScript.1') : undef); ... my @syx; my $start=time(); while ( !$cancelSoon && scalar(@syx)<400 && time() < $start+30) { $win->update(); if ($mox->GetMidiInput()) { push @syx, (split /\s+/, $mox->GetSysExInput()) } } ... binmode OUT; # to prevent CR->CR/LF foreach my $h (@syx) { print OUT pack("H2", $h) } |
|
|
« Last Edit: Oct 11th, 2005, 5:43am by rgonzale » |
IP Logged |
|
|
|
|