diff options
Diffstat (limited to 'audio/softsynth/mt32/mt32emu.h')
| -rw-r--r-- | audio/softsynth/mt32/mt32emu.h | 140 |
1 files changed, 92 insertions, 48 deletions
diff --git a/audio/softsynth/mt32/mt32emu.h b/audio/softsynth/mt32/mt32emu.h index 6eedf04bc0..a8685a30e6 100644 --- a/audio/softsynth/mt32/mt32emu.h +++ b/audio/softsynth/mt32/mt32emu.h @@ -1,37 +1,70 @@ -/* Copyright (c) 2003-2005 Various contributors +/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher + * Copyright (C) 2011 Dean Beeler, Jerome Fisher, Sergey V. Mikayev * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2.1 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MT32EMU_MT32EMU_H #define MT32EMU_MT32EMU_H // Debugging -// Show the instruments played -#define MT32EMU_MONITOR_INSTRUMENTS 1 -// Shows number of partials MT-32 is playing, and on which parts + +// 0: Standard debug output is not stamped with the rendered sample count +// 1: Standard debug output is stamped with the rendered sample count +// NOTE: The "samplestamp" corresponds to the end of the last completed rendering run. +// This is important to bear in mind for debug output that occurs during a run. +#define MT32EMU_DEBUG_SAMPLESTAMPS 0 + +// 0: No debug output for initialisation progress +// 1: Debug output for initialisation progress +#define MT32EMU_MONITOR_INIT 0 + +// 0: No debug output for MIDI events +// 1: Debug output for weird MIDI events +#define MT32EMU_MONITOR_MIDI 0 + +// 0: No debug output for note on/off +// 1: Basic debug output for note on/off +// 2: Comprehensive debug output for note on/off +#define MT32EMU_MONITOR_INSTRUMENTS 0 + +// 0: No debug output for partial allocations +// 1: Show partial stats when an allocation fails +// 2: Show partial stats with every new poly +// 3: Show individual partial allocations/deactivations #define MT32EMU_MONITOR_PARTIALS 0 -// Determines how the waveform cache file is handled (must be regenerated after sampling rate change) -#define MT32EMU_WAVECACHEMODE 0 // Load existing cache if possible, otherwise generate and save cache -//#define MT32EMU_WAVECACHEMODE 1 // Load existing cache if possible, otherwise generate but don't save cache -//#define MT32EMU_WAVECACHEMODE 2 // Ignore existing cache, generate and save cache -//#define MT32EMU_WAVECACHEMODE 3 // Ignore existing cache, generate but don't save cache + +// 0: No debug output for sysex +// 1: Basic debug output for sysex +#define MT32EMU_MONITOR_SYSEX 0 + +// 0: No debug output for sysex writes to the timbre areas +// 1: Debug output with the name and location of newly-written timbres +// 2: Complete dump of timbre parameters for newly-written timbres +#define MT32EMU_MONITOR_TIMBRES 0 + +// 0: No TVA/TVF-related debug output. +// 1: Shows changes to TVA/TVF target, increment and phase. +#define MT32EMU_MONITOR_TVA 0 +#define MT32EMU_MONITOR_TVF 0 + + +// 0: Use LUTs to speedup WG +// 1: Use precise float math +#define MT32EMU_ACCURATE_WG 1 + +#define MT32EMU_USE_EXTINT 0 // Configuration // The maximum number of partials playing simultaneously @@ -39,32 +72,43 @@ // The maximum number of notes playing simultaneously per part. // No point making it more than MT32EMU_MAX_PARTIALS, since each note needs at least one partial. #define MT32EMU_MAX_POLY 32 -// This calculates the exact frequencies of notes as they are played, instead of offsetting from pre-cached semitones. Potentially very slow. -#define MT32EMU_ACCURATENOTES 0 - -#if (defined (_MSC_VER) && defined(_M_IX86)) -#define MT32EMU_HAVE_X86 -#elif defined(__GNUC__) -#if __GNUC__ >= 3 && defined(__i386__) -#define MT32EMU_HAVE_X86 -#endif -#endif -#ifdef MT32EMU_HAVE_X86 -#define MT32EMU_USE_MMX 1 -#else -#define MT32EMU_USE_MMX 0 -#endif +// If non-zero, deletes reverb buffers that are not in use to save memory. +// If zero, keeps reverb buffers for all modes around all the time to avoid allocating/freeing in the critical path. +#define MT32EMU_REDUCE_REVERB_MEMORY 1 + +// 0: Use standard Freeverb +// 1: Use AReverb (currently not properly tuned) +#define MT32EMU_USE_AREVERBMODEL 0 + +namespace MT32Emu +{ +// The higher this number, the more memory will be used, but the more samples can be processed in one run - +// various parts of sample generation can be processed more efficiently in a single run. +// A run's maximum length is that given to Synth::render(), so giving a value here higher than render() is ever +// called with will give no gain (but simply waste the memory). +// Note that this value does *not* in any way impose limitations on the length given to render(), and has no effect +// on the generated audio. +// This value must be >= 1. +const unsigned int MAX_SAMPLES_PER_RUN = 4096; -#include "freeverb.h" +// This determines the amount of memory available for simulating delays. +// If set too low, partials aborted to allow other partials to play will not end gracefully, but will terminate +// abruptly and potentially cause a pop/crackle in the audio output. +// This value must be >= 1. +const unsigned int MAX_PRERENDER_SAMPLES = 1024; +} -#include "structures.h" -#include "i386.h" -#include "mt32_file.h" -#include "tables.h" -#include "partial.h" -#include "partialManager.h" -#include "part.h" -#include "synth.h" +#include "Structures.h" +#include "common/file.h" +#include "Tables.h" +#include "Poly.h" +#include "LA32Ramp.h" +#include "TVA.h" +#include "TVP.h" +#include "TVF.h" +#include "Partial.h" +#include "Part.h" +#include "Synth.h" #endif |
