{"action":"created","issue":{"url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/552","labels_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/552/labels{/name}","comments_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/552/comments","events_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/552/events","html_url":"https://github.com/WebAudio/web-audio-api/pull/552","id":89141862,"number":552,"title":"Fix #447: Define oscillator carefully.","user":{"login":"rtoy","id":663356,"avatar_url":"https://avatars.githubusercontent.com/u/663356?v=3","gravatar_id":"","url":"https://api.github.com/users/rtoy","html_url":"https://github.com/rtoy","followers_url":"https://api.github.com/users/rtoy/followers","following_url":"https://api.github.com/users/rtoy/following{/other_user}","gists_url":"https://api.github.com/users/rtoy/gists{/gist_id}","starred_url":"https://api.github.com/users/rtoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtoy/subscriptions","organizations_url":"https://api.github.com/users/rtoy/orgs","repos_url":"https://api.github.com/users/rtoy/repos","events_url":"https://api.github.com/users/rtoy/events{/privacy}","received_events_url":"https://api.github.com/users/rtoy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-17T22:24:04Z","updated_at":"2015-07-23T22:59:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/WebAudio/web-audio-api/pulls/552","html_url":"https://github.com/WebAudio/web-audio-api/pull/552","diff_url":"https://github.com/WebAudio/web-audio-api/pull/552.diff","patch_url":"https://github.com/WebAudio/web-audio-api/pull/552.patch"},"body":"Define the oscillators for the builtin types to produce the same\r\nresults as if a PeriodicWave with the appropriate Fourier coefficients\r\nwere used to create the oscillator."},"comment":{"url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/comments/124261330","html_url":"https://github.com/WebAudio/web-audio-api/pull/552#issuecomment-124261330","issue_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/552","id":124261330,"user":{"login":"karlt","id":5798877,"avatar_url":"https://avatars.githubusercontent.com/u/5798877?v=3","gravatar_id":"","url":"https://api.github.com/users/karlt","html_url":"https://github.com/karlt","followers_url":"https://api.github.com/users/karlt/followers","following_url":"https://api.github.com/users/karlt/following{/other_user}","gists_url":"https://api.github.com/users/karlt/gists{/gist_id}","starred_url":"https://api.github.com/users/karlt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlt/subscriptions","organizations_url":"https://api.github.com/users/karlt/orgs","repos_url":"https://api.github.com/users/karlt/repos","events_url":"https://api.github.com/users/karlt/events{/privacy}","received_events_url":"https://api.github.com/users/karlt/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T22:59:02Z","updated_at":"2015-07-23T22:59:02Z","body":"rtoy writes:\n\n> ​Do you have an example of where the band-limited square waves exceed 1 in\n> amplitude?  They shouldn't.\n\nhttp://people.mozilla.org/~karlt/square-peaks.html\n(They should.)\n\n> I don't understand what you mean by \"using a magnitude from a different\n> truncation to the generator\".\n\nNormalization is independent of frequency and happens before the\nband-limiting that depends on fundamental and Nyquist frequencies.\nThe band-limited waveforms are different from the waveforms used\nto calculate the normalization factor, and so have different peaks.\n\n> ​Yes, but that's true for any kind of mixing and having oscillators not\n> exceed 1 makes the mixing easier for the causal user.  Without\n> normalization, changing the oscillator type would cause a possibly\n> different gain to be used when mixing.\n\nThere are different energy levels in the different oscillator\ntypes.  I don't think we can argue that peak-based-normalization\nsimplifies mixing of different types.\n\n> ​You want the mathematical oscillators?  Isn't that\n> https://github.com/WebAudio/web-audio-api/issues/244, which we already\n> decided to move to v.next?\n\n244 was attempting to remove ripples from the band-limiting AIUI.\nThat is not what I'm raising here.\n\nBand-limiting of the built-in oscillators doesn't change the\nmagnitude of the frequency components well below Nyquist.\nI'm concerned that the proposal here might be to change the\nmagnitude of those frequency components through an arbitrary\nnormalization algorithm.\n\n> The only issue that\n> isn't specified is how many coefficients are used to generate the time\n> domain waveform.  Perhaps we should.​\n\nThat is a key issue because the number of coefficients that are\nselected from the infinite series affects the magnitude that is\nused for normalization.\n\nInstead of selecting an arbitrary truncation, producing arbitrary\nmagnitudes, I would use the full series.  i.e. normalization is\nperformed on the continuous (infinite resolution) waveform.\n"}}