r4140 - trunk/plugins
- From: timj svn gnome org
- To: svn-commits-list gnome org
- Subject: r4140 - trunk/plugins
- Date: Mon, 11 Dec 2006 19:26:02 -0500 (EST)
Author: timj
Date: 2006-12-11 19:26:01 -0500 (Mon, 11 Dec 2006)
New Revision: 4140
Modified:
trunk/plugins/ChangeLog
trunk/plugins/bseiirfilter.c
trunk/plugins/bsesequencer.c
trunk/plugins/davcanyondelay.c
trunk/plugins/davorgan.c
trunk/plugins/davorgan.h
trunk/plugins/davsyndrum.c
trunk/plugins/davxtalstrings.c
trunk/plugins/davxtalstrings.h
Log:
Mon Dec 11 00:51:36 2006 Tim Janik <timj gtk org>
* bsesequencer.c:
* bseiirfilter.c:
* davorgan.c:
* davsyndrum.c:
* davcanyondelay.c:
* davxtalstrings.c: adapt to new tuning relative note API, add a
warning to tooltips that informs about the musical tuning specific
interpretation of note properties.
use bse_source_prepared_musical_tuning() once sources are prepared
and if possible.
Modified: trunk/plugins/ChangeLog
===================================================================
--- trunk/plugins/ChangeLog 2006-12-12 00:24:57 UTC (rev 4139)
+++ trunk/plugins/ChangeLog 2006-12-12 00:26:01 UTC (rev 4140)
@@ -1,3 +1,16 @@
+Mon Dec 11 00:51:36 2006 Tim Janik <timj gtk org>
+
+ * bsesequencer.c:
+ * bseiirfilter.c:
+ * davorgan.c:
+ * davsyndrum.c:
+ * davcanyondelay.c:
+ * davxtalstrings.c: adapt to new tuning relative note API, add a
+ warning to tooltips that informs about the musical tuning specific
+ interpretation of note properties.
+ use bse_source_prepared_musical_tuning() once sources are prepared
+ and if possible.
+
Sun Dec 10 23:56:56 2006 Tim Janik <timj gtk org>
* davxtalstrings.c (dav_xtal_strings_class_init):
Modified: trunk/plugins/bseiirfilter.c
===================================================================
--- trunk/plugins/bseiirfilter.c 2006-12-12 00:24:57 UTC (rev 4139)
+++ trunk/plugins/bseiirfilter.c 2006-12-12 00:26:01 UTC (rev 4140)
@@ -140,23 +140,25 @@
SFI_PARAM_STANDARD));
bse_object_class_add_param (object_class, _("Cutoff Frequency (All Filters)"),
PARAM_CUT_OFF_FREQ1,
- bse_param_spec_freq ("cut_off_freq", _("Cutoff [Hz]"), NULL,
+ bse_param_spec_freq ("cut_off_freq", _("Cutoff [Hz]"), _("Filter cutoff frequency"),
BSE_KAMMER_FREQUENCY / 2, BSE_MIN_OSC_FREQUENCY, BSE_MAX_OSC_FREQUENCY,
SFI_PARAM_STANDARD ":f:dial"));
bse_object_class_add_param (object_class, _("Cutoff Frequency (All Filters)"),
PARAM_CUT_OFF_NOTE1,
- bse_pspec_note ("cut_off_note", _("Note"), NULL,
- bse_note_from_freq (BSE_KAMMER_FREQUENCY / 2),
+ bse_pspec_note ("cut_off_note", _("Note"),
+ _("Filter cutoff frequency as note, converted to Herz according to the current musical tuning"),
+ bse_note_from_freq (BSE_MUSICAL_TUNING_12_TET, BSE_KAMMER_FREQUENCY / 2),
SFI_PARAM_GUI));
bse_object_class_add_param (object_class, _("Cutoff Frequency 2 (Band Pass/Stop)"),
PARAM_CUT_OFF_FREQ2,
- bse_param_spec_freq ("cut_off_freq_2", _("Cutoff [Hz]"), NULL,
+ bse_param_spec_freq ("cut_off_freq_2", _("Cutoff [Hz]"), _("Second filter cutoff frequency"),
BSE_KAMMER_FREQUENCY / 2 + FREQ_DELTA, BSE_MIN_OSC_FREQUENCY, BSE_MAX_OSC_FREQUENCY,
SFI_PARAM_STANDARD ":f:dial"));
bse_object_class_add_param (object_class, _("Cutoff Frequency 2 (Band Pass/Stop)"),
PARAM_CUT_OFF_NOTE2,
- bse_pspec_note ("cut_off_note_2", _("Note"), NULL,
- bse_note_from_freq (BSE_KAMMER_FREQUENCY / 2 + FREQ_DELTA),
+ bse_pspec_note ("cut_off_note_2", _("Note"),
+ _("Filter cutoff frequency as note, converted to Herz according to the current musical tuning"),
+ bse_note_from_freq (BSE_MUSICAL_TUNING_12_TET, BSE_KAMMER_FREQUENCY / 2 + FREQ_DELTA),
SFI_PARAM_GUI));
ichannel_id = bse_source_class_add_ichannel (source_class, "audio-in", _("Audio In"), _("Unfiltered Input"));
@@ -218,7 +220,7 @@
g_object_notify (self, "cut_off_note");
break;
case PARAM_CUT_OFF_NOTE1:
- self->cut_off_freq1 = bse_note_to_freq (sfi_value_get_note (value));
+ self->cut_off_freq1 = bse_note_to_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), sfi_value_get_note (value));
self->cut_off_freq1 = MAX (self->cut_off_freq1, BSE_MIN_OSC_FREQUENCY);
if (self->cut_off_freq1 + FREQ_DELTA > self->cut_off_freq2)
{
@@ -241,7 +243,7 @@
g_object_notify (self, "cut_off_note_2");
break;
case PARAM_CUT_OFF_NOTE2:
- self->cut_off_freq2 = bse_note_to_freq (sfi_value_get_note (value));
+ self->cut_off_freq2 = bse_note_to_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), sfi_value_get_note (value));
self->cut_off_freq2 = MAX (self->cut_off_freq2, BSE_MIN_OSC_FREQUENCY);
if (self->cut_off_freq1 + FREQ_DELTA > self->cut_off_freq2)
{
@@ -284,13 +286,13 @@
sfi_value_set_real (value, self->cut_off_freq1);
break;
case PARAM_CUT_OFF_NOTE1:
- sfi_value_set_note (value, bse_note_from_freq (self->cut_off_freq1));
+ sfi_value_set_note (value, bse_note_from_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), self->cut_off_freq1));
break;
case PARAM_CUT_OFF_FREQ2:
sfi_value_set_real (value, self->cut_off_freq2);
break;
case PARAM_CUT_OFF_NOTE2:
- sfi_value_set_note (value, bse_note_from_freq (self->cut_off_freq2));
+ sfi_value_set_note (value, bse_note_from_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), self->cut_off_freq2));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (self, param_id, pspec);
Modified: trunk/plugins/bsesequencer.c
===================================================================
--- trunk/plugins/bsesequencer.c 2006-12-12 00:24:57 UTC (rev 4139)
+++ trunk/plugins/bsesequencer.c 2006-12-12 00:26:01 UTC (rev 4140)
@@ -1,5 +1,5 @@
/* BseSequencer - BSE Sequencer
- * Copyright (C) 1999, 2000-2002 Tim Janik
+ * Copyright (C) 1999, 2000-2002, 2006 Tim Janik
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@@ -214,8 +214,9 @@
}
static gfloat*
-freq_values_from_seq (BseNoteSequence *sdata,
- gint transpose)
+freq_values_from_seq (BseMusicalTuningType musical_tuning,
+ BseNoteSequence *sdata,
+ gint transpose)
{
gfloat *v = g_new (gfloat, bse_note_sequence_length (sdata));
guint i;
@@ -227,7 +228,7 @@
if (note == SFI_NOTE_VOID)
v[i] = 0;
else
- v[i] = BSE_VALUE_FROM_FREQ (bse_note_to_freq (CLAMP (note + transpose, SFI_MIN_NOTE, SFI_MAX_NOTE)));
+ v[i] = BSE_VALUE_FROM_FREQ (bse_note_to_freq (musical_tuning, CLAMP (note + transpose, SFI_MIN_NOTE, SFI_MAX_NOTE)));
}
return v;
@@ -282,7 +283,7 @@
d->old_values = seq->freq_values;
seq->n_freq_values = bse_note_sequence_length (seq->sdata);
- seq->freq_values = freq_values_from_seq (seq->sdata, seq->transpose);
+ seq->freq_values = freq_values_from_seq (bse_source_prepared_musical_tuning (BSE_SOURCE (seq)), seq->sdata, seq->transpose);
d->n_values = seq->n_freq_values;
d->new_values = seq->freq_values;
@@ -330,7 +331,7 @@
BseSequencer *seq = BSE_SEQUENCER (source);
seq->n_freq_values = bse_note_sequence_length (seq->sdata);
- seq->freq_values = freq_values_from_seq (seq->sdata, seq->transpose);
+ seq->freq_values = freq_values_from_seq (bse_source_prepared_musical_tuning (source), seq->sdata, seq->transpose);
/* chain parent class' handler */
BSE_SOURCE_CLASS (parent_class)->prepare (source);
Modified: trunk/plugins/davcanyondelay.c
===================================================================
--- trunk/plugins/davcanyondelay.c 2006-12-12 00:24:57 UTC (rev 4139)
+++ trunk/plugins/davcanyondelay.c 2006-12-12 00:26:01 UTC (rev 4140)
@@ -1,5 +1,6 @@
/* DavCanyonDelay - DAV Canyon Delay
- * Copyright (c) 1999, 2000 David A. Bartold, 2003 Tim Janik
+ * Copyright (c) 1999, 2000 David A. Bartold
+ * Copyright (c) 2003, 2006 Tim Janik
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@@ -108,10 +109,13 @@
bse_object_class_add_param (object_class, _("IIR Low-Pass Filter"), PROP_FILTER_FREQ,
bse_param_spec_freq ("filter_freq", _("Frequency"),
_("Reflection cutoff frequency"),
- bse_note_to_freq (SFI_NOTE_C (+3)), BSE_MIN_OSC_FREQUENCY, BSE_MAX_OSC_FREQUENCY,
+ bse_note_to_freq (BSE_MUSICAL_TUNING_12_TET, SFI_NOTE_C (+3)),
+ BSE_MIN_OSC_FREQUENCY, BSE_MAX_OSC_FREQUENCY,
SFI_PARAM_STANDARD ":dial"));
bse_object_class_add_param (object_class, _("IIR Low-Pass Filter"), PROP_FILTER_NOTE,
- bse_pspec_note_simple ("filter_note", _("Note"), NULL, SFI_PARAM_GUI));
+ bse_pspec_note_simple ("filter_note", _("Note"),
+ _("Filter cutoff frequency as note, converted to Herz according to the current musical tuning"),
+ SFI_PARAM_GUI));
channel = bse_source_class_add_ichannel (source_class, "left-in", _("Left In"), _("Left Audio Input"));
g_assert (channel == DAV_CANYON_DELAY_ICHANNEL_LEFT);
@@ -130,7 +134,7 @@
self->l_to_r_feedback = 60.0;
self->r_to_l_seconds = 0.26;
self->r_to_l_feedback = -70.0;
- self->filter_freq = bse_note_to_freq (SFI_NOTE_C (+3));
+ self->filter_freq = bse_note_to_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), SFI_NOTE_C (+3));
}
static void
@@ -159,7 +163,7 @@
g_object_notify (self, "filter-note");
break;
case PROP_FILTER_NOTE:
- self->filter_freq = bse_note_to_freq (sfi_value_get_note (value));
+ self->filter_freq = bse_note_to_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), sfi_value_get_note (value));
g_object_notify (self, "filter-freq");
break;
default:
@@ -194,7 +198,7 @@
sfi_value_set_real (value, self->filter_freq);
break;
case PROP_FILTER_NOTE:
- sfi_value_set_note (value, bse_note_from_freq (self->filter_freq));
+ sfi_value_set_note (value, bse_note_from_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), self->filter_freq));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (self, param_id, pspec);
Modified: trunk/plugins/davorgan.c
===================================================================
--- trunk/plugins/davorgan.c 2006-12-12 00:24:57 UTC (rev 4139)
+++ trunk/plugins/davorgan.c 2006-12-12 00:26:01 UTC (rev 4140)
@@ -106,12 +106,15 @@
source_class->reset = dav_organ_reset;
bse_object_class_add_param (object_class, _("Base Frequency"), PARAM_BASE_FREQ,
- bse_param_spec_freq ("base_freq", _("Frequency"), NULL,
+ bse_param_spec_freq ("base_freq", _("Frequency"),
+ _("Organ frequency in Herz, i.e. the pitch of the base tone"),
BSE_KAMMER_FREQUENCY, BSE_MIN_OSC_FREQUENCY, BSE_MAX_OSC_FREQUENCY,
SFI_PARAM_STANDARD ":dial"));
bse_object_class_add_param (object_class, _("Base Frequency"),
PARAM_BASE_NOTE,
- bse_pspec_note_simple ("base_note", _("Note"), NULL, SFI_PARAM_GUI));
+ bse_pspec_note_simple ("base_note", _("Note"),
+ _("Organ frequency as note, converted to Herz according to the current musical tuning"),
+ SFI_PARAM_GUI));
bse_object_class_add_param (object_class, _("Base Frequency"),
PARAM_TRANSPOSE,
sfi_pspec_int ("transpose", _("Transpose"), _("Transposition of the frequency in semitones"),
@@ -180,12 +183,13 @@
dav_organ_update_modules (self);
break;
case PARAM_BASE_NOTE:
- self->config.freq = bse_note_to_freq (sfi_value_get_note (value));
+ self->config.freq = bse_note_to_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), sfi_value_get_note (value));
g_object_notify (G_OBJECT (self), "base_freq");
dav_organ_update_modules (self);
break;
case PARAM_TRANSPOSE:
- self->config.transpose = sfi_value_get_int (value);
+ self->transpose = sfi_value_get_int (value);
+ self->config.transpose_factor = bse_transpose_factor (bse_item_current_musical_tuning (BSE_ITEM (self)), self->transpose);
dav_organ_update_modules (self);
break;
case PARAM_FINE_TUNE:
@@ -248,10 +252,10 @@
sfi_value_set_real (value, self->config.freq);
break;
case PARAM_BASE_NOTE:
- sfi_value_set_note (value, bse_note_from_freq (self->config.freq));
+ sfi_value_set_note (value, bse_note_from_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), self->config.freq));
break;
case PARAM_TRANSPOSE:
- sfi_value_set_int (value, self->config.transpose);
+ sfi_value_set_int (value, self->transpose);
break;
case PARAM_FINE_TUNE:
sfi_value_set_int (value, self->config.fine_tune);
@@ -424,7 +428,7 @@
const gfloat *reed_table = organ->config.reed ? class->pulse_table : sine_table;
const gfloat *ifreq = BSE_MODULE_IBUFFER (module, DAV_ORGAN_ICHANNEL_FREQ);
gfloat *ovalues = BSE_MODULE_OBUFFER (module, DAV_ORGAN_OCHANNEL_MONO);
- const gdouble transpose = bse_transpose_factor (organ->config.transpose);
+ const gdouble transpose = organ->config.transpose_factor;
const gdouble fine_tune = bse_cent_factor (organ->config.fine_tune);
guint freq_256, mix_freq_256;
guint freq_256_harm0, freq_256_harm1;
Modified: trunk/plugins/davorgan.h
===================================================================
--- trunk/plugins/davorgan.h 2006-12-12 00:24:57 UTC (rev 4139)
+++ trunk/plugins/davorgan.h 2006-12-12 00:26:01 UTC (rev 4140)
@@ -39,8 +39,8 @@
typedef struct _DavOrgan DavOrgan;
typedef struct _DavOrganClass DavOrganClass;
typedef struct {
+ double transpose_factor;
gfloat freq;
- gint transpose;
gint fine_tune;
/* harmonic weights */
gfloat harm0;
@@ -59,6 +59,7 @@
BseSource parent_object;
DavOrganConfig config;
+ int transpose;
};
struct _DavOrganClass
Modified: trunk/plugins/davsyndrum.c
===================================================================
--- trunk/plugins/davsyndrum.c 2006-12-12 00:24:57 UTC (rev 4139)
+++ trunk/plugins/davsyndrum.c 2006-12-12 00:26:01 UTC (rev 4140)
@@ -89,10 +89,13 @@
bse_object_class_add_param (object_class, _("Frequency"), PROP_BASE_FREQ,
bse_param_spec_freq ("base_freq", _("Frequency"),
_("Drum frequency in Herz"),
- bse_note_to_freq (SFI_NOTE_Gis (-1)), BSE_MIN_OSC_FREQUENCY, BSE_MAX_OSC_FREQUENCY,
+ bse_note_to_freq (BSE_MUSICAL_TUNING_12_TET, SFI_NOTE_Gis (-1)),
+ BSE_MIN_OSC_FREQUENCY, BSE_MAX_OSC_FREQUENCY,
SFI_PARAM_STANDARD ":dial"));
bse_object_class_add_param (object_class, _("Frequency"), PROP_BASE_NOTE,
- bse_pspec_note_simple ("base_note", _("Note"), NULL, SFI_PARAM_GUI));
+ bse_pspec_note_simple ("base_note", _("Note"),
+ _("Drum frequency as note, converted to Herz according to the current musical tuning"),
+ SFI_PARAM_GUI));
bse_object_class_add_param (object_class, "Trigger", PROP_TRIGGER_VEL,
sfi_pspec_real ("trigger_vel", _("Trigger Velocity [%]"),
@@ -126,7 +129,7 @@
static void
dav_syn_drum_init (DavSynDrum *self)
{
- self->params.freq = bse_note_to_freq (SFI_NOTE_Gis (-1));
+ self->params.freq = bse_note_to_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), SFI_NOTE_Gis (-1));
self->params.trigger_vel = 100.0 * 0.01;
self->params.ratio = 1.0;
self->params.res = 0;
@@ -148,7 +151,7 @@
g_object_notify (self, "base-note");
break;
case PROP_BASE_NOTE:
- self->params.freq = bse_note_to_freq (sfi_value_get_note (value));
+ self->params.freq = bse_note_to_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), sfi_value_get_note (value));
g_object_notify (self, "base-freq");
break;
case PROP_RATIO:
@@ -183,7 +186,7 @@
sfi_value_set_real (value, self->params.freq);
break;
case PROP_BASE_NOTE:
- sfi_value_set_note (value, bse_note_from_freq (self->params.freq));
+ sfi_value_set_note (value, bse_note_from_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), self->params.freq));
break;
case PROP_TRIGGER_VEL:
sfi_value_set_real (value, self->params.trigger_vel * 100.0);
Modified: trunk/plugins/davxtalstrings.c
===================================================================
--- trunk/plugins/davxtalstrings.c 2006-12-12 00:24:57 UTC (rev 4139)
+++ trunk/plugins/davxtalstrings.c 2006-12-12 00:26:01 UTC (rev 4140)
@@ -111,7 +111,9 @@
SFI_PARAM_STANDARD ":dial"));
bse_object_class_add_param (object_class, _("Frequency"),
PARAM_BASE_NOTE,
- bse_pspec_note_simple ("base_note", _("Note"), NULL, SFI_PARAM_GUI));
+ bse_pspec_note_simple ("base_note", _("Note"),
+ _("String oscillation frequency as note, converted to Herz according to the current musical tuning"),
+ SFI_PARAM_GUI));
bse_object_class_add_param (object_class, _("Frequency"),
PARAM_TRANSPOSE,
sfi_pspec_int ("transpose", _("Transpose"), _("Transposition of the frequency in semitones"),
@@ -194,12 +196,12 @@
g_object_notify (G_OBJECT (self), "base_note");
break;
case PARAM_BASE_NOTE:
- self->params.freq = bse_note_to_freq (sfi_value_get_note (value));
+ self->params.freq = bse_note_to_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), sfi_value_get_note (value));
dav_xtal_strings_update_modules (self, FALSE);
g_object_notify (G_OBJECT (self), "base_freq");
break;
case PARAM_TRANSPOSE:
- self->params.transpose = sfi_value_get_int (value);
+ self->transpose = sfi_value_get_int (value);
dav_xtal_strings_update_modules (self, FALSE);
break;
case PARAM_FINE_TUNE:
@@ -248,10 +250,10 @@
sfi_value_set_real (value, self->params.freq);
break;
case PARAM_BASE_NOTE:
- sfi_value_set_note (value, bse_note_from_freq (self->params.freq));
+ sfi_value_set_note (value, bse_note_from_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), self->params.freq));
break;
case PARAM_TRANSPOSE:
- sfi_value_set_int (value, self->params.transpose);
+ sfi_value_set_int (value, self->transpose);
break;
case PARAM_FINE_TUNE:
sfi_value_set_int (value, self->params.fine_tune);
@@ -314,7 +316,7 @@
* be played, including detuning and transpose operations
*/
gdouble trigger_freq = untransposed_trigger_freq;
- trigger_freq *= bse_transpose_factor (xmod->tparams.transpose);
+ trigger_freq *= xmod->tparams.transpose_factor;
trigger_freq *= bse_cent_factor (xmod->tparams.fine_tune);
trigger_freq = CLAMP (trigger_freq, 27.5, 4000.0);
xmod->last_transposed_trigger_freq = trigger_freq;
@@ -501,6 +503,7 @@
* test triggers from the GUI.
*/
self->params.trigger_now = trigger_now;
+ self->params.transpose_factor = bse_transpose_factor (bse_source_prepared_musical_tuning (BSE_SOURCE (self)), self->transpose);
bse_source_access_modules (BSE_SOURCE (self),
xmod_access,
g_memdup (&self->params, sizeof (self->params)),
Modified: trunk/plugins/davxtalstrings.h
===================================================================
--- trunk/plugins/davxtalstrings.h 2006-12-12 00:24:57 UTC (rev 4139)
+++ trunk/plugins/davxtalstrings.h 2006-12-12 00:26:01 UTC (rev 4140)
@@ -39,13 +39,13 @@
typedef struct _DavXtalStrings DavXtalStrings;
typedef struct _DavXtalStringsClass DavXtalStringsClass;
typedef struct {
+ double transpose_factor;
gfloat freq;
gfloat trigger_vel;
gfloat note_decay;
gfloat tension_decay;
gfloat metallic_factor;
gfloat snap_factor;
- gint transpose;
gint fine_tune;
guint trigger_now : 1;
} DavXtalStringsParams;
@@ -54,6 +54,7 @@
BseSource parent_object;
DavXtalStringsParams params;
+ int transpose;
};
struct _DavXtalStringsClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]