GNOME Bugzilla – Bug 353442
DavOrgran transpose / fine_tune
Last modified: 2006-08-29 18:51:40 UTC
Just like #353135, I propose to add fine tuning and transposing properties to the DavOrgan module. Patch follows.
Created attachment 71849 [details] [review] Proposed DavOrgan patch Tue Aug 29 19:33:50 2006 Stefan Westerfeld <stefan@space.twc.de> * davorgan.[hc]: Add transpose and fine_tune settings, just like they can be found in the oscillator code. Fixed a few minor i18n bugs in property translation markup.
Comment on attachment 71849 [details] [review] Proposed DavOrgan patch >@@ -376,14 +403,16 @@ dav_organ_process (BseModule *module, > 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 fine_tune = bse_cent_factor (organ->config.fine_tune); > guint freq_256, mix_freq_256; > guint freq_256_harm0, freq_256_harm1; > guint i; > > if (BSE_MODULE_ISTREAM (module, DAV_ORGAN_ICHANNEL_FREQ).connected) >- freq_256 = BSE_FREQ_FROM_VALUE (ifreq[0]) * 256 + 0.5; >+ freq_256 = (BSE_FREQ_FROM_VALUE (ifreq[0]) * transpose * fine_tune) * 256 + 0.5; these... > else >- freq_256 = organ->config.freq * 256 + 0.5; >+ freq_256 = (organ->config.freq * transpose * fine_tune) * 256 + 0.5; and these parenthesis are unneccessary, multiplications need to not be priorized against multiplications, and they'll be executed in order anyways. > mix_freq_256 = bse_engine_sample_freq() * 256; > freq_256_harm0 = freq_256 / 2; > freq_256_harm1 = freq_256; the rest of the patch looks fine, please apply with the parenthesis removed.
Ok, I committed the patch without parenthesis, as suggested.