-
Notifications
You must be signed in to change notification settings - Fork 640
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
Loaded file is skipping the first chord. #231
Comments
We've run into a similar problem with some work we're doing. I've also encountered some problems playing the first notes of a sequence using the note/chord level interface. I've created some test code, which is adapted from the Basic.html example file, that exhibits this problem - see https://github.com/oerc-music/nin-remixer-public/tree/master/spike/midijs/tests. Using Firefox or Safari on MacOS 10.11.6, and maybe other systems. There are two test files: Test 1 (midijstest1.html). Loads the MIDI plugin on window load, and immediately starts playing some notes. There is a configurable delay to start (about line 57) - if this is set to long enough, say 3-4 seconds, then the notes play fine. But for smaller values, some get dropped or mis-timed. Test 2 (midijstest2.html). Similar to test 1, except that playing the test sequence doesn't start until a "Play" button is clicked. Similar results to above, except that on second and subsequent clicks of the play button, all is fine. UPDATE: if I wait long enough before starting the first playback then that is OK too. See next comment. |
After a little more digging, I think I see the problem. File plugin.webaudio.js has the following code at about line 72:
Similar logic appears about lines 131 and 188. The A workaround with the current code is to submit only absolute delay values by adding |
Reflecting... A problem with my first idea for a fix is that it could introduce time-skews if the notes are added over a period of time. The workaround suggested above remains valid as long as the all the values added are greater than
(This hasn't been tested yet.) |
Greetings,
first of all thank you for developing this library, it is awesome and I like it a lot. One of the problems I ran into is that the MIDI file loaded with the loadFile() function and played with start() is not the playing the first chord, it is playing the first note but not the chord that is backing it. I am using MidiJS in combination with AngularJS.
It is a bit hard for me to explain in words so I have put the software I have been working online. It is still work in progress but enough to explain the issue.
Go to http://melodybrains.azurewebsites.net/ and hit the generate button. Sometimes you have to hit the Generate button twice, that is a bug on my side, don't worry about it too much.
Once the melogy is generated wou will be presented with a some buttons:
$scope.player.loadFile($scope.midiLocation, function () { $scope.player.start(); });
The text was updated successfully, but these errors were encountered: