react-orchestra icon indicating copy to clipboard operation
react-orchestra copied to clipboard

TypeError: Cannot read property 'filter' of undefined

Open nicobrinkkemper opened this issue 8 years ago • 6 comments
trafficstars

When I build my own version of this repo, everything works fine. I got it working trough docker on a windows machine. However, when I change the url to the .mid file, it fails. I'm not doing anything different, I just changed the url and allowed cross origin on the host. Perhaps you can help me out with this? It could be that something went wrong with my build.

MidiIO.js:111Uncaught (in promise) TypeError: Cannot read property 'filter' of undefined at http://localhost/demo.5a7d88bb.js:7:17557 at Array.map (native) at Function.ROpp.e.getAllTracks (http://localhost/demo.5a7d88bb.js:7:17149) at http://localhost/demo.5a7d88bb.js:7:21947 (anonymous) @ MidiIO.js:111 ROpp.e.getAllTracks @ MidiIO.js:89 (anonymous) @ MidiIO.js:330

Which points to line:

noteOnValid: indexedTrack.channel_noteOn.filter(event => event.deltaTime > 0),

nicobrinkkemper avatar Jan 11 '17 18:01 nicobrinkkemper

Hey,

Could you send me the link to the midi file ? Midi parsing is still a WIP, Some files might not be understood by the parser.

But if you give me the midi file to reproduce I might be able to help !

rakannimer avatar Jan 12 '17 07:01 rakannimer

Hello again,

This is my file: https://raw.githubusercontent.com/nicobrinkkemper/Gher/master/nginx/gher.mid It's a midi of an old (but powerful) meme. http://www.newgrounds.com/portal/view/398812

I think it has something to do with the request headers not being "audio/mid", but I could be mistaken. Will try again tomorrow.

Regards,

Nico

nicobrinkkemper avatar Jan 16 '17 10:01 nicobrinkkemper

Cool ! will give it a shot asap and let you know :) Cheers

rakannimer avatar Jan 16 '17 12:01 rakannimer

Hey,

It looks like the midi file is corrupt, I couldn't open it with 3 different midi players. And github is not recognizing it as a binary file.

How did you generate it ?

rakannimer avatar Jan 16 '17 17:01 rakannimer

I think react orchestra can only handle specific midi files. I've tried a couple but they all fail. I believe because they have multiple tracks inside them. Could you tell me how you generated your files on mac? Thanks.

Works: 'https://storage.googleapis.com/gher-1ab43.appspot.com/beet1track-medium-fast.mid';

Wont work: 'https://storage.googleapis.com/gher-1ab43.appspot.com/air-man-s-stage.mid'; 'https://storage.googleapis.com/gher-1ab43.appspot.com/beethoven_opus10_1.mid'; 'https://storage.googleapis.com/gher-1ab43.appspot.com/gher.mid';

nicobrinkkemper avatar Jan 19 '17 17:01 nicobrinkkemper

Hey!

Sorry for the late reply :) I want to rewrite the midi parsing for the library as soon as I get the time, I don't think it's production ready yet. I'm thinking of using @grimmdude's Midi parser and writer in future versions.

Meanwhile, if you want to use midi I think as long as you're using one track only the midi should behave as expected.

Cheers !

rakannimer avatar Apr 05 '17 04:04 rakannimer