Exemple #1
0
int exciter_perf(CSOUND *csound, EXCITER *p)
//uint32_t inputs_mask, uint32_t outputs_mask)
{
    uint32_t offset = p->h.insdshead->ksmps_offset;
    uint32_t early  = p->h.insdshead->ksmps_no_end;
    uint32_t n, nsmps = CS_KSMPS;
    MYFLT zerodb = csound->Get0dBFS(csound);

    if (UNLIKELY(offset)) memset(p->aout, '\0', offset*sizeof(MYFLT));
    if (UNLIKELY(early)) {
      nsmps -= early;
      memset(&p->aout[nsmps], '\0', early*sizeof(MYFLT));
    }
    params_changed(csound, p);
   // process
    for (n = offset; n<nsmps; n++) {
      // cycle through samples
      double out, in, out1;
      in = (double)p->ain[n]/zerodb;
      // all pre filters in chain
      //printf("**** %f ****\n", in);
      out1 = process(p->hp2, process(p->hp1, in));
      out = distort(p, out1);      // saturate
      //printf("after distort %f -> %f -> %f\n", in, out1, out);
      // all post filters in chain
      out = process(p->hp4, process(p->hp3, out));

      // all H/P post filters in chain (surely LP - JPff)
      out = process(p->lp1, process(p->lp2, out));
      p->aout[n] = out*zerodb;
    } // cycle through samples
    return OK;
}
Exemple #2
0
void Preferences::on_applyButton_clicked()
{

    // create new parameter object
    CParameters params;

    // write current parameter set to object
    params.Set("SCALE",ui->scaleSpinBox->value());
    params.Set("FEATURE_THRESHOLD",ui->thresholdEdit->text().toDouble());
    params.Set("MIN_NO_FEATURES",ui->minFeatEdit->text().toInt());
    params.Set("MAX_NO_FEATURES",ui->maxFeatEdit->text().toInt());
    params.Set("BUFFER_LENGTH",ui->ringBufferEdit->text().toInt());
    params.Set("TRACKING_HSIZE",ui->trackSizeEdit->text().toInt());
    params.Set("DESCRIPTOR_HSIZE",ui->descSizeEdit->text().toInt());
    params.Set("GRAD_SMOOTH_SIGMA",ui->sigmaEdit->text().toDouble());
    params.Set("MINIMAL_FEATURE_HDISTANCE_INIT",ui->minInitDistEdit->text().toInt());
    params.Set("MINIMAL_FEATURE_HDISTANCE_CLEAN",ui->minDistEdit->text().toInt());
    params.Set("MAX_HAMMING_DISTANCE",ui->hammingEdit->text().toInt());
    params.Set("LK_PYRAMID_LEVEL",ui->lkLevelSpinBox->value());
    params.Set("MAX_ITER",ui->maxIterEdit->text().toInt());
    params.Set("ACCURACY",ui->accEdit->text().toDouble());
    params.Set("LAMBDA",ui->lambdaEdit->text().toDouble());
    params.Set("ALPHA_GRAD_NORM",ui->alphaEdit->text().toDouble());
    params.Set("COMPUTE_ID",(int)ui->idOnCheckBox->isChecked());
    params.Set("NORMALIZE_ID",ui->idNormComboBox->currentIndex());
    params.Set("COMPUTE_GRAD",(int)ui->gradOnCheckBox->isChecked());
    params.Set("NORMALIZE_GRAD",ui->gradNormComboBox->currentIndex());
    params.Set("AGGREGATOR",ui->aggComboBox->currentIndex());
    params.Set("AGG_DS",ui->downSampleEdit->text().toInt());
    params.Set("COMPUTE_HOG",(int)ui->hogOnCheckBox->isChecked());

    // send this to main window
    emit params_changed(params);

    this->close();

}