mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-10 05:54:20 +00:00
docs example bugfixes, typo corrections, minor additions for clarity, legacy link update
This commit is contained in:
parent
826a51d594
commit
5949b77e0e
5 changed files with 24 additions and 9 deletions
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
|
@ -10,7 +10,7 @@ To contribute examples, please follow the current style of the examples. Add you
|
|||
|
||||
There is always more work that can be done on documentation. Especially adding good examples to methods and members to make the docs more informative and useful for people coming from diverse musical and technical backgrounds.
|
||||
|
||||
All of the docs are written in [jsdoc](http://usejsdoc.org/)-style comments in the source code. If you catch a mistake, please send a pull request.
|
||||
All of the docs are written in [TypeDoc](https://typedoc.org/)-style comments in the source code. If you catch a mistake, please send a pull request.
|
||||
|
||||
Along with this, it'd be great to integrate more visuals and references in the docs to help illustrate concepts.
|
||||
|
||||
|
|
|
@ -41,7 +41,9 @@ export class Channel extends ToneAudioNode<ChannelOptions> {
|
|||
private _panVol: PanVol;
|
||||
|
||||
/**
|
||||
* The L/R panning control.
|
||||
* The L/R panning control. -1 = hard left, 1 = hard right.
|
||||
* @min -1
|
||||
* @max 1
|
||||
*/
|
||||
readonly pan: Param<"audioRange">;
|
||||
|
||||
|
|
|
@ -34,7 +34,9 @@ export class PanVol extends ToneAudioNode<PanVolOptions> {
|
|||
private _panner: Panner;
|
||||
|
||||
/**
|
||||
* The L/R panning control.
|
||||
* The L/R panning control. -1 = hard left, 1 = hard right.
|
||||
* @min -1
|
||||
* @max 1
|
||||
*/
|
||||
readonly pan: Param<"audioRange">;
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ export abstract class AbstractParam<TypeName extends UnitName> {
|
|||
* @example
|
||||
* return Tone.Offline(() => {
|
||||
* const signal = new Tone.Signal(0).toDestination();
|
||||
* // the ramp is starts from the previously scheduled value
|
||||
* // the ramp starts from the previously scheduled value
|
||||
* signal.setValueAtTime(0, 0.1);
|
||||
* signal.linearRampToValueAtTime(1, 0.4);
|
||||
* }, 0.5, 1);
|
||||
|
@ -68,10 +68,10 @@ export abstract class AbstractParam<TypeName extends UnitName> {
|
|||
* the previous scheduled parameter value to the given value.
|
||||
* @example
|
||||
* return Tone.Offline(() => {
|
||||
* const signal = new Tone.Signal(0).toDestination();
|
||||
* // the ramp is starts from the previously scheduled value
|
||||
* signal.setValueAtTime(0, 0.1);
|
||||
* signal.exponentialRampToValueAtTime(1, 0.4);
|
||||
* const signal = new Tone.Signal(1).toDestination();
|
||||
* // the ramp starts from the previously scheduled value, which must be positive
|
||||
* signal.setValueAtTime(1, 0.1);
|
||||
* signal.exponentialRampToValueAtTime(0, 0.4);
|
||||
* }, 0.5, 1);
|
||||
*/
|
||||
abstract exponentialRampToValueAtTime(value: UnitMap[TypeName], time: Time): this;
|
||||
|
@ -90,6 +90,11 @@ export abstract class AbstractParam<TypeName extends UnitName> {
|
|||
* const noise = new Tone.Noise().connect(delay).start().stop("+0.1");
|
||||
* // making the delay time shorter over time will also make the pitch rise
|
||||
* delay.delayTime.exponentialRampTo(0.01, 20);
|
||||
* @example
|
||||
* return Tone.Offline(() => {
|
||||
* const signal = new Tone.Signal(.1).toDestination();
|
||||
* signal.exponentialRampTo(5, 0.3, 0.1);
|
||||
* }, 0.5, 1);
|
||||
*/
|
||||
abstract exponentialRampTo(value: UnitMap[TypeName], rampTime: Time, startTime?: Time): this;
|
||||
|
||||
|
@ -104,6 +109,12 @@ export abstract class AbstractParam<TypeName extends UnitName> {
|
|||
* @param startTime When the ramp should start.
|
||||
* @returns {Param} this
|
||||
* @example
|
||||
* const delay = new Tone.FeedbackDelay(0.5, 0.98).toDestination();
|
||||
* // a short burst of noise through the feedback delay
|
||||
* const noise = new Tone.Noise().connect(delay).start().stop("+0.1");
|
||||
* // making the delay time shorter over time will also make the pitch rise
|
||||
* delay.delayTime.linearRampTo(0.01, 20);
|
||||
* @example
|
||||
* return Tone.Offline(() => {
|
||||
* const signal = new Tone.Signal(1).toDestination();
|
||||
* signal.linearRampTo(0, 0.3, 0.1);
|
||||
|
|
|
@ -27,7 +27,7 @@ interface ToneAudioBuffersOptions {
|
|||
* }, () => {
|
||||
* const player = new Tone.Player().toDestination();
|
||||
* // play one of the samples when they all load
|
||||
* player.buffer = pianoSamples.get("C2");
|
||||
* player.buffer = pianoSamples.get("A2");
|
||||
* player.start();
|
||||
* });
|
||||
* @example
|
||||
|
|
Loading…
Reference in a new issue