High-level wrapper over SingerToneTracker to detect pitch from mono audio frames. Exposes last detection via read-only properties and provides a simple mode (most frequent note) helper.
More...
|
| | if (value==_sampleRate) return |
| |
| | SingerToneDetector () |
| | Creates a new SingerToneDetector with a default history size and recording enabled.
|
| |
| void | setSampleRate (int samplerate) |
| | Legacy API. Use SampleRate instead.
|
| |
| bool | DetectPitch (float[] inBuffer) |
| | Processes an audio frame and updates last detection properties.
|
| |
| int | FindMode (int count) |
| | Finds the mode (most frequent MIDI note) within the most recent count records.
|
| |
| string | GetLastNoteName (bool sharps=true, bool showOctave=true) |
| | Returns the formatted note name of the last detected MIDI note.
|
| |
| string | MidiNoteToString (int note) |
| | Formats an arbitrary MIDI note number to a note name.
|
| |
|
| float | LastFrequencyHz { get |
| | Last detected frequency in Hz. Zero means no valid pitch.
|
| |
| int | LastMidiNote { get |
| | Last detected MIDI note as integer (A4 = 69). Zero means no valid pitch.
|
| |
| float | LastMidiNotePrecise { get |
| | Last detected MIDI note as float (note + cents/100).
|
| |
| string | LastNoteName { get |
| | Last detected note name, e.g., "A# 4". Null or empty if no valid pitch.
|
| |
| int | LastCents { get |
| | Last detected cents deviation from the integer MIDI note in [-50, 50].
|
| |
| int | SampleRate |
| | Audio sample rate in Hz used by the underlying tracker. Setting a new value reconfigures internal filters.
|
| |
| | _sampleRate = value |
| |
| tracker | SampleRate = value |
| |
| ReadOnlyCollection< SingerToneTracker.PitchRecord > | PitchHistory |
| | Read-only view of recent pitch records produced by the tracker. The collection can be empty if no detections were recorded yet.
|
| |
|
| void | ResetLast () |
| | Resets last detection properties to "no pitch" defaults.
|
| |
| int | Repetitions (int element, int count, int startIndex) |
| | Counts how many times the MIDI note at element appears within the window [startIndex , startIndex + count ) in the history.
|
| |
High-level wrapper over SingerToneTracker to detect pitch from mono audio frames. Exposes last detection via read-only properties and provides a simple mode (most frequent note) helper.
◆ SingerToneDetector()
| Backbone::SingerToneDetector::SingerToneDetector |
( |
| ) |
|
◆ DetectPitch()
| bool Backbone::SingerToneDetector::DetectPitch |
( |
float[] | inBuffer | ) |
|
Processes an audio frame and updates last detection properties.
- Parameters
-
| inBuffer | Mono PCM frame (float samples in [-1,1]). Must not be null or empty. |
- Returns
- True if a valid pitch was detected; otherwise false.
◆ FindMode()
| int Backbone::SingerToneDetector::FindMode |
( |
int | count | ) |
|
Finds the mode (most frequent MIDI note) within the most recent count records.
- Parameters
-
| count | Number of recent records to consider. Clamped to available history. |
- Returns
- The modal MIDI note, or 0 if not enough data.
◆ GetLastNoteName()
| string Backbone::SingerToneDetector::GetLastNoteName |
( |
bool | sharps = true, |
|
|
bool | showOctave = true ) |
Returns the formatted note name of the last detected MIDI note.
- Parameters
-
| sharps | If true, uses sharps (e.g., A#); otherwise flats (e.g., Bb). |
| showOctave | If true, appends the octave number. |
- Returns
- Note name or null if no valid pitch.
◆ if()
| Backbone::SingerToneDetector::if |
( |
value | = =_sampleRate | ) |
|
◆ MidiNoteToString()
| string Backbone::SingerToneDetector::MidiNoteToString |
( |
int | note | ) |
|
Formats an arbitrary MIDI note number to a note name.
- Parameters
-
- Returns
- Formatted note name, or null if out of supported range.
◆ Repetitions()
| int Backbone::SingerToneDetector::Repetitions |
( |
int | element, |
|
|
int | count, |
|
|
int | startIndex ) |
|
private |
Counts how many times the MIDI note at element appears within the window [startIndex , startIndex + count ) in the history.
- Parameters
-
| element | Index in the history whose note is used as the target. |
| count | Window length to scan. |
| startIndex | Start index of the window in the history list. |
- Returns
- Repetition count within the window.
◆ ResetLast()
| void Backbone::SingerToneDetector::ResetLast |
( |
| ) |
|
|
private |
Resets last detection properties to "no pitch" defaults.
◆ setSampleRate()
| void Backbone::SingerToneDetector::setSampleRate |
( |
int | samplerate | ) |
|
|
property |
Legacy API. Use SampleRate instead.
- Parameters
-
| samplerate | Sample rate in Hz. |
◆ _sampleRate [1/2]
| int Backbone::SingerToneDetector::_sampleRate |
|
private |
◆ _sampleRate [2/2]
| Backbone::SingerToneDetector::_sampleRate = value |
◆ LastCents
| int Backbone::SingerToneDetector::LastCents { get |
Last detected cents deviation from the integer MIDI note in [-50, 50].
◆ LastFrequencyHz
| float Backbone::SingerToneDetector::LastFrequencyHz { get |
Last detected frequency in Hz. Zero means no valid pitch.
◆ LastMidiNote
| int Backbone::SingerToneDetector::LastMidiNote { get |
Last detected MIDI note as integer (A4 = 69). Zero means no valid pitch.
◆ LastMidiNotePrecise
| float Backbone::SingerToneDetector::LastMidiNotePrecise { get |
Last detected MIDI note as float (note + cents/100).
◆ LastNoteName
| string Backbone::SingerToneDetector::LastNoteName { get |
Last detected note name, e.g., "A# 4". Null or empty if no valid pitch.
◆ PitchHistory
Initial value:
SingerToneTracker tracker
Definition SingerToneDetector.cs:13
Real-time pitch tracker. Splits input into low/high bands, performs coarse-to-fine pitch detection,...
Definition SingerToneTracker.cs:12
Immutable pitch record.
Definition SingerToneTracker.cs:338
Read-only view of recent pitch records produced by the tracker. The collection can be empty if no detections were recorded yet.
◆ SampleRate [1/2]
| int Backbone::SingerToneDetector::SampleRate |
Initial value:{
int _sampleRate
Definition SingerToneDetector.cs:14
Audio sample rate in Hz used by the underlying tracker. Setting a new value reconfigures internal filters.
◆ SampleRate [2/2]
| tracker Backbone::SingerToneDetector::SampleRate = value |
◆ set
| Backbone::SingerToneDetector::set |
|
private |
Initial value:{
if (value <= 0) throw new ArgumentOutOfRangeException(nameof(value))
◆ tracker
The documentation for this class was generated from the following file: