in reply to Re: Create MIDI With Random Tracks
in thread Create MIDI With Random Tracks

Sounds like a job for Dump MIDI as Perl Code! Can you run that snippet with random.mid and post the output here?

Replies are listed 'Best First'.
Re: Re: Re: Create MIDI With Random Tracks
by zentara (Cardinal) on Feb 18, 2003 at 15:59 UTC
    mididump random.mid MIDI::Opus->new({ 'format' => 0, 'ticks' => 96, 'tracks' => [ # 4 tracks... # Track #0 ... MIDI::Track->new({ 'type' => 'MTrk', 'data' => "\x00\xff\x01\x11Random MIDI Music\x00\xff/\x00", 'events' => [ # 0 events. ] }), # Track #1 ... MIDI::Track->new({ 'type' => 'MTrk', 'data' => "\x00\xc1N\x00\x910{\x00-{\x81j\x810{\x81j-{\x81j\x91I +{\x81jI{\x81jI{\x82\ x07\x81I{\x82\x07I{\x82\x07I{\x82\x07\x91S{\x82\x07S{\x82\x07S{\x82z\x +81S{\x82zS{\x82zS{\x 82z\x91\x1d{\x82z\x24{\x82z\x1a{\x83O\x81\x1d{\x83O\x24{\x83O\x1a{\x83 +O\x91K{\x83OU{\x85\x 25\x81K{\x85\x25U{\x85\x25\x91W{\x85\x25P{\x85\x25P{\x85\x25S{\x87I\x8 +1W{\x87IP{\x87IP{\x8 7IS{\x87I\x91Z{\x87IS{\x87IP{\x88c\x81Z{\x88cS{\x88cP{\x88c\x91\x5c{\x +88cU{\x88c_{\x88cX{\ x89_\x81\x5c{\x89_U{\x89__{\x89_X{\x89_\x91;{\x89_>{\x89_E{\x89_E{\x8a +3\x81;{\x8a3>{\x8a3E {\x8a3E{\x8a3\x91\x11{\x8c\x25\x81\x11{\x8c\x25\x91\x1f{\x8c\x25#{\x8d +\x04\x81\x1f{\x8d\x0 4#{\x8d\x04\x91*{\x8d\x04 {\x8d\x04#{\x8d\x04'{\x8e]\x81*{\x8e] {\x8e] +#{\x8e]'{\x00\xff/\x 00", 'events' => [ # 0 events. ] }), # Track #2 ... MIDI::Track->new({ 'type' => 'MTrk', 'data' => "\x00\xc2\x0c\x00\x92)X\x00)X\x003X\x00,Xn\x82)Xn)Xn3X +n,Xn\x92\x02Xn\x02Xn \x09Xn\x06X\x82:\x82\x02X\x82:\x02X\x82:\x09X\x82:\x06X\x82:\x92SX\x82 +:SX\x82:WX\x82:ZX\x8 3S\x82SX\x83SSX\x83SWX\x83SZX\x83S\x92ZX\x83SPX\x83SPX\x85\x13\x82ZX\x +85\x13PX\x85\x13PX\x 85\x13\x92PX\x85\x13SX\x85\x13ZX\x85\x13WX\x85^\x82PX\x85^SX\x85^ZX\x8 +5^WX\x85^\x92WX\x86\ x25\x82WX\x86\x25\x92PX\x86\x25ZX\x86\x25SX\x86\x25ZX\x86|\x82PX\x86|Z +X\x86|SX\x86|ZX\x86| \x928X\x87*\x828X\x87*\x92ZX\x87*WX\x87*SX\x87*PX\x88c\x82ZX\x88cWX\x8 +8cSX\x88cPX\x88c\x92 ZX\x88cZX\x88cWX\x88cWX\x8aG\x82ZX\x8aGZX\x8aGWX\x8aGWX\x8aG\x92PX\x8c +\x06\x82PX\x8c\x06\x 92SX\x8c\x06ZX\x8c\x06PX\x8e\x19\x82SX\x8e\x19ZX\x8e\x19PX\x8e\x19\x92 +PX\x8e\x19SX\x8fK\x8 2PX\x8fKSX\x00\xff/\x00", 'events' => [ # 0 events. ] }), # Track #3 ... MIDI::Track->new({ 'type' => 'MTrk', 'data' => "\x00\xc3s\x00\x93PA\x00ZA\x82\x0b\x83PA\x82\x0bZA\x82 +\x0b\x93NA\x840\x83N A\x840\x93WA\x840SA\x840WA\x86<\x83WA\x86<SA\x86<WA\x86<\x93\x04A\x86< +\x01A\x86<\x04A\x86< \x04A\x87\x00\x83\x04A\x87\x00\x01A\x87\x00\x04A\x87\x00\x04A\x87\x00\ +x935A\x89\x15\x835A\ x89\x15\x933A\x89\x15=A\x89\x153A\x89\x153A\x8b\x07\x833A\x8b\x07=A\x8 +b\x073A\x8b\x073A\x8 b\x07\x93BA\x8b\x07BA\x8cn\x83BA\x8cnBA\x8cn\x93+A\x8cn!A\x8cn\x24A\x8 +f\x02\x83+A\x8f\x02! A\x8f\x02\x24A\x8f\x02\x93ZA\x8f\x02WA\x8f\x02PA\x8f\x02WA\x90d\x83ZA\ +x90dWA\x90dPA\x90dWA \x90d\x93PA\x90dPA\x90dWA\x92(\x83PA\x92(PA\x92(WA\x92(\x93\x17A\x92(\ +x14A\x93\x00\x83\x17 A\x93\x00\x14A\x93\x00\x93\x06A\x93\x00\x06A\x94O\x83\x06A\x94O\x06A\x +94O\x93\x19A\x94O\x1 2A\x94O\x15A\x94O\x1cA\x96\x03\x83\x19A\x96\x03\x12A\x96\x03\x15A\x96\ +x03\x1cA\x96\x03\x93 WA\x96R\x83WA\x96R\x93*A\x96R1A\x98l\x83*A\x98l1A\x98l\x93\x0aA\x9a=\x +83\x0aA\x9a=\x93SA\x 9bq\x83SA\x9bq\x93PA\x9c\x40\x83PA\x9c\x40\x93WA\x9c\x40SA\x9e<\x83WA\ +x9e<SA\x00\xff/\x00" , 'events' => [ # 0 events. ] }), ] });

      I was able to recreate the MIDI file from your code dump and it plays fine on my Win98 box. I do not have a sound card in any of my linux boxen or I would test it on them.

      So either the MIDI player doesn't like my MIDI files or the original file was corrupt due to bad choices on my part for the random values.

      Update: It's not your linux configuration that is messed up because you said that other MIDI files play okay. We can't rule out the player not liking the file until you have tried playing it with another MIDI player. I doubt that it is due to bad values on my part since it works fine on other operating systems (but I wouldn't rule it out yet).

      Update 2: Problem solved, see root node. (Aside: Don't trust the examples listed in module documentation.)