{"action":"created","issue":{"url":"https://api.github.com/repos/danigb/soundfont-player/issues/5","labels_url":"https://api.github.com/repos/danigb/soundfont-player/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/danigb/soundfont-player/issues/5/comments","events_url":"https://api.github.com/repos/danigb/soundfont-player/issues/5/events","html_url":"https://github.com/danigb/soundfont-player/pull/5","id":117504380,"number":5,"title":"Duration no longer required for oscillation play as long as 'noStop: true' option specified.","user":{"login":"benwiley4000","id":13558253,"avatar_url":"https://avatars.githubusercontent.com/u/13558253?v=3","gravatar_id":"","url":"https://api.github.com/users/benwiley4000","html_url":"https://github.com/benwiley4000","followers_url":"https://api.github.com/users/benwiley4000/followers","following_url":"https://api.github.com/users/benwiley4000/following{/other_user}","gists_url":"https://api.github.com/users/benwiley4000/gists{/gist_id}","starred_url":"https://api.github.com/users/benwiley4000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benwiley4000/subscriptions","organizations_url":"https://api.github.com/users/benwiley4000/orgs","repos_url":"https://api.github.com/users/benwiley4000/repos","events_url":"https://api.github.com/users/benwiley4000/events{/privacy}","received_events_url":"https://api.github.com/users/benwiley4000/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-18T03:18:08Z","updated_at":"2015-11-19T19:33:16Z","closed_at":"2015-11-18T21:20:11Z","pull_request":{"url":"https://api.github.com/repos/danigb/soundfont-player/pulls/5","html_url":"https://github.com/danigb/soundfont-player/pull/5","diff_url":"https://github.com/danigb/soundfont-player/pull/5.diff","patch_url":"https://github.com/danigb/soundfont-player/pull/5.patch"},"body":"Up to now it's possible not to set a duration for soundfont plays, but not setting a duration for oscillation plays causes an error (the 'play' method will attempt to stop the note anyway using the undefined duration). The decision not to account for indefinite play length for oscillation makes sense; if we don't tell the wave when to stop, it can go on forever, stack on other waves, and cause problems.\r\n\r\nHowever, in our use case, duration is unknown (the end of the note is triggered by the user, by way of the returned OscillatorNode's 'stop' method). This commit allows us to specify no duration; to avoid problems, specifying no duration will now trigger a warning (and not play a note) unless a 'noStop: true' option is passed to the play method. That way, developers can avoid accidentally triggering an indefinite symphony of cacophonous vibrations. Additionally, the new warning makes it much more obvious what needs to be fixed (i.e., specify a duration).\r\n\r\nExample:\r\n\r\n`var sine = soundfont.instrument();`\r\n`var source = sine.play('C4', 0, null, { noStop: true });`\r\n`/* time passes... */`\r\n`source.stop();`"},"comment":{"url":"https://api.github.com/repos/danigb/soundfont-player/issues/comments/158169678","html_url":"https://github.com/danigb/soundfont-player/pull/5#issuecomment-158169678","issue_url":"https://api.github.com/repos/danigb/soundfont-player/issues/5","id":158169678,"user":{"login":"danigb","id":7457,"avatar_url":"https://avatars.githubusercontent.com/u/7457?v=3","gravatar_id":"","url":"https://api.github.com/users/danigb","html_url":"https://github.com/danigb","followers_url":"https://api.github.com/users/danigb/followers","following_url":"https://api.github.com/users/danigb/following{/other_user}","gists_url":"https://api.github.com/users/danigb/gists{/gist_id}","starred_url":"https://api.github.com/users/danigb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danigb/subscriptions","organizations_url":"https://api.github.com/users/danigb/orgs","repos_url":"https://api.github.com/users/danigb/repos","events_url":"https://api.github.com/users/danigb/events{/privacy}","received_events_url":"https://api.github.com/users/danigb/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T19:33:16Z","updated_at":"2015-11-19T19:33:16Z","body":"Hi, \r\n\r\nI've been thinking about the changes and I think I prefer to set a default duration if no one is given (0.2sec or so, an arbitrary number, I know) and to avoid the vco.stop call need to give -1 as duration. Trying to do convention over configuration, and I think still solves your issue and imho is cleaner. What do you think?"}}