| GStreamer Buzztard Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | ||||
GstBtToneConversion; enum GstBtToneConversionTuning; GstBtToneConversion * gstbt_tone_conversion_new (GstBtToneConversionTuning tuning); gdouble gstbt_tone_conversion_translate_from_string (GstBtToneConversion *self, gchar *note); gdouble gstbt_tone_conversion_translate_from_number (GstBtToneConversion *self, guint note); guint gstbt_tone_conversion_note_string_2_number (const gchar *note); const gchar * gstbt_tone_conversion_note_number_2_string (guint note);
An instance of this class can translate a musical note to a frequency, while taking a specific tuning into account. It also provides conversion betwen notes as numbers and strings.
typedef struct _GstBtToneConversion GstBtToneConversion;
Opaque object instance.
typedef enum {
/* 12 tones with equal distance (equal temperament) */
GSTBT_TONE_CONVERSION_CROMATIC=0,
/* @todo: add more */
} GstBtToneConversionTuning;
Supported tuning types. see http://en.wikipedia.org/wiki/Musical_tuning
GstBtToneConversion * gstbt_tone_conversion_new (GstBtToneConversionTuning tuning);
Create a new instance of a note to frequency translator, that will use the
given tuning.
|
the GstBtToneConversionTuning to use |
Returns : |
a new GstBtToneConversion translator |
gdouble gstbt_tone_conversion_translate_from_string (GstBtToneConversion *self, gchar *note);
Converts the string representation of a musical note such as 'C-3' or 'd#4' to a frequency in Hz.
|
a GstBtToneConversion |
|
a musical note in string representation |
Returns : |
the frequency of the note or 0.0 in case of an error |
gdouble gstbt_tone_conversion_translate_from_number (GstBtToneConversion *self, guint note);
Converts the numerical number of a note to a frequency in Hz. A value of 1
for note represents 'c-0'. The highest supported value is 'b-9' (or 'h-9')
which is 1+(9*16)+11 (1 octave has 12 tones, 4 are left unused for easy
coding).
|
a GstBtToneConversion |
|
a musical note as number |
Returns : |
the frequency of the note or 0.0 in case of an error |
guint gstbt_tone_conversion_note_string_2_number (const gchar *note);
Converts the string representation of a musical note such as 'C-3' or 'd#4' to a note number.
|
a musical note in string representation |
Returns : |
the note number or 0 in case of an error. |
const gchar * gstbt_tone_conversion_note_number_2_string (guint note);
Converts the numerical number of a note to a string. A value of 1
for note represents 'c-0'. The highest supported value is 'b-9' (or 'h-9')
which is 1+(9*16)+11 (1 octave has 12 tones, 4 are left unused for easy
coding).
|
a musical note as number |
Returns : |
the note as string or an empty string in the case of an error. |
"tuning" property"tuning" GstBtToneConversionTuning : Read / Write
selection frequency tuning table.
Default value: GSTBT_TONE_CONVERSION_CROMATIC