1 | import { Interval, Seconds, Time } from "../core/type/Units.js";
|
2 | import { FeedbackEffect, FeedbackEffectOptions } from "./FeedbackEffect.js";
|
3 | import { Param } from "../core/context/Param.js";
|
4 | export interface PitchShiftOptions extends FeedbackEffectOptions {
|
5 | pitch: Interval;
|
6 | windowSize: Seconds;
|
7 | delayTime: Time;
|
8 | }
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export declare class PitchShift extends FeedbackEffect<PitchShiftOptions> {
|
18 | readonly name: string;
|
19 | |
20 |
|
21 |
|
22 | private _frequency;
|
23 | |
24 |
|
25 |
|
26 | private _delayA;
|
27 | |
28 |
|
29 |
|
30 | private _lfoA;
|
31 | |
32 |
|
33 |
|
34 | private _delayB;
|
35 | |
36 |
|
37 |
|
38 | private _lfoB;
|
39 | |
40 |
|
41 |
|
42 | private _crossFade;
|
43 | |
44 |
|
45 |
|
46 |
|
47 | private _crossFadeLFO;
|
48 | |
49 |
|
50 |
|
51 | private _feedbackDelay;
|
52 | |
53 |
|
54 |
|
55 | readonly delayTime: Param<"time">;
|
56 | |
57 |
|
58 |
|
59 | private _pitch;
|
60 | |
61 |
|
62 |
|
63 | private _windowSize;
|
64 | |
65 |
|
66 |
|
67 | constructor(pitch?: Interval);
|
68 | constructor(options?: Partial<PitchShiftOptions>);
|
69 | static getDefaults(): PitchShiftOptions;
|
70 | /**
|
71 | * Repitch the incoming signal by some interval (measured in semi-tones).
|
72 | * @example
|
73 | * const pitchShift = new Tone.PitchShift().toDestination();
|
74 | * const osc = new Tone.Oscillator().connect(pitchShift).start().toDestination();
|
75 | * pitchShift.pitch = -12; // down one octave
|
76 | * pitchShift.pitch = 7; // up a fifth
|
77 | */
|
78 | get pitch(): number;
|
79 | set pitch(interval: number);
|
80 | /**
|
81 | * The window size corresponds roughly to the sample length in a looping sampler.
|
82 | * Smaller values are desirable for a less noticeable delay time of the pitch shifted
|
83 | * signal, but larger values will result in smoother pitch shifting for larger intervals.
|
84 | * A nominal range of 0.03 to 0.1 is recommended.
|
85 | */
|
86 | get windowSize(): Seconds;
|
87 | set windowSize(size: Seconds);
|
88 | dispose(): this;
|
89 | }
|