mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 06:51:54 +00:00
Filter now remains on once enabled.
This commit is contained in:
parent
1308a710a6
commit
047e0ebdfa
3 changed files with 78 additions and 167 deletions
|
@ -1,3 +1,10 @@
|
|||
2004-03-30 Josh Green <jgreen@users.sourceforge.net>
|
||||
|
||||
* src/fluid_voice.c (fluid_voice_write): Altered filter turn-off
|
||||
optimization to not turn filter off once it has been
|
||||
enabled. There is still a potential for a click when it gets
|
||||
turned on though, which needs to be dealt with.
|
||||
|
||||
2004-03-30 Peter Hanappe <peter@hanappe.com>
|
||||
|
||||
* src/fluid_dsp_core.c: I've split up the dsp core file in three
|
||||
|
|
|
@ -1,271 +1,172 @@
|
|||
/* src/config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/*
|
||||
Define to enable ALSA driver */
|
||||
/* Define to enable ALSA driver */
|
||||
#undef ALSA_SUPPORT
|
||||
|
||||
/*
|
||||
whether or not we are supporting CoreAudio */
|
||||
/* whether or not we are supporting CoreAudio */
|
||||
#undef COREAUDIO_SUPPORT
|
||||
|
||||
/*
|
||||
Define if building for Mac OS X Darwin
|
||||
*/
|
||||
/* Define if building for Mac OS X Darwin */
|
||||
#undef DARWIN
|
||||
|
||||
/*
|
||||
Define to activate debugging message */
|
||||
/* Define to activate debugging message */
|
||||
#undef DEBUG
|
||||
|
||||
/*
|
||||
Use the SSE instructions of Pentium 3 and
|
||||
higher */
|
||||
/* Use the SSE instructions of Pentium 3 and higher */
|
||||
#undef ENABLE_SSE
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <arpa/inet.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#undef HAVE_ARPA_INET_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <dlfcn.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <errno.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <errno.h> header file. */
|
||||
#undef HAVE_ERRNO_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <fcntl.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <inttypes.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/*
|
||||
whether or not we are supporting ladcca */
|
||||
/* whether or not we are supporting ladcca */
|
||||
#undef HAVE_LADCCA
|
||||
|
||||
/*
|
||||
Define to 1 if you have the `dl'
|
||||
library (-ldl). */
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
/*
|
||||
Define to 1 if you have the `MidiShare'
|
||||
library (-lMidiShare). */
|
||||
/* Define to 1 if you have the `MidiShare' library (-lMidiShare). */
|
||||
#undef HAVE_LIBMIDISHARE
|
||||
|
||||
/*
|
||||
Define to 1 if you have the `pthread'
|
||||
library (-lpthread). */
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#undef HAVE_LIBPTHREAD
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <limits.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <machine/soundcard.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <machine/soundcard.h> header file. */
|
||||
#undef HAVE_MACHINE_SOUNDCARD_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <math.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <math.h> header file. */
|
||||
#undef HAVE_MATH_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <memory.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <MidiShare.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <MidiShare.h> header file. */
|
||||
#undef HAVE_MIDISHARE_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <netinet/in.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#undef HAVE_NETINET_IN_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <netinet/tcp.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
||||
#undef HAVE_NETINET_TCP_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <pthread.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#undef HAVE_PTHREAD_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <signal.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#undef HAVE_SIGNAL_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <stdarg.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <stdarg.h> header file. */
|
||||
#undef HAVE_STDARG_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <stdint.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <stdio.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#undef HAVE_STDIO_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <stdlib.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <strings.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <string.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <sys/ioctl.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#undef HAVE_SYS_IOCTL_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <sys/mman.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <sys/mman.h> header file. */
|
||||
#undef HAVE_SYS_MMAN_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <sys/socket.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#undef HAVE_SYS_SOCKET_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <sys/soundcard.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <sys/soundcard.h> header file. */
|
||||
#undef HAVE_SYS_SOUNDCARD_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <sys/stat.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <sys/time.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <sys/types.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <unistd.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/*
|
||||
Define to 1 if you have the <windows.h>
|
||||
header file. */
|
||||
/* Define to 1 if you have the <windows.h> header file. */
|
||||
#undef HAVE_WINDOWS_H
|
||||
|
||||
/*
|
||||
Define to enable JACK driver */
|
||||
/* Define to enable JACK driver */
|
||||
#undef JACK_SUPPORT
|
||||
|
||||
/*
|
||||
Include the LADSPA Fx unit */
|
||||
/* Include the LADSPA Fx unit */
|
||||
#undef LADSPA
|
||||
|
||||
/*
|
||||
Define to enable MidiShare driver */
|
||||
/* Define to enable MidiShare driver */
|
||||
#undef MIDISHARE_SUPPORT
|
||||
|
||||
/*
|
||||
Define if using the MinGW32 environment */
|
||||
/* Define if using the MinGW32 environment */
|
||||
#undef MINGW32
|
||||
|
||||
/*
|
||||
Define to enable OSS driver */
|
||||
/* Define to enable OSS driver */
|
||||
#undef OSS_SUPPORT
|
||||
|
||||
/*
|
||||
Name of package */
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/*
|
||||
Define to the address where bug reports for
|
||||
this package should be sent. */
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/*
|
||||
Define to the full name of this package.
|
||||
*/
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/*
|
||||
Define to the full name and version of
|
||||
this package. */
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/*
|
||||
Define to the one symbol short name of
|
||||
this package. */
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/*
|
||||
Define to the version of this package. */
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/*
|
||||
Define to 1 if you have the ANSI
|
||||
C header files. */
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/*
|
||||
Define to use long long type, where appropriate
|
||||
*/
|
||||
/* Define to use long long type, where appropriate */
|
||||
#undef USE_LONGLONG
|
||||
|
||||
/*
|
||||
Version number of package */
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/*
|
||||
Define to do all DSP in single floating
|
||||
point precision */
|
||||
/* Define to do all DSP in single floating point precision */
|
||||
#undef WITH_FLOAT
|
||||
|
||||
/*
|
||||
Define to profile the DSP code */
|
||||
/* Define to profile the DSP code */
|
||||
#undef WITH_PROFILING
|
||||
|
||||
/*
|
||||
Define to use the readline library for line
|
||||
editing */
|
||||
/* Define to use the readline library for line editing */
|
||||
#undef WITH_READLINE
|
||||
|
||||
/*
|
||||
Define to 1 if your processor stores words
|
||||
with the most significant byte first (like Motorola and
|
||||
SPARC, unlike Intel and VAX). */
|
||||
/* Define to 1 if your processor stores words with the most significant byte
|
||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#undef WORDS_BIGENDIAN
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
|
|
|
@ -628,18 +628,21 @@ fluid_voice_write(fluid_voice_t* voice,
|
|||
* drops down, when moving the pitch bend wheel only slightly. */
|
||||
//fres=440;voice->q_lin=100;
|
||||
|
||||
if (fres < 5) {
|
||||
fres = 5;
|
||||
} else if ((fres > FLUID_MAX_AUDIBLE_FILTER_FC)
|
||||
&& (voice->q_lin < FLUID_MIN_AUDIBLE_FILTER_Q)) {
|
||||
/* Beyond a certain point the filter does not change the sound
|
||||
* much. Turn it off to save CPU cycles. */
|
||||
/* Fixme: When the filter has been on once for a voice, keep it on forever. */
|
||||
|
||||
/* FIXME - Still potential for a click during turn on, can we interpolate
|
||||
between 20khz cutoff and 0 Q? */
|
||||
|
||||
/* if filter has not yet started and filter cutoff and Q don't
|
||||
exceed "audible" thresholds, then don't turn on the filter.
|
||||
Once the filter is turned on, it remains on. */
|
||||
if (voice->filter_startup && fres > FLUID_MAX_AUDIBLE_FILTER_FC
|
||||
&& voice->q_lin < FLUID_MIN_AUDIBLE_FILTER_Q)
|
||||
dsp_use_filter_flag = 0;
|
||||
}
|
||||
|
||||
if (dsp_use_filter_flag && (abs(fres - voice->last_fres) > 0.01)) {
|
||||
|
||||
else if (fres < 5) fres = 5;
|
||||
|
||||
/* if filter enabled and there is a significant frequency change.. */
|
||||
if (dsp_use_filter_flag && (abs(fres - voice->last_fres) > 0.01)) {
|
||||
|
||||
/* The filter coefficients have to be recalculated (filter
|
||||
* parameters have changed). Recalculation for various reasons is
|
||||
* forced by setting last_fres to -1. The flag filter_startup
|
||||
|
|
Loading…
Reference in a new issue