{"action":"created","issue":{"url":"https://api.github.com/repos/notator/WebMIDISynthHost/issues/6","labels_url":"https://api.github.com/repos/notator/WebMIDISynthHost/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/notator/WebMIDISynthHost/issues/6/comments","events_url":"https://api.github.com/repos/notator/WebMIDISynthHost/issues/6/events","html_url":"https://github.com/notator/WebMIDISynthHost/issues/6","id":116206311,"number":6,"title":"Sf2Synth1: Bad noteOn/noteOff responses","user":{"login":"notator","id":1655500,"avatar_url":"https://avatars.githubusercontent.com/u/1655500?v=3","gravatar_id":"","url":"https://api.github.com/users/notator","html_url":"https://github.com/notator","followers_url":"https://api.github.com/users/notator/followers","following_url":"https://api.github.com/users/notator/following{/other_user}","gists_url":"https://api.github.com/users/notator/gists{/gist_id}","starred_url":"https://api.github.com/users/notator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notator/subscriptions","organizations_url":"https://api.github.com/users/notator/orgs","repos_url":"https://api.github.com/users/notator/repos","events_url":"https://api.github.com/users/notator/events{/privacy}","received_events_url":"https://api.github.com/users/notator/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-10T21:30:49Z","updated_at":"2015-11-26T12:55:06Z","closed_at":null,"body":"1. Start the WebMIDISynthHost application,\r\n2. Select the Sf2Synth1 synthesizer\r\n3. Using the default \"grand piano\" preset, send the default noteOn.\r\n\r\nThere is a delay before the synth responds to the first noteOn. Why? This is a problem that applies to all presets, as far as I can see. I have tried a few workarounds, but without success.\r\n\r\nEven when the noteOn is reponding correctly, the noteOff does not respond immediately if it comes too soon. Why? Are noteOffs responding correctly on some instruments?\r\n"},"comment":{"url":"https://api.github.com/repos/notator/WebMIDISynthHost/issues/comments/159905702","html_url":"https://github.com/notator/WebMIDISynthHost/issues/6#issuecomment-159905702","issue_url":"https://api.github.com/repos/notator/WebMIDISynthHost/issues/6","id":159905702,"user":{"login":"notator","id":1655500,"avatar_url":"https://avatars.githubusercontent.com/u/1655500?v=3","gravatar_id":"","url":"https://api.github.com/users/notator","html_url":"https://github.com/notator","followers_url":"https://api.github.com/users/notator/followers","following_url":"https://api.github.com/users/notator/following{/other_user}","gists_url":"https://api.github.com/users/notator/gists{/gist_id}","starred_url":"https://api.github.com/users/notator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notator/subscriptions","organizations_url":"https://api.github.com/users/notator/orgs","repos_url":"https://api.github.com/users/notator/repos","events_url":"https://api.github.com/users/notator/events{/privacy}","received_events_url":"https://api.github.com/users/notator/received_events","type":"User","site_admin":false},"created_at":"2015-11-26T12:55:05Z","updated_at":"2015-11-26T12:55:05Z","body":"I've now solved both these issues, but have been unable to discover *why* the first noteOn is delayed, so I'm not really happy with my solution to that problem. Is there an uninitialized buffer somewhere?\r\nMy kludge is as follows:\r\nWhen the first soundfont has loaded:\r\n1. set the first synth's master volume to 0.\r\n2. set its soundfont to the first soundFont\r\n3. send a dummy noteOn/noteOff pair\r\n4. after ca.2 seconds, reset the master volume and tell the host that the font has loaded.\r\nNot nice, but it works.\r\n\r\nNoteOffs now end the sound immediately. Notes do *not* play their volRelease and modRelease phases after the noteOff arrives. I think this was a bug/misunderstanding in the gree code, related to the following issue: \r\nTODO: Percussion and piano presets should never loop! Its quite wrong for a piano to function like an organ or a flute."}}