-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
support audio buffer node detune #15040
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
Conversation
docs/api/en/audio/Audio.html
Outdated
| [page:Audio.pause pause]() etc. methods. Default is *true*.</p> | ||
|
|
||
| <h3>[property:Number detune]</h3> | ||
| <p>Modify pitch. Default is *0*.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would add the metric which is cent.
|
@mrdoob Should we provide |
|
@Mugen87 I think so 👌 |
|
Okay, then let's add both methods to this PR. |
|
Updated. |
|
|
||
| if ( this.isPlaying === true ) { | ||
|
|
||
| this.source.detune.setValueAtTime( this.detune, this.context.currentTime ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a special reason for using setValueAtTime()? We normally use setTargetAtTime(), see #11133 (comment)
this.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 );There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add both new methods to the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the playbackRate code, but I can change both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that'd be great 😊
The last audio buffer source node property to support, next to playbackRate.
https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/detune