User Forum    :: Powered by YaBB
  « MIDI-OX User Forum - Capturing to .syx file »
Welcome, Guest. Please Login or Register.
May 9th, 2025, 8:48am


Home Home Help Help Search Search Members Members Login Login Register Register


   MIDI-OX User Forum
   MIDI-OX
   Scripting Questions
(Moderator: Jamie OConnell)
   Capturing to .syx file
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   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 Quote Modify 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
*****






   
WWW Email

Gender: male
Posts: 2027
Re: Capturing to .syx file
« Reply #1 on: Oct 2nd, 2005, 3:32pm »
Quote Quote Modify 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 Quote Modify 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 Quote Modify 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
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »


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