From b0546e5e7f7044019892543c6c82029db8d564a7 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Thu, 15 Sep 2011 12:14:55 +0000 Subject: moved attic to a branch of it's own --- .../synti/simpledrums/simpledrums.cpp | 1719 -------------------- 1 file changed, 1719 deletions(-) delete mode 100644 attic/muse_qt4_evolution/synti/simpledrums/simpledrums.cpp (limited to 'attic/muse_qt4_evolution/synti/simpledrums/simpledrums.cpp') diff --git a/attic/muse_qt4_evolution/synti/simpledrums/simpledrums.cpp b/attic/muse_qt4_evolution/synti/simpledrums/simpledrums.cpp deleted file mode 100644 index 93be946d..00000000 --- a/attic/muse_qt4_evolution/synti/simpledrums/simpledrums.cpp +++ /dev/null @@ -1,1719 +0,0 @@ -// -// C++ Implementation: simplesynth -// -// Description: -// -// -// Author: Mathias Lundgren , (C) 2004 -// -// Copyright: See COPYING file that comes with this distribution -// -// - -#include "muse/midictrl.h" -#include "muse/midi.h" -#include "libsynti/midievent.h" -#include "simpledrums.h" -// #include -#include - -const char* SimpleSynth::synth_state_descr[] = - { - "SS_INITIALIZING", - "SS_LOADING_SAMPLE", - "SS_CLEARING_SAMPLE", - "SS_RUNNING" - }; - -const char* SimpleSynth::channel_state_descr[] = - { - "SS_CHANNEL_INACTIVE", - "SS_SAMPLE_PLAYING" - }; - -#define SWITCH_SYNTH_STATE(state)\ -synth_state = state; \ -if (SS_DEBUG_STATE) \ - fprintf (stderr, "SS STATE: %s\n", SimpleSynth::synth_state_descr[state]); - -#define SWITCH_CHAN_STATE(ch, s)\ -channels[ch].state = s; \ -if (SS_DEBUG_STATE) \ - fprintf (stderr, "SS CHAN %d STATE: %s\n", ch, SimpleSynth::channel_state_descr[s]); - -#define SS_CHANNEL_VOLUME_QUOT 100.0 -#define SS_MASTER_VOLUME_QUOT 100.0 -int SS_samplerate; - -#define SS_LOG_MAX 0 -#define SS_LOG_MIN -10 -#define SS_LOG_OFFSET SS_LOG_MIN - - -// -// Map plugin parameter on domain [SS_PLUGIN_PARAM_MIN, SS_PLUGIN_PARAM_MAX] to domain [SS_LOG_MIN, SS_LOG_MAX] (log domain) -// -float SS_map_pluginparam2logdomain(int pluginparam_val) - { - float scale = (float) (SS_LOG_MAX - SS_LOG_MIN)/ (float) SS_PLUGIN_PARAM_MAX; - float scaled = (float) pluginparam_val * scale; - float mapped = scaled + SS_LOG_OFFSET; - return mapped; - } -// -// Map plugin parameter on domain to domain [SS_LOG_MIN, SS_LOG_MAX] to [SS_PLUGIN_PARAM_MIN, SS_PLUGIN_PARAM_MAX] (from log-> [0,127]) -// (inverse func to the above) -int SS_map_logdomain2pluginparam(float pluginparam_log) - { - float mapped = pluginparam_log - SS_LOG_OFFSET; - float scale = (float) SS_PLUGIN_PARAM_MAX / (float) (SS_LOG_MAX - SS_LOG_MIN); - int scaled = (int) round(mapped * scale); - return scaled; - } - -//--------------------------------------------------------- -// SimpleSynth -//--------------------------------------------------------- -SimpleSynth::SimpleSynth(int sr) - : Mess(SS_AUDIO_CHANNELS) - { - SS_TRACE_IN - SS_samplerate = sr; - SS_initPlugins(); - - simplesynth_ptr = this; - master_vol = 100.0 / SS_MASTER_VOLUME_QUOT; - master_vol_ctrlval = 100; - - //initialize - for (int i=0; idata; - delete channels[i].sample; - } - } - simplesynth_ptr = NULL; - - SS_DBG("Deleting pluginlist"); - //Cleanup plugins: - for (iPlugin i = plugins.begin(); i != plugins.end(); ++i) { - delete (*i); - } - plugins.clear(); - - SS_DBG("Deleting sendfx buffers"); - //Delete sendfx buffers: - for (int i=0; i