~npisanti/folderkit

c51bcb337f97c9975b2ce40ff863e59e27a772c3 — Nicola Pisanti 2 months ago 02c8c75
tweaks operator again
3 files changed, 14 insertions(+), 8 deletions(-)

M src/parameters_init.c
M src/parameters_init.h
M src/voice.c
M src/parameters_init.c => src/parameters_init.c +7 -0
@@ 29,6 29,7 @@ int fk_parameters_init(struct fk_parameters_t * params, const char * path)
	params->sine_size = 1024;
	params->master_amp = 1.0f;
	params->master_clip = (float)dB(-2.0);
	params->default_op_amp = (float)dB(-24.0);
	// -----------------------

	// those should be set by the audio backend init


@@ 308,6 309,12 @@ static int fk__parameters_read_file(struct fk_parameters_t * params, char * stri
		}

		if (fk__match_parameter(stringbuffer, valuebuffer,
		                        "default_operators_gain")) {
			double value = atof(valuebuffer);
			params->default_op_amp = (float)dB(value);
		}

		if (fk__match_parameter(stringbuffer, valuebuffer,
		                        "master_gain")) {
			double value = atof(valuebuffer);
			params->master_amp = (float)dB(value);

M src/parameters_init.h => src/parameters_init.h +1 -0
@@ 22,6 22,7 @@ struct fk_parameters_t {
	float drift_amount;
	float master_clip;
	float master_amp;
	float default_op_amp;
	float rev_send_mult;

	unsigned sine_size;

M src/voice.c => src/voice.c +6 -8
@@ 286,15 286,17 @@ void fk_voice_trigger(struct fk_voice_t * voice, unsigned argc, int * argv)

		case orca_o:
			voice->op->use_env = voice->use_mod_env;
			voice->op->amp = (float)dB(-12.0);
			voice->op->amp = voice->parameters_link->default_op_amp;
			voice->op->mod_amount = 0.0f;
			if (argc >= 9) {
				fx_mode = (unsigned)argv[7];
				freq = voice->tuning_link->oct[argv[8]];
				freq *= transpose;
			}
			if (argc >= 10) {
				float mod = (float)argv[9];
				freq *= voice->tuning_link->xpose[argv[9]];
			}
			if (argc >= 11) {
				float mod = (float)argv[10];
				mod /= 16.0f;
				if (mod > 1.0f) {
					mod = 1.0f;


@@ 302,14 304,10 @@ void fk_voice_trigger(struct fk_voice_t * voice, unsigned argc, int * argv)
				mod *= mod;
				voice->op->mod_amount = mod * 4.0f;
			}
			if (argc >= 11) {
				fx_mod_amt = (float)argv[10];
			}
			if (argc >= 12) {
				voice->op->amp = (float)dB((double)(-6 - argv[11]));
				voice->op->amp = (float)dB((double)(-12 - argv[11]));
			}
			break;

		case orca_r:
			voice->rm->mix = 1.0f;
			if (argc >= 9) {