GstNote2FrequencyTuning

GstNote2FrequencyTuning — helper class for unit conversion

Synopsis




                    GstNote2Frequency;
enum                GstNote2FrequencyTuning;
GstNote2Frequency*  gst_note_2_frequency_new            (GstNote2FrequencyTuning tuning);
gdouble             gst_note_2_frequency_translate_from_string
                                                        (GstNote2Frequency *self,
                                                         gchar *note);
gdouble             gst_note_2_frequency_translate_from_number
                                                        (GstNote2Frequency *self,
                                                         guint note);

Object Hierarchy


  GObject
   +----GstNote2Frequency

Properties


  "tuning"                   GstNote2FrequencyTuning  : Read / Write

Description

An instance of this class can translate a musical note to a frequency, while taking a specific tuning into account.

Details

GstNote2Frequency

typedef struct _GstNote2Frequency GstNote2Frequency;


enum GstNote2FrequencyTuning

typedef enum {
  /* 12 tones with equal distance (equal temperament) */
  GST_NOTE_2_FREQUENCY_CROMATIC=0,
  /* @todo: add more */
} GstNote2FrequencyTuning;

Supported tuning types. see http://en.wikipedia.org/wiki/Musical_tuning

GST_NOTE_2_FREQUENCY_CROMATIC 12 tones with equal distance (equal temperament)

gst_note_2_frequency_new ()

GstNote2Frequency*  gst_note_2_frequency_new            (GstNote2FrequencyTuning tuning);

Create a new instance of a note to frequency translator, that will use the given tuning.

tuning : the GstNote2FrequencyTuning to use
Returns : a new GstNote2Frequency translator

gst_note_2_frequency_translate_from_string ()

gdouble             gst_note_2_frequency_translate_from_string
                                                        (GstNote2Frequency *self,
                                                         gchar *note);

Converts the string representation of a musical note such as 'C-3' or 'd4' to a frequency in Hz.

self : a GstNote2Frequency
note : a musical note in string representation
Returns : the frequency of the note or 0.0 in case of an error

gst_note_2_frequency_translate_from_number ()

gdouble             gst_note_2_frequency_translate_from_number
                                                        (GstNote2Frequency *self,
                                                         guint note);

Converts the numerical number of a note to a frequency in Hz. A value of 0 for note represents 'c-0'. The highes supported value is 'b-9' (or 'h-9') which is (10*12)-1.

self : a GstNote2Frequency
note : a musical note as number
Returns : the frequency of the note or 0.0 in case of an error

Property Details

The "tuning" property

  "tuning"                   GstNote2FrequencyTuning  : Read / Write

selection frequency tuning table.

Default value: GST_NOTE_2_FREQUENCY_CROMATIC