react-orchestra
react-orchestra copied to clipboard
TypeError: Cannot read property 'filter' of undefined
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),
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 !
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
Cool ! will give it a shot asap and let you know :) Cheers
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 ?
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';
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 !