Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'filter' of undefined #2

Open
nicobrinkkemper opened this issue Jan 11, 2017 · 6 comments
Open

TypeError: Cannot read property 'filter' of undefined #2

nicobrinkkemper opened this issue Jan 11, 2017 · 6 comments

Comments

@nicobrinkkemper
Copy link

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),

@rakannimer
Copy link
Owner

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 !

@nicobrinkkemper
Copy link
Author

nicobrinkkemper commented Jan 16, 2017

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

@rakannimer
Copy link
Owner

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

@rakannimer
Copy link
Owner

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 ?

@nicobrinkkemper
Copy link
Author

nicobrinkkemper commented Jan 19, 2017

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';

@rakannimer
Copy link
Owner

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants