diff --git a/JuceLibraryCode/AppConfig.h b/JuceLibraryCode/AppConfig.h index 7a4239e..01dff10 100644 --- a/JuceLibraryCode/AppConfig.h +++ b/JuceLibraryCode/AppConfig.h @@ -236,13 +236,13 @@ #define JucePlugin_EditorRequiresKeyboardFocus 0 #endif #ifndef JucePlugin_Version - #define JucePlugin_Version 0.5.6 + #define JucePlugin_Version 0.5.7 #endif #ifndef JucePlugin_VersionCode - #define JucePlugin_VersionCode 0x00050006 + #define JucePlugin_VersionCode 0x00050007 #endif #ifndef JucePlugin_VersionString - #define JucePlugin_VersionString "0.5.6" + #define JucePlugin_VersionString "0.5.7" #endif #ifndef JucePlugin_VSTUniqueID #define JucePlugin_VSTUniqueID JucePlugin_PluginCode diff --git a/Love_and_Horror_V2.fxb b/Love_and_Horror_V2.fxb index 8c3fb54..08b95f9 100644 Binary files a/Love_and_Horror_V2.fxb and b/Love_and_Horror_V2.fxb differ diff --git a/Source/JaySynth.cpp b/Source/JaySynth.cpp index 68918f3..e7ec38e 100644 --- a/Source/JaySynth.cpp +++ b/Source/JaySynth.cpp @@ -24,6 +24,8 @@ #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif +#define WITH_OLD_HUMANIZE + //============================================================================== /** A JaySynth that just plays incredible sounds.. */ JaySynth::JaySynth (int num_voices, String pathToWaves) @@ -150,6 +152,36 @@ synth_float_t JaySynth::getVolume(void) void JaySynth::humanizeParam (int paramID, bool useRandom, UINT32 random_seed, synth_float_t spread_min, synth_float_t variance) { +#ifdef WITH_OLD_HUMANIZE + int j; + synth_float_t spread; + + noise_gen_t noise; + + Noise_Init(&noise, random_seed); + + for (j=0; j < max_num_voices; j++) + { + if (useRandom) + do + { + spread = Noise_Gaussian(&noise, variance*sqrt(1.f/12), 0.0); + } while (fabs(spread) < spread_min); + + else + spread = variance*((synth_float_t)j/max_num_voices -0.5); + + paramInfoSet(&humanize_voice_param[paramID][j], + /*base*/getParamInfo(paramID)->base, + /*kexp*/getParamInfo(paramID)->kexp, + /*scenter*/getParamInfo(paramID)->scenter, + /*pmin*/getParamInfo(paramID)->pmin , + /*pcenter*/-1E6/*getParamInfo(i)->pcenter*/, + /*pmax*/getParamInfo(paramID)->pmax * (1+spread), + /*pinterval*/0); + } + Noise_Free(&noise); +#else int j; synth_float_t spread, spread_dir, value_lo, value_hi; @@ -185,8 +217,8 @@ void JaySynth::humanizeParam (int paramID, bool useRandom, UINT32 random_seed, s spread_dir = -spread_dir; } - Noise_Free(&noise); - + Noise_Free(&noise); +#endif } void JaySynth::setSampleRate (synth_float_t sampleRate) @@ -216,6 +248,16 @@ void JaySynth::humanizeModeChanged(void) void JaySynth::humanizeVarianceChanged_VCO(void) { +#ifdef WITH_OLD_HUMANIZE +// humanizeParam(SYNTH_PARAM_TUNE, true, 0x1234561, 0, 10*humanize_var_vco); + humanizeParam(SYNTH_PARAM_OSC_0_DETUNE, true, 0x293857, 0, 10*humanize_var_vco); + humanizeParam(SYNTH_PARAM_OSC_1_DETUNE, true, 0x137573, 0, 10*humanize_var_vco); + + // Re-Read parameter +// setParameter(SYNTH_PARAM_TUNE, params[SYNTH_PARAM_TUNE]); + setParameter(SYNTH_PARAM_OSC_0_DETUNE, params[SYNTH_PARAM_OSC_0_DETUNE]); + setParameter(SYNTH_PARAM_OSC_1_DETUNE, params[SYNTH_PARAM_OSC_1_DETUNE]); +#else int i; synth_float_t f_ref; noise_gen_t noise; @@ -233,7 +275,7 @@ void JaySynth::humanizeVarianceChanged_VCO(void) } Noise_Free(&noise); - +#endif } void JaySynth::humanizeVarianceChanged_VCF(void) diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 2389e43..9ea9a39 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -8,8 +8,6 @@ file:/D:/home/jens/work/develope/repos/projects/JaySynth/Source/JaySynth.cpp - file:/D:/home/jens/work/develope/repos/projects/JaySynth/Makefile - file:/D:/home/jens/work/develope/repos/projects/JaySynth/Source/synth/synth_debug.c