Constructor
new Yin(options)
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Override default parameters. Properties
|
- Source:
Example
import * as lfo from 'waves-lfo/client';
// assuming some AudioBuffer
const source = new lfo.source.AudioInBuffer({
audioBuffer: audioBuffer,
});
const slicer = new lfo.operator.Slicer({
frameSize: 2048,
});
const yin = new lfo.operator.Yin();
const logger = new lfo.sink.Logger({ data: true });
source.connect(slicer);
slicer.connect(yin);
yin.connect(logger);
source.start();
Methods
inputSignal(input) → {Array}
Use the Yin
operator in standalone
mode (i.e. outside of a graph).
Parameters:
Name | Type | Description |
---|---|---|
input |
Array | Float32Array | The signal fragment to process. |
- Source:
Returns:
- Array containing the
frequency
,energy
,periodicity
andAC1
- Type
- Array
Example
import * as lfo from 'waves-lfo/client';
const yin = new lfo.operator.Yin();
yin.initStream({
frameSize: 2048,
frameType: 'signal',
sourceSampleRate: 44100
});
const results = yin.inputSignal(signal);