[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [fluid-dev] [PATCH] Effect level clip
From: |
Josh Green |
Subject: |
Re: [fluid-dev] [PATCH] Effect level clip |
Date: |
Sun, 02 Sep 2007 20:40:35 -0700 |
Hello David,
I was noticing a section of code in your effect level clip patch which
is causing about a 1% or so decrease in performance. Here is the code
in question:
diff -ubr fluidsynth-1.0.7/src/fluid_synth.c
fluidsynth-modified/src/fluid_synth.c
--- fluidsynth-1.0.7/src/fluid_synth.c 2006-02-19 07:19:07.000000000 +0000
+++ fluidsynth-modified/src/fluid_synth.c 2007-07-30 22:06:44.000000000
+0000
@@ -1762,6 +1762,8 @@
fluid_real_t* chorus_buf;
int byte_size = FLUID_BUFSIZE * sizeof(fluid_real_t);
double prof_ref = fluid_profile_ref();
+ fluid_real_t chorus_level = fluid_chorus_get_level(synth->chorus);
+ fluid_real_t reverb_level = fluid_revmodel_getlevel(synth->reverb);
/* fluid_mutex_lock(synth->busy); /\* Here comes the audio thread. Lock the
synth. *\/ */
@@ -1820,11 +1822,20 @@
left_buf = synth->left_buf[auchan];
right_buf = synth->right_buf[auchan];
+ fluid_voice_set_param(voice, GEN_CHORUSSEND,
+ 1000.0
+ * (chorus_level - FLUID_CHORUS_DEFAULT_LEVEL)
+ / FLUID_CHORUS_DEFAULT_LEVEL, 1 /* ? */);
+ fluid_voice_set_param(voice, GEN_REVERBSEND,
+ 1000.0
+ * (reverb_level - FLUID_REVERB_DEFAULT_LEVEL)
+ / FLUID_REVERB_DEFAULT_LEVEL, 1 /* ? */);
I was hoping you might be able to comment on why the calls to
fluid_voice_set_param occurs within the fluid_synth_one_block() function
(in other words, it gets assigned every 64 output samples for each
voice, whether the value has changed or not). It seems like these calls
could instead occur when the chorus or reverb levels are assigned?
Perhaps I'm overlooking something though.
Thanks again for the patches! Cheers.
Josh
- Re: [fluid-dev] [PATCH] Effect level clip,
Josh Green <=
- Re: [fluid-dev] [PATCH] Effect level clip, David Hilvert, 2007/09/03
- Re: [fluid-dev] [PATCH] Effect level clip, Josh Green, 2007/09/17
- Re: [fluid-dev] [PATCH] Effect level clip, David Hilvert, 2007/09/17
- Re: [fluid-dev] [PATCH] Effect level clip, Josh Green, 2007/09/17
- Re: [fluid-dev] [PATCH] Effect level clip, Rui Nuno Capela, 2007/09/17
- Re: [fluid-dev] [PATCH] Effect level clip, Josh Green, 2007/09/17
- Re: [fluid-dev] [PATCH] Effect level clip, David Hilvert, 2007/09/17
- Re: [fluid-dev] [PATCH] Effect level clip, Josh Green, 2007/09/17
- Re: [fluid-dev] [PATCH] Effect level clip, David Hilvert, 2007/09/17
- Re: [fluid-dev] [PATCH] Effect level clip, Josh Green, 2007/09/17