Divooka Reference

Music Analysis

8 nodes

On this page 8

Chroma

Function

How much of each of the twelve pitch classes a clip holds, C to B, folded across every octave and averaged over the clip - its harmony at a glance.

Signature
Chroma(audio: AudioBuffer) -> Number Array
double[] Chroma(AudioBuffer audio)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip.

Returns

ChromaNumber Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Music Analysis
Package
Audio Processing

Detect Key

Function

The key a clip is most likely in, by correlating its chroma with the Krumhansl-Kessler major and minor key profiles.

Signature
DetectKey(audio: AudioBuffer) -> (Key: Text, confidence: Number)
string DetectKey(AudioBuffer audio, out double confidence)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip; a few seconds of the music at least.

Returns

KeyText
confidenceNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Music Analysis
Package
Audio Processing

Detect Onsets

Function

When each new note or hit begins, in seconds.

Signature
DetectOnsets -> Number Array
    audio: AudioBuffer
    sensitivity: Number
    separation: Number
double[] DetectOnsets(
    AudioBuffer audio,
    double sensitivity = 2,
    double separation = 100)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip; several channels are averaged.
sensitivityNumber2How far above the recent average a rise in spectral flux must be to count; lower finds more.
separationNumber100The least time in milliseconds between two onsets.

Returns

OnsetsNumber Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Music Analysis
Package
Audio Processing

Detect Pitch

Function

The one pitch a clip mostly holds: the median of its pitch track.

Signature
DetectPitch(audio: AudioBuffer) -> (Frequency: Number, note: Text)
double DetectPitch(AudioBuffer audio, out string note)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip.

Returns

FrequencyNumber
noteText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Music Analysis
Package
Audio Processing

Estimate Tempo

Function

A clip's tempo in beats per minute.

Signature
EstimateTempo(audio: AudioBuffer) -> Number
double EstimateTempo(AudioBuffer audio)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip.

Returns

TempoNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Music Analysis
Package
Audio Processing

Note Name

Function

The name of the equal-tempered note nearest a frequency, at A4 = 440 Hz.

Signature
NoteName(frequency: Number) -> (Note: Text, cents: Number)
string NoteName(double frequency, out double cents)

Parameters

nametypedefaultdescription
frequencyNumber—The frequency in Hz.

Returns

NoteText
centsNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Music Analysis
Package
Audio Processing

Track Beats

Function

The beats of a clip, in seconds, from a bank of comb filters that lock on to the tempo and its phase.

Signature
TrackBeats(audio: AudioBuffer) -> (Beats: Number Array, tempo: Number)
double[] TrackBeats(AudioBuffer audio, out double tempo)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip; several channels are averaged.

Returns

BeatsNumber Array
tempoNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Music Analysis
Package
Audio Processing

Track Pitch

Function

Follows the pitch of a clip that plays one note at a time - a voice, a flute, a bass line - window by window.

Signature
TrackPitch -> Pitch Point Array
    audio: AudioBuffer
    minimum: Number
    maximum: Number
PitchPoint[] TrackPitch(
    AudioBuffer audio,
    double minimum = 50,
    double maximum = 1000)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip; several channels are averaged.
minimumNumber50The lowest pitch to look for, in Hz.
maximumNumber1000The highest, in Hz.

Returns

PitchesPitch Point Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Music Analysis
Package
Audio Processing