38 float NoiseGate::fnglevel = 0;
39 float NoiseGate::ngate = 1;
40 bool NoiseGate::off =
true;
48 inputdef.
id =
"noise_gate";
49 inputdef.
name =
N_(
"Noise Gate");
63 inline float sqrf(
float x) {
67 void NoiseGate::inputlevel_compute(
int count,
float *input,
float *output,
PluginDef*) {
69 for (
int i = 0; i < count; i++) {
70 sumnoise +=
sqrf(input[i]);
72 if (sumnoise/count >
sqrf(fnglevel * 0.01)) {
74 }
else if (ngate > 0.01) {
79 int NoiseGate::noisegate_register(
const ParamReg& reg) {
80 reg.
registerVar(
"noise_gate.threshold",
N_(
"Threshold"),
"S",
"", &fnglevel,
81 0.017f, 0.01f, 0.31f, 0.001f);
85 void NoiseGate::outputgate_compute(
int count,
float *input,
float *output,
PluginDef*) {
90 *output++ = ngate * *input++;
118 fIRFile = jcset.fIRFile;
119 fIRDir = jcset.fIRDir;
121 fOffset = jcset.fOffset;
122 fLength = jcset.fLength;
123 fDelay = jcset.fDelay;
124 gainline = jcset.gainline;
125 fGainCor = jcset.fGainCor;
130 if (fIRFile.empty()) {
133 return Glib::build_filename(fIRDir, fIRFile);
138 fIRDir = Glib::path_get_dirname(name);
139 fIRFile= Glib::path_get_basename(name);
144 w.
write_kv(
"jconv.IRFile", fIRFile);
147 w.
write_kv(
"jconv.GainCor", fGainCor);
148 w.
write_kv(
"jconv.Offset", fOffset);
149 w.
write_kv(
"jconv.Length", fLength);
153 for (
unsigned int i = 0; i < gainline.size(); i++) {
155 w.
write(gainline[i].i);
156 w.
write(gainline[i].g);
164 if (fIRFile != jcset.fIRFile || fIRDir != jcset.fIRDir) {
167 if (fOffset != jcset.fOffset || fLength != jcset.fLength || fDelay != jcset.fDelay) {
170 if (fGainCor != jcset.fGainCor) {
173 if (fGainCor && abs(fGain - jcset.fGain) > 1e-4 * (fGain + jcset.fGain)) {
176 if (gainline == jcset.gainline) {
193 gainline.push_back(p);
202 if (jp.
read_kv(
"jconv.IRFile", fIRFile) ||
203 jp.
read_kv(
"jconv.IRDir", fIRDir) ||
204 jp.
read_kv(
"jconv.Gain", fGain) ||
205 jp.
read_kv(
"jconv.GainCor", fGainCor) ||
206 jp.
read_kv(
"jconv.Offset", fOffset) ||
207 jp.
read_kv(
"jconv.Length", fLength) ||
208 jp.
read_kv(
"jconv.Delay", fDelay)) {
219 if (!fIRFile.empty()) {
220 if (fIRDir.empty()) {
234 :
Parameter(
id,
"", tp_special, None,
true,
false),
241 std_value.fGainCor =
true;
242 std_value.fGain = 0.598717;
243 const int ir_len = 112561;
244 std_value.fLength = ir_len;
245 static gain_points g[2] = {{0, 0}, {ir_len-1, 0}};
246 std_value.gainline = Gainline(g,
sizeof(g) /
sizeof(g[0]));
264 value(&value_storage),
271 std_value.readJSON(jp);
274 "JConvParameter", Glib::ustring::compose(
"%1: unknown key: %2",
_id, jp.
current_value()));
284 jw.
write_key(
"value"); value->writeJSON(jw);
285 jw.
write_key(
"std_value"); std_value.writeJSON(jw);
295 json_value = std_value;
300 value->writeJSON(jw);
304 json_value.readJSON(jp);
308 return json_value == *value;
329 #include "faust/jconv_post.cc" 330 #include "faust/jconv_post_mono.cc" 359 while (conv.is_runnable()) {
362 conv.set_buffersize(size);
367 conv.set_buffersize(size);
375 conv.set_not_runnable();
378 while (!conv.checkstate());
385 bool rc = conv.configure(
388 int policy, priority;
390 if (!rc || !conv.start(policy, priority)) {
396 if (!conv.get_buffersize() || !conv.get_samplerate()) {
405 while (!conv.checkstate());
406 if (conv.is_runnable()) {
420 int policy, priority;
422 return conv.start(policy, priority);
444 void ConvolverStereoAdapter::convolver(
int count,
float *input0,
float *input1,
447 if (
self.conv.is_runnable()) {
448 float conv_out0[count];
449 float conv_out1[count];
450 if (
self.conv.compute(count, input0, input1, conv_out0, conv_out1)) {
451 self.jc_post.compute(count, input0, input1,
452 conv_out0, conv_out1, output0, output1);
457 if (input0 != output0) {
458 memcpy(output0, input0, count *
sizeof(
float));
460 if (input1 != output1) {
461 memcpy(output1, input1, count *
sizeof(
float));
465 int ConvolverStereoAdapter::convolver_register(
const ParamReg& reg) {
468 self.jcp->signal_changed().connect(
471 return self.jc_post.register_par(reg);
474 void ConvolverStereoAdapter::convolver_init(
unsigned int samplingFreq,
PluginDef *p) {
478 self.conv.stop_process();
479 self.conv.set_samplerate(samplingFreq);
480 self.jc_post.init(samplingFreq);
481 while (
self.conv.is_runnable()) {
482 self.conv.checkstate();
486 self.conv.set_samplerate(samplingFreq);
487 self.jc_post.init(samplingFreq);
491 int ConvolverStereoAdapter::activate(
bool start,
PluginDef *p) {
495 if (
self.
activated &&
self.conv.is_runnable()) {
503 self.activated =
start;
505 if (
self.jc_post.activate(
true) != 0) {
513 self.conv.stop_process();
514 self.jc_post.activate(
false);
538 void ConvolverMonoAdapter::convolver(
int count,
float *input,
float *output,
PluginDef* plugin) {
540 if (
self.conv.is_runnable()) {
541 float conv_out[count];
542 if (
self.conv.compute(count, input, conv_out)) {
543 self.jc_post_mono.compute(count, output, conv_out, output);
548 if (input != output) {
549 memcpy(output, input, count *
sizeof(
float));
553 int ConvolverMonoAdapter::convolver_register(
const ParamReg& reg) {
556 self.jcp->signal_changed().connect(
559 return self.jc_post_mono.register_par(reg);;
562 void ConvolverMonoAdapter::convolver_init(
unsigned int samplingFreq,
PluginDef *p) {
566 self.conv.stop_process();
567 self.conv.set_samplerate(samplingFreq);
568 while (
self.conv.is_runnable()) {
569 self.conv.checkstate();
573 self.conv.set_samplerate(samplingFreq);
577 int ConvolverMonoAdapter::activate(
bool start,
PluginDef *p) {
581 if (
self.
activated &&
self.conv.is_runnable()) {
589 self.activated =
start;
595 self.conv.stop_process();
627 conv.set_buffersize(bufsize);
640 self.conv.set_samplerate(samplingFreq);
647 if (!
activated || !plugin.get_on_off()) {
658 if (!
self.conv.get_buffersize()) {
669 self.update_conn = Glib::signal_timeout().connect(
672 self.conv.stop_process();
674 self.activated =
start;
679 int policy, priority;
681 return conv.start(policy, priority);
694 template <
int tab_size>
698 float ir_data[tab_size];
709 {
"4x12",
N_(
"4x12"), &
static_cast<CabDesc&
>(cab_data_4x12) },
710 {
"2x12",
N_(
"2x12"), &
static_cast<CabDesc&
>(cab_data_2x12) },
711 {
"1x12",
N_(
"1x12"), &
static_cast<CabDesc&
>(cab_data_1x12) },
712 {
"4x10",
N_(
"4x10"), &
static_cast<CabDesc&
>(cab_data_4x10) },
713 {
"2x10",
N_(
"2x10"), &
static_cast<CabDesc&
>(cab_data_2x10) },
714 {
"HighGain",
N_(
"HighGain Style"), &
static_cast<CabDesc&
>(cab_data_HighGain) },
715 {
"Twin",
N_(
"Twin Style"), &
static_cast<CabDesc&
>(cab_data_Twin) },
716 {
"Bassman",
N_(
"Bassman Style"), &
static_cast<CabDesc&
>(cab_data_Bassman) },
717 {
"Marshall",
N_(
"Marshall Style"), &
static_cast<CabDesc&
>(cab_data_Marshall) },
718 {
"AC-30",
N_(
"AC-30 Style"), &
static_cast<CabDesc&
>(cab_data_AC30) },
719 {
"Princeton",
N_(
"Princeton Style"), &
static_cast<CabDesc&
>(cab_data_Princeton) },
720 {
"A2",
N_(
"A2 Style"), &
static_cast<CabDesc&
>(cab_data_A2) },
721 {
"1x15",
N_(
"1x15"), &
static_cast<CabDesc&
>(cab_data_1x15) },
722 {
"Mesa Boogie",
N_(
"Mesa Boogie Style"), &
static_cast<CabDesc&
>(cab_data_mesa) },
723 {
"Briliant",
N_(
"Briliant"), &
static_cast<CabDesc&
>(cab_data_briliant) },
724 {
"Vitalize",
N_(
"Vitalize"), &
static_cast<CabDesc&
>(cab_data_vitalize) },
725 {
"Charisma",
N_(
"Charisma"), &
static_cast<CabDesc&
>(cab_data_charisma) },
729 static CabEntry& getCabEntry(
unsigned int n) {
730 if (n >= cab_table_size) {
731 n = cab_table_size - 1;
736 static const float no_sum = 1e10;
738 #include "faust/cabinet_impulse_former.cc" 740 static int cab_load_ui(
const UiBuilder& builder,
int format) {
778 for (
unsigned int i = 0; i < cab_table_size; ++i) {
783 cab_names[cab_table_size].
value_id = 0;
797 bool CabinetConvolver::do_update() {
798 bool configure = cabinet_changed();
799 if (conv.is_runnable()) {
800 conv.set_not_runnable();
805 if (current_cab == -1) {
806 impf.init(cab.
ir_sr);
809 impf.clear_state_f();
811 while (!conv.checkstate());
813 if (!conv.configure(cab.
ir_count, cab_irdata_c, cab.
ir_sr)) {
826 bool CabinetConvolver::start(
bool force) {
830 if (cabinet_changed() || sum_changed()) {
833 while (!conv.checkstate());
834 if (!conv.is_runnable()) {
841 void CabinetConvolver::check_update() {
842 if (cabinet_changed() || sum_changed()) {
847 void CabinetConvolver::run_cab_conf(
int count,
float *input0,
float *output0,
PluginDef *p) {
849 if (!
self.conv.compute(count,output0)) {
854 int CabinetConvolver::register_cab(
const ParamReg& reg) {
856 reg.
registerIEnumVar(
"cab.select",
"select",
"B",
"", cab.cab_names, &cab.cabinet, 0);
857 reg.
registerVar(
"cab.Level",
N_(
"Level"),
"S",
N_(
"Level"), &cab.level, 1.0, 0.5, 5.0, 0.5);
858 reg.
registerVar(
"cab.bass",
N_(
"Bass"),
"S",
N_(
"Bass"), &cab.bass, 0.0, -10.0, 10.0, 0.5);
859 reg.
registerVar(
"cab.treble",
N_(
"Treble"),
"S",
N_(
"Treble"), &cab.treble, 0.0, -10.0, 10.0, 0.5);
860 cab.impf.register_par(reg);
874 template <
int tab_size>
878 float ir_data[tab_size];
889 {
"AC30",
N_(
"AC30 Style"), &
static_cast<PreDesc&
>(pre_data_ac30) },
890 {
"Bassman",
N_(
"Bassman Style"), &
static_cast<PreDesc&
>(pre_data_bassman) },
891 {
"Tube",
N_(
"Tube Style"), &
static_cast<PreDesc&
>(pre_data_tube) },
892 {
"Fender",
N_(
"Fender Style"), &
static_cast<PreDesc&
>(pre_data_fender) },
893 {
"JCM800",
N_(
"JCM800 Style"), &
static_cast<PreDesc&
>(pre_data_jcm800) },
894 {
"JTM45",
N_(
"JTM45 Style"), &
static_cast<PreDesc&
>(pre_data_jtm45) },
895 {
"Mesa Boogie",
N_(
"Mesa Boogie Style"), &
static_cast<PreDesc&
>(pre_data_mesaboogie) },
896 {
"Boutique",
N_(
"Boutique Style"), &
static_cast<PreDesc&
>(pre_data_boutique) },
897 {
"Ampeg",
N_(
"Ampeg Style"), &
static_cast<PreDesc&
>(pre_data_ampeg) },
898 {
"Rectifier",
N_(
"Rectifier Style"), &
static_cast<PreDesc&
>(pre_data_rectifier) },
902 static PreEntry& getPreEntry(
unsigned int n) {
903 if (n >= pre_table_size) {
904 n = pre_table_size - 1;
909 #include "faust/preamp_impulse_former.cc" 911 static int pre_load_ui(
const UiBuilder& builder,
int format) {
949 for (
unsigned int i = 0; i < pre_table_size; ++i) {
954 pre_names[pre_table_size].
value_id = 0;
968 bool PreampConvolver::do_update() {
969 bool configure = preamp_changed();
970 if (conv.is_runnable()) {
971 conv.set_not_runnable();
976 if (current_pre == -1) {
977 impf.init(pre.
ir_sr);
980 impf.clear_state_f();
982 while (!conv.checkstate());
984 if (!conv.configure(pre.
ir_count, pre_irdata_c, pre.
ir_sr)) {
997 bool PreampConvolver::start(
bool force) {
1001 if (preamp_changed() || sum_changed()) {
1004 while (!conv.checkstate());
1005 if (!conv.is_runnable()) {
1012 void PreampConvolver::check_update() {
1013 if (preamp_changed() || sum_changed()) {
1018 void PreampConvolver::run_pre_conf(
int count,
float *input0,
float *output0,
PluginDef *p) {
1020 if (!
self.conv.compute(count, output0)) {
1025 int PreampConvolver::register_pre(
const ParamReg& reg) {
1027 reg.
registerIEnumVar(
"pre.select",
"select",
"B",
"", pre.pre_names, &pre.preamp, 0);
1028 reg.
registerVar(
"pre.Level",
N_(
"Level"),
"S",
N_(
"Level"), &pre.level, 1.0, 0.1, 2.1, 0.1);
1029 reg.
registerVar(
"pre.bass",
N_(
"Bass"),
"S",
N_(
"Bass"), &pre.bass, 0.0, -10.0, 10.0, 0.5);
1030 reg.
registerVar(
"pre.treble",
N_(
"Treble"),
"S",
N_(
"Treble"), &pre.treble, 0.0, -10.0, 10.0, 0.5);
1031 pre.impf.register_par(reg);
1039 #include "faust/presence_level.cc" 1047 name =
N_(
"Contrast convolver");
1055 bool ContrastConvolver::do_update() {
1056 bool configure = (sum == no_sum);
1057 if (conv.is_runnable()) {
1058 conv.set_not_runnable();
1060 conv.stop_process();
1063 presl.init(contrast_ir_desc.ir_sr);
1065 float contrast_irdata_c[contrast_ir_desc.ir_count];
1066 presl.compute(contrast_ir_desc.ir_count,contrast_ir_desc.ir_data,contrast_irdata_c);
1067 while (!conv.checkstate());
1069 if (!conv.configure(contrast_ir_desc.ir_count, contrast_irdata_c, contrast_ir_desc.ir_sr)) {
1073 if (!conv.update(contrast_ir_desc.ir_count, contrast_irdata_c, contrast_ir_desc.ir_sr)) {
1081 bool ContrastConvolver::start(
bool force) {
1085 if (sum_changed()) {
1088 while (!conv.checkstate());
1089 if (!conv.is_runnable()) {
1096 void ContrastConvolver::check_update() {
1097 if (sum_changed()) {
1102 int ContrastConvolver::register_con(
const ParamReg& reg) {
1104 reg.
registerVar(
"con.Level",
"",
"S",
"", &
self.level, 1.0, 0.5, 5.0, 0.5);
1105 self.presl.register_par(reg);
1109 void ContrastConvolver::run_contrast(
int count,
float *input0,
float *output0,
PluginDef *p) {
1111 if (!
self.conv.compute(count,output0)) {
1151 bool smbPitchShift::setParameters(
int sampleRate_)
1154 fftFrameSize = numSampsToProcess/4;
1155 sampleRate = int(sampleRate_);
1156 assert(sampleRate>0);
1159 osamp2 = 2.*
M_PI*osamp1;
1160 mpi = (1./(2.*
M_PI)) * osamp;
1169 resamp.setup(sampleRate,4);
1170 gRover = inFifoLatency;
1177 mem_allocated(false),
1192 id =
"smbPitchShift";
1206 sigc::mem_fun(*
this, &smbPitchShift::change_buffersize));
1209 void smbPitchShift::init(
unsigned int samplingFreq,
PluginDef *plugin) {
1214 void smbPitchShift::clear_state()
1216 stepSize = fftFrameSize/osamp;
1217 freqPerBin = (double)(sampleRate/4)/(double)fftFrameSize;
1218 freqPerBin1 = (1/freqPerBin)*osamp2;
1219 freqPerBin2 = freqPerBin*mpi;
1220 expct = 2.*
M_PI*(double)stepSize/(
double)fftFrameSize;
1221 inFifoLatency = fftFrameSize-stepSize;
1222 fftFrameSize3 = 2. * (1./ ((double)(fftFrameSize2)*osamp));
1223 fftFrameSize4 = 1./(double)fftFrameSize;
1235 for (k = 0; k < fftFrameSize2;k++) {
1236 fpb[k] = (double)k*freqPerBin;
1238 for (k = 0; k < fftFrameSize2;k++) {
1239 expect[k] = (double)k*expct;
1241 for (k = 0; k < fftFrameSize;k++) {
1242 hanning[k] = 0.5*(1-cos(2.*
M_PI*(
double)k/((
double)fftFrameSize)));
1244 for (k = 0; k < fftFrameSize;k++) {
1245 hanningd[k] = 0.5*(1-cos(2.*
M_PI*(
double)k * fftFrameSize4)) * fftFrameSize3;
1247 for (k = 0; k < fftFrameSize;k++) {
1250 for (k = 0; k < fftFrameSize;k++) {
1253 for (k = 0; k < fftFrameSize*4;k++) {
1256 for (k = 0; k < fftFrameSize*4;k++) {
1259 gRover = inFifoLatency;
1260 mem_allocated =
true;
1264 void smbPitchShift::mem_alloc()
1267 assert(numSampsToProcess>0);
1268 numSampsToResamp = numSampsToProcess/4;
1270 assert(sampleRate>0);
1274 if (numSampsToProcess <= 2048) {
1275 fftFrameSize = 512 ;
1277 fftFrameSize = numSampsToProcess*0.25 ;
1281 fftFrameSize = numSampsToProcess;
1284 fftFrameSize = numSampsToProcess*0.25;
1287 if (numSampsToProcess <= 2048) {
1288 fftFrameSize = 512 ;
1290 fftFrameSize = numSampsToProcess*0.25 ;
1294 fftFrameSize2 = fftFrameSize/2;
1298 ftPlanForward = fftwf_plan_dft_1d(fftFrameSize, fftw_in, fftw_out, FFTW_FORWARD, FFTW_ESTIMATE);
1299 ftPlanInverse = fftwf_plan_dft_1d(fftFrameSize, fftw_in, fftw_out, FFTW_BACKWARD, FFTW_ESTIMATE);
1301 fpb =
new float[fftFrameSize2];
1302 expect =
new float[fftFrameSize2];
1303 hanning =
new float[fftFrameSize];
1304 hanningd =
new float[fftFrameSize];
1305 resampin =
new float[fftFrameSize];
1306 resampin2 =
new float[fftFrameSize];
1307 resampout =
new float[fftFrameSize*4];
1308 indata2 =
new float[fftFrameSize*4];
1316 void smbPitchShift::mem_free()
1319 mem_allocated =
false;
1320 if (fpb) {
delete fpb; fpb = 0; }
1321 if (expect) {
delete expect; expect = 0; }
1322 if (hanning) {
delete hanning; hanning = 0; }
1323 if (hanningd) {
delete hanningd; hanningd = 0; }
1324 if (resampin) {
delete resampin; resampin = 0; }
1325 if (resampin2) {
delete resampin2; resampin2 = 0; }
1326 if (resampout) {
delete resampout; resampout = 0; }
1327 if (indata2) {
delete indata2; indata2 = 0; }
1329 {fftwf_destroy_plan(ftPlanForward);ftPlanForward = 0; }
1331 { fftwf_destroy_plan(ftPlanInverse);ftPlanInverse = 0; }
1334 int smbPitchShift::activate(
bool start)
1337 if (!mem_allocated) {
1340 }
else if (mem_allocated) {
1346 void smbPitchShift::change_buffersize(
unsigned int size)
1350 if (mem_allocated) {
1356 void smbPitchShift::change_latency()
1360 if (mem_allocated) {
1368 if (mem_allocated) {
1374 void __rt_func smbPitchShift::compute_static(
int count,
float *input0,
float *output0,
PluginDef *p)
1376 static_cast<smbPitchShift*
>(p)->PitchShift(count, input0, output0);
1380 void always_inline smbPitchShift::PitchShift(
int count,
float *indata,
float *outdata)
1383 if (!ready || count != numSampsToProcess) {
1384 if (indata != outdata)
1386 memcpy(outdata,indata,count*
sizeof(
float));
1391 resamp.
down(numSampsToResamp,indata,resampin);
1392 double fSlow0 = (0.01 * wet);
1393 double fSlow1 = (0.01 * dry);
1396 for (i = 0; i < count; i++){
1397 indata2[ii] = indata[i];
1401 for (i = 0; i < numSampsToResamp; i++){
1402 resampin2[ai] = resampin[i];
1406 if (ai>=fftFrameSize) {
1423 float pitchShift = pow(2., (semitones+tone)*0.0833333333);
1425 for (i = 0; i < fftFrameSize; i++){
1428 float fTemp = resampin2[i];
1429 gInFIFO[gRover] = fTemp;
1430 resampin2[i] = gOutFIFO[gRover-inFifoLatency];
1434 if (gRover >= fftFrameSize) {
1435 gRover = inFifoLatency;
1438 for (k = 0; k < fftFrameSize;k++) {
1439 fftw_in[k][0] = gInFIFO[k] * hanning[k];
1440 fftw_in[k][1] = 0.0;
1446 fftwf_execute(ftPlanForward);
1449 for (k = 0; k < fftFrameSize2; k++) {
1452 real = fftw_out[k][0];
1453 imag = fftw_out[k][1];
1456 magn = 2.*sqrt(real*real + imag*imag);
1457 phase = atan2(imag,real);
1460 tmp = phase - gLastPhase[k];
1461 gLastPhase[k] = phase;
1468 if (qpd >= 0) qpd += qpd&1;
1470 tmp -=
M_PI*(double)qpd;
1474 tmp = fpb[k] + tmp*freqPerBin2;
1484 memset(gSynMagn, 0, fftFrameSize*
sizeof(
float));
1485 memset(gSynFreq, 0, fftFrameSize*
sizeof(
float));
1486 for (k = 1; k < fftFrameSize2-2; k++) {
1487 index = k*pitchShift;
1488 if (index < fftFrameSize2) {
1489 if (index < fftFrameSize2*0.20)
1490 gSynMagn[index] += gAnaMagn[k]*a;
1491 else if (index < fftFrameSize2*0.45)
1492 gSynMagn[index] += gAnaMagn[k]*b;
1493 else if (index < fftFrameSize2*0.667)
1494 gSynMagn[index] += gAnaMagn[k]*c;
1496 gSynMagn[index] += gAnaMagn[k]*d;
1497 gSynFreq[index] = gAnaFreq[k] * pitchShift;
1503 for (k = 0; k < fftFrameSize2; k++) {
1513 tmp = ((gSynFreq[k] - fpb[k]) * freqPerBin1) + expect[k];
1516 gSumPhase[k] += tmp;
1517 phase = gSumPhase[k];
1518 if (magn == 0.0)
continue;
1521 fftw_in[k][0] = magn * cos (phase);
1522 fftw_in[k][1] = magn * sin (phase);
1526 fftwf_execute(ftPlanInverse);
1528 for(k=0; k < fftFrameSize; k++) {
1529 gOutputAccum[k] += hanningd[k] * fftw_out[ k][0] ;
1531 for (k = 0; k < stepSize; k++) gOutFIFO[k] = gOutputAccum[k];
1534 memmove(gOutputAccum, gOutputAccum+stepSize, fftFrameSize*
sizeof(
float));
1537 for (k = 0; k < inFifoLatency; k++) gInFIFO[k] = gInFIFO[k+stepSize];
1540 resamp.
up(fftFrameSize,resampin2,resampout);
1544 for (i = 0; i < count; i++){
1545 outdata[i] = ((fSlow0 * resampout[aio]) + (fSlow1 *indata2[aio]));
1549 for (i = 0; i < count; i++){
1550 outdata[i] = ((fSlow0 * resampout[aio]) + (fSlow1 *indata[i]));
1556 int smbPitchShift::register_par(
const ParamReg& reg)
1558 reg.
registerVar(
"smbPitchShift.semitone",
N_(
"Detune"),
"S",
"", &semitones, 0.0, -12., 12., 0.1);
1559 static const value_pair octave_values[] = {{
"unison"},{
"octave up"},{
"octave down"},{0}};
1560 reg.
registerIEnumVar(
"smbPitchShift.octave",
N_(
"add harmonics"),
"B",
N_(
"add harmonics"),octave_values,&octave, 0);
1561 static const value_pair latency_values[] = {{
"latency "},{
"compensate"},{0}};
1562 reg.
registerEnumVar(
"smbPitchShift.l",
N_(
"compensate latency"),
"S",
N_(
"compensate latency"),latency_values,&l, 0.0f, 0.0f, 1.0f, 1.0f);
1563 static const value_pair latency_set[] = {{
"high quality"},{
"low quality"},{
"realtime"},{0}};
1564 reg.
registerIEnumVar(
"smbPitchShift.latency",
N_(
"latency settings"),
"B",
N_(
"latency settings"),latency_set,&latency, 0);
1565 reg.
registerVar(
"smbPitchShift.wet",
N_(
"Wet"),
"S",
N_(
"Wet amount"), &wet, 50.0, 0.0, 100.0, 1);
1566 reg.
registerVar(
"smbPitchShift.dry",
N_(
"Dry"),
"S",
N_(
"Dry amount"), &dry, 50.0, 0.0, 100.0, 1);
1567 reg.
registerVar(
"smbPitchShift.a",
N_(
"low"),
"S",
N_(
"Sub"), &a, 1.0, 0.0, 2.0, 0.01);
1568 reg.
registerVar(
"smbPitchShift.b",
N_(
"middle low"),
"S",
N_(
"Low"), &b, 1.0, 0.0, 2.0, 0.01);
1569 reg.
registerVar(
"smbPitchShift.c",
N_(
"middle treble"),
"S",
N_(
"Mid"), &c, 1.0, 0.0, 2.0, 0.01);
1570 reg.
registerVar(
"smbPitchShift.d",
N_(
"treble"),
"S",
N_(
"Hi"), &d, 1.0, 0.0, 2.0, 0.01);
1571 param[
"smbPitchShift.latency"].signal_changed_int().connect(
1572 sigc::hide(sigc::mem_fun(
this, &smbPitchShift::change_latency)));
1576 int smbPitchShift::registerparam(
const ParamReg& reg)
1581 int smbPitchShift::load_ui_f(
const UiBuilder& b,
int form)
1631 int smbPitchShift::activate_static(
bool start,
PluginDef *p)
1636 int smbPitchShift::load_ui_f_static(
const UiBuilder& b,
int form)
1641 void smbPitchShift::del_instance(
PluginDef *p)
void write_kv(const char *key, float v)
static void init(unsigned int samplingFreq, PluginDef *p)
CmdConnection::msg_type start
void begin_array(bool nl=false)
void get_sched_priority(int &policy, int &priority, int prio_dim=0)
void up(int count, float *input, float *output)
bool set(const GxJConvSettings &val) const
virtual bool on_off_value()
BasicOptions & get_options()
ParameterV< GxJConvSettings > JConvParameter
void end_array(bool nl=false)
static int activate(bool start, PluginDef *pdef)
virtual void overload(OverloadType tp, const char *reason)=0
virtual void writeJSON(gx_system::JsonWriter &jw) const
struct gx_engine::CabEntry cab_table[]
void set_pdef(PluginDef *p)
const PrefixConverter & get_IR_prefixmap() const
float *(* registerVar)(const char *id, const char *name, const char *tp, const char *tooltip, float *var, float val, float low, float up, float step)
void(* registerEnumVar)(const char *id, const char *name, const char *tp, const char *tooltip, const value_pair *values, float *var, float val, float low, float up, float step)
ParameterV(const string &id, ConvolverAdapter &conv, GxJConvSettings *v)
void change_buffersize(unsigned int size)
void change_buffersize(unsigned int)
void write_key(const char *p, bool nl=false)
void set_on_off(bool v) const
void(* load_glade_file)(const char *fname)
bool find_dir(std::string *d, const std::string &filename) const
virtual void setJSON_value()
virtual void readJSON_value(gx_system::JsonParser &jp)
boost::mutex activate_mutex
void(* registerIEnumVar)(const char *id, const char *name, const char *tp, const char *tooltip, const value_pair *values, int *var, int val)
deletefunc delete_instance
virtual bool start(bool force=false)=0
void gx_print_error(const char *, const std::string &)
bool read_kv(const char *key, float &v)
ConvolverMonoAdapter(EngineControl &engine, sigc::slot< void > sync, ParamMap ¶m)
bool check_update_timeout()
smbPitchShift(ParamMap ¶m_, EngineControl &engine, sigc::slot< void > sync)
std::string getFullIRPath() const
CabinetConvolver(EngineControl &engine, sigc::slot< void > sync, gx_resample::BufferResampler &resamp)
#define PLUGINDEF_VERSION
void(* openHorizontalBox)(const char *label)
registerfunc register_params
PreampConvolver(EngineControl &engine, sigc::slot< void > sync, gx_resample::BufferResampler &resamp)
static PluginDef outputgate
virtual void serializeJSON(gx_system::JsonWriter &jw)
sigc::connection update_conn
const PathList & get_IR_pathlist() const
BaseConvolver(EngineControl &engine, sigc::slot< void > sync, gx_resample::BufferResampler &resamp)
void begin_object(bool nl=false)
void(* create_small_rackknobr)(const char *id, const char *label)
void down(int count, float *input, float *output)
std::string replace_symbol(const std::string &dir) const
void(* create_mid_rackknob)(const char *id, const char *label)
boost::mutex activate_mutex
void setFullIRPath(string name)
const Gainline & getGainline() const
ContrastConvolver(EngineControl &engine, sigc::slot< void > sync, gx_resample::BufferResampler &resamp)
unsigned int get_samplerate()
void gx_print_warning(const char *, const std::string &)
void(* openHorizontalhideBox)(const char *label)
ConvolverAdapter(EngineControl &engine, sigc::slot< void > sync, ParamMap ¶m)
virtual void stdJSON_value()
activatefunc activate_plugin
virtual void check_update()=0
process_stereo_audio stereo_audio
void readJSON(gx_system::JsonParser &jp)
void(* set_next_flags)(int flags)
process_mono_audio mono_audio
virtual void serializeJSON(gx_system::JsonWriter &jw)
GxJConvSettings & operator=(GxJConvSettings const &jcset)
string current_value() const
unsigned int get_buffersize()
~ConvolverStereoAdapter()
float current_value_float()
bool operator==(const GxJConvSettings &jcset) const
void writeJSON(gx_system::JsonWriter &w) const
token next(token expect=no_token)
void write(float v, bool nl=false)
struct gx_engine::PreEntry pre_table[]
virtual bool compareJSON_value()
static ParameterV< GxJConvSettings > * insert_param(ParamMap &pmap, const string &id, ConvolverAdapter &conv, GxJConvSettings *v)
void(* create_master_slider)(const char *id, const char *label)
void end_object(bool nl=false)
ConvolverStereoAdapter(EngineControl &engine, sigc::slot< void > sync, ParamMap ¶m)
void(* create_selector_no_caption)(const char *id)
void(* openVerticalBox)(const char *label)
sigc::signal< void, unsigned int > & signal_buffersize_change()