mirror of
https://gitlab.com/then-try-this/samplebrain.git
synced 2025-05-12 18:47:21 +00:00
slightly experimental timestretch
This commit is contained in:
parent
4e22d13f31
commit
09dc6f633c
File diff suppressed because it is too large
Load Diff
@ -103,6 +103,12 @@ private slots:
|
|||||||
lo_send(m_audio_address,"/target_mix","f",s);
|
lo_send(m_audio_address,"/target_mix","f",s);
|
||||||
m_Ui.sliderTargetMix->setValue(s*100);
|
m_Ui.sliderTargetMix->setValue(s*100);
|
||||||
}
|
}
|
||||||
|
void search_stretch(int s) {
|
||||||
|
lo_send(m_audio_address,"/search-stretch","i",s);
|
||||||
|
}
|
||||||
|
void slide_error(int s) {
|
||||||
|
lo_send(m_audio_address,"/slide-error","i",s);
|
||||||
|
}
|
||||||
|
|
||||||
void volume_slot(int s) { lo_send(m_audio_address,"/volume","f",s/100.0f); }
|
void volume_slot(int s) { lo_send(m_audio_address,"/volume","f",s/100.0f); }
|
||||||
|
|
||||||
|
@ -118,6 +118,12 @@ void audio_thread::process(sample &s, sample &s2) {
|
|||||||
if (name=="/synapses") {
|
if (name=="/synapses") {
|
||||||
m_renderer->get_params()->m_num_synapses=cmd.get_int(0);
|
m_renderer->get_params()->m_num_synapses=cmd.get_int(0);
|
||||||
}
|
}
|
||||||
|
if (name=="/search-stretch") {
|
||||||
|
m_renderer->set_stretch(cmd.get_int(0));
|
||||||
|
}
|
||||||
|
if (name=="/slide-error") {
|
||||||
|
m_renderer->set_slide_error(cmd.get_int(0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s.zero();
|
s.zero();
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
** Form generated from reading UI file 'samplebrainuQB562.ui'
|
** Form generated from reading UI file 'samplebrainj32146.ui'
|
||||||
**
|
**
|
||||||
** Created: Tue Aug 4 16:33:54 2015
|
** Created: Thu Aug 6 13:25:50 2015
|
||||||
** by: Qt User Interface Compiler version 4.8.1
|
** by: Qt User Interface Compiler version 4.8.1
|
||||||
**
|
**
|
||||||
** WARNING! All changes made in this file will be lost when recompiling UI file!
|
** WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
#ifndef SAMPLEBRAINUQB562_H
|
#ifndef SAMPLEBRAINJ32146_H
|
||||||
#define SAMPLEBRAINUQB562_H
|
#define SAMPLEBRAINJ32146_H
|
||||||
|
|
||||||
#include <QtCore/QVariant>
|
#include <QtCore/QVariant>
|
||||||
#include <QtGui/QAction>
|
#include <QtGui/QAction>
|
||||||
@ -42,7 +42,7 @@ public:
|
|||||||
QVBoxLayout *verticalLayout_4;
|
QVBoxLayout *verticalLayout_4;
|
||||||
QTabWidget *tabWidget;
|
QTabWidget *tabWidget;
|
||||||
QWidget *controlTab;
|
QWidget *controlTab;
|
||||||
QHBoxLayout *horizontalLayout_19;
|
QHBoxLayout *horizontalLayout_5;
|
||||||
QVBoxLayout *verticalLayout_3;
|
QVBoxLayout *verticalLayout_3;
|
||||||
QLabel *label_19;
|
QLabel *label_19;
|
||||||
QHBoxLayout *horizontalLayout_16;
|
QHBoxLayout *horizontalLayout_16;
|
||||||
@ -67,18 +67,25 @@ public:
|
|||||||
QLabel *label_25;
|
QLabel *label_25;
|
||||||
QSlider *sliderBoredom;
|
QSlider *sliderBoredom;
|
||||||
QDoubleSpinBox *doubleSpinBoxBoredom;
|
QDoubleSpinBox *doubleSpinBoxBoredom;
|
||||||
QHBoxLayout *horizontalLayout_17;
|
QHBoxLayout *horizontalLayout_19;
|
||||||
QLabel *label_26;
|
QLabel *label_28;
|
||||||
QSlider *sliderSynapses;
|
QSlider *sliderSearchStretch;
|
||||||
QSpinBox *spinBoxSynapses;
|
QSpinBox *spinBoxSearchStretch;
|
||||||
QLabel *label_27;
|
QLabel *label_27;
|
||||||
QHBoxLayout *horizontalLayout_18;
|
QHBoxLayout *horizontalLayout_18;
|
||||||
QRadioButton *radioButtonAlgoBasic;
|
QRadioButton *radioButtonAlgoBasic;
|
||||||
QRadioButton *radioButtonAlgoRevBasic;
|
QRadioButton *radioButtonAlgoRevBasic;
|
||||||
QRadioButton *radioButtonSynaptic;
|
QRadioButton *radioButtonSynaptic;
|
||||||
QRadioButton *radioButtonSynapticSlide;
|
QRadioButton *radioButtonSynapticSlide;
|
||||||
|
QHBoxLayout *horizontalLayout_17;
|
||||||
|
QLabel *label_26;
|
||||||
|
QSlider *sliderSynapses;
|
||||||
|
QSpinBox *spinBoxSynapses;
|
||||||
|
QHBoxLayout *horizontalLayout_20;
|
||||||
|
QLabel *label_29;
|
||||||
|
QSlider *sliderSlideError;
|
||||||
|
QSpinBox *spinBoxSlideError;
|
||||||
QSpacerItem *horizontalSpacer_2;
|
QSpacerItem *horizontalSpacer_2;
|
||||||
QSpacerItem *verticalSpacer_3;
|
|
||||||
QLabel *label_23;
|
QLabel *label_23;
|
||||||
QHBoxLayout *horizontalLayout_8;
|
QHBoxLayout *horizontalLayout_8;
|
||||||
QLabel *label_21;
|
QLabel *label_21;
|
||||||
@ -88,6 +95,7 @@ public:
|
|||||||
QLabel *label_22;
|
QLabel *label_22;
|
||||||
QSlider *sliderTargetMix;
|
QSlider *sliderTargetMix;
|
||||||
QDoubleSpinBox *doubleSpinBoxTargetMix;
|
QDoubleSpinBox *doubleSpinBoxTargetMix;
|
||||||
|
QSpacerItem *verticalSpacer_3;
|
||||||
QVBoxLayout *verticalLayout_6;
|
QVBoxLayout *verticalLayout_6;
|
||||||
QLabel *label_16;
|
QLabel *label_16;
|
||||||
QPushButton *pushButtonLoadTarget;
|
QPushButton *pushButtonLoadTarget;
|
||||||
@ -151,15 +159,15 @@ public:
|
|||||||
QSpacerItem *horizontalSpacer;
|
QSpacerItem *horizontalSpacer;
|
||||||
QLabel *label_13;
|
QLabel *label_13;
|
||||||
QStatusBar *statusbar;
|
QStatusBar *statusbar;
|
||||||
QButtonGroup *buttonGroup;
|
|
||||||
QButtonGroup *buttonGroup_2;
|
QButtonGroup *buttonGroup_2;
|
||||||
QButtonGroup *buttonGroup_3;
|
QButtonGroup *buttonGroup_3;
|
||||||
|
QButtonGroup *buttonGroup;
|
||||||
|
|
||||||
void setupUi(QMainWindow *MainWindow)
|
void setupUi(QMainWindow *MainWindow)
|
||||||
{
|
{
|
||||||
if (MainWindow->objectName().isEmpty())
|
if (MainWindow->objectName().isEmpty())
|
||||||
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
|
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
|
||||||
MainWindow->resize(1134, 691);
|
MainWindow->resize(1134, 707);
|
||||||
centralwidget = new QWidget(MainWindow);
|
centralwidget = new QWidget(MainWindow);
|
||||||
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
|
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
|
||||||
verticalLayout_4 = new QVBoxLayout(centralwidget);
|
verticalLayout_4 = new QVBoxLayout(centralwidget);
|
||||||
@ -173,8 +181,8 @@ public:
|
|||||||
tabWidget->setFont(font);
|
tabWidget->setFont(font);
|
||||||
controlTab = new QWidget();
|
controlTab = new QWidget();
|
||||||
controlTab->setObjectName(QString::fromUtf8("controlTab"));
|
controlTab->setObjectName(QString::fromUtf8("controlTab"));
|
||||||
horizontalLayout_19 = new QHBoxLayout(controlTab);
|
horizontalLayout_5 = new QHBoxLayout(controlTab);
|
||||||
horizontalLayout_19->setObjectName(QString::fromUtf8("horizontalLayout_19"));
|
horizontalLayout_5->setObjectName(QString::fromUtf8("horizontalLayout_5"));
|
||||||
verticalLayout_3 = new QVBoxLayout();
|
verticalLayout_3 = new QVBoxLayout();
|
||||||
verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3"));
|
verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3"));
|
||||||
label_19 = new QLabel(controlTab);
|
label_19 = new QLabel(controlTab);
|
||||||
@ -364,35 +372,37 @@ public:
|
|||||||
|
|
||||||
verticalLayout_3->addLayout(horizontalLayout_11);
|
verticalLayout_3->addLayout(horizontalLayout_11);
|
||||||
|
|
||||||
horizontalLayout_17 = new QHBoxLayout();
|
horizontalLayout_19 = new QHBoxLayout();
|
||||||
horizontalLayout_17->setObjectName(QString::fromUtf8("horizontalLayout_17"));
|
horizontalLayout_19->setObjectName(QString::fromUtf8("horizontalLayout_19"));
|
||||||
label_26 = new QLabel(controlTab);
|
label_28 = new QLabel(controlTab);
|
||||||
label_26->setObjectName(QString::fromUtf8("label_26"));
|
label_28->setObjectName(QString::fromUtf8("label_28"));
|
||||||
label_26->setFont(font2);
|
label_28->setFont(font2);
|
||||||
|
|
||||||
horizontalLayout_17->addWidget(label_26);
|
horizontalLayout_19->addWidget(label_28);
|
||||||
|
|
||||||
sliderSynapses = new QSlider(controlTab);
|
sliderSearchStretch = new QSlider(controlTab);
|
||||||
sliderSynapses->setObjectName(QString::fromUtf8("sliderSynapses"));
|
sliderSearchStretch->setObjectName(QString::fromUtf8("sliderSearchStretch"));
|
||||||
sizePolicy.setHeightForWidth(sliderSynapses->sizePolicy().hasHeightForWidth());
|
sizePolicy.setHeightForWidth(sliderSearchStretch->sizePolicy().hasHeightForWidth());
|
||||||
sliderSynapses->setSizePolicy(sizePolicy);
|
sliderSearchStretch->setSizePolicy(sizePolicy);
|
||||||
sliderSynapses->setMaximum(1000);
|
sliderSearchStretch->setMinimum(1);
|
||||||
sliderSynapses->setValue(20);
|
sliderSearchStretch->setMaximum(10);
|
||||||
sliderSynapses->setOrientation(Qt::Horizontal);
|
sliderSearchStretch->setValue(1);
|
||||||
|
sliderSearchStretch->setOrientation(Qt::Horizontal);
|
||||||
|
|
||||||
horizontalLayout_17->addWidget(sliderSynapses);
|
horizontalLayout_19->addWidget(sliderSearchStretch);
|
||||||
|
|
||||||
spinBoxSynapses = new QSpinBox(controlTab);
|
spinBoxSearchStretch = new QSpinBox(controlTab);
|
||||||
spinBoxSynapses->setObjectName(QString::fromUtf8("spinBoxSynapses"));
|
spinBoxSearchStretch->setObjectName(QString::fromUtf8("spinBoxSearchStretch"));
|
||||||
sizePolicy1.setHeightForWidth(spinBoxSynapses->sizePolicy().hasHeightForWidth());
|
sizePolicy1.setHeightForWidth(spinBoxSearchStretch->sizePolicy().hasHeightForWidth());
|
||||||
spinBoxSynapses->setSizePolicy(sizePolicy1);
|
spinBoxSearchStretch->setSizePolicy(sizePolicy1);
|
||||||
spinBoxSynapses->setMaximum(1000);
|
spinBoxSearchStretch->setMinimum(1);
|
||||||
spinBoxSynapses->setValue(20);
|
spinBoxSearchStretch->setMaximum(10);
|
||||||
|
spinBoxSearchStretch->setValue(1);
|
||||||
|
|
||||||
horizontalLayout_17->addWidget(spinBoxSynapses);
|
horizontalLayout_19->addWidget(spinBoxSearchStretch);
|
||||||
|
|
||||||
|
|
||||||
verticalLayout_3->addLayout(horizontalLayout_17);
|
verticalLayout_3->addLayout(horizontalLayout_19);
|
||||||
|
|
||||||
label_27 = new QLabel(controlTab);
|
label_27 = new QLabel(controlTab);
|
||||||
label_27->setObjectName(QString::fromUtf8("label_27"));
|
label_27->setObjectName(QString::fromUtf8("label_27"));
|
||||||
@ -432,7 +442,7 @@ public:
|
|||||||
radioButtonSynapticSlide = new QRadioButton(controlTab);
|
radioButtonSynapticSlide = new QRadioButton(controlTab);
|
||||||
buttonGroup_3->addButton(radioButtonSynapticSlide);
|
buttonGroup_3->addButton(radioButtonSynapticSlide);
|
||||||
radioButtonSynapticSlide->setObjectName(QString::fromUtf8("radioButtonSynapticSlide"));
|
radioButtonSynapticSlide->setObjectName(QString::fromUtf8("radioButtonSynapticSlide"));
|
||||||
radioButtonSynapticSlide->setEnabled(false);
|
radioButtonSynapticSlide->setEnabled(true);
|
||||||
radioButtonSynapticSlide->setCheckable(true);
|
radioButtonSynapticSlide->setCheckable(true);
|
||||||
|
|
||||||
horizontalLayout_18->addWidget(radioButtonSynapticSlide);
|
horizontalLayout_18->addWidget(radioButtonSynapticSlide);
|
||||||
@ -440,14 +450,72 @@ public:
|
|||||||
|
|
||||||
verticalLayout_3->addLayout(horizontalLayout_18);
|
verticalLayout_3->addLayout(horizontalLayout_18);
|
||||||
|
|
||||||
|
horizontalLayout_17 = new QHBoxLayout();
|
||||||
|
horizontalLayout_17->setObjectName(QString::fromUtf8("horizontalLayout_17"));
|
||||||
|
label_26 = new QLabel(controlTab);
|
||||||
|
label_26->setObjectName(QString::fromUtf8("label_26"));
|
||||||
|
label_26->setFont(font2);
|
||||||
|
|
||||||
|
horizontalLayout_17->addWidget(label_26);
|
||||||
|
|
||||||
|
sliderSynapses = new QSlider(controlTab);
|
||||||
|
sliderSynapses->setObjectName(QString::fromUtf8("sliderSynapses"));
|
||||||
|
sizePolicy.setHeightForWidth(sliderSynapses->sizePolicy().hasHeightForWidth());
|
||||||
|
sliderSynapses->setSizePolicy(sizePolicy);
|
||||||
|
sliderSynapses->setMaximum(1000);
|
||||||
|
sliderSynapses->setValue(20);
|
||||||
|
sliderSynapses->setOrientation(Qt::Horizontal);
|
||||||
|
|
||||||
|
horizontalLayout_17->addWidget(sliderSynapses);
|
||||||
|
|
||||||
|
spinBoxSynapses = new QSpinBox(controlTab);
|
||||||
|
spinBoxSynapses->setObjectName(QString::fromUtf8("spinBoxSynapses"));
|
||||||
|
sizePolicy1.setHeightForWidth(spinBoxSynapses->sizePolicy().hasHeightForWidth());
|
||||||
|
spinBoxSynapses->setSizePolicy(sizePolicy1);
|
||||||
|
spinBoxSynapses->setMaximum(1000);
|
||||||
|
spinBoxSynapses->setValue(20);
|
||||||
|
|
||||||
|
horizontalLayout_17->addWidget(spinBoxSynapses);
|
||||||
|
|
||||||
|
|
||||||
|
verticalLayout_3->addLayout(horizontalLayout_17);
|
||||||
|
|
||||||
|
horizontalLayout_20 = new QHBoxLayout();
|
||||||
|
horizontalLayout_20->setObjectName(QString::fromUtf8("horizontalLayout_20"));
|
||||||
|
label_29 = new QLabel(controlTab);
|
||||||
|
label_29->setObjectName(QString::fromUtf8("label_29"));
|
||||||
|
label_29->setFont(font2);
|
||||||
|
|
||||||
|
horizontalLayout_20->addWidget(label_29);
|
||||||
|
|
||||||
|
sliderSlideError = new QSlider(controlTab);
|
||||||
|
sliderSlideError->setObjectName(QString::fromUtf8("sliderSlideError"));
|
||||||
|
sizePolicy.setHeightForWidth(sliderSlideError->sizePolicy().hasHeightForWidth());
|
||||||
|
sliderSlideError->setSizePolicy(sizePolicy);
|
||||||
|
sliderSlideError->setMaximum(10000);
|
||||||
|
sliderSlideError->setSingleStep(100);
|
||||||
|
sliderSlideError->setValue(1000);
|
||||||
|
sliderSlideError->setOrientation(Qt::Horizontal);
|
||||||
|
|
||||||
|
horizontalLayout_20->addWidget(sliderSlideError);
|
||||||
|
|
||||||
|
spinBoxSlideError = new QSpinBox(controlTab);
|
||||||
|
spinBoxSlideError->setObjectName(QString::fromUtf8("spinBoxSlideError"));
|
||||||
|
sizePolicy1.setHeightForWidth(spinBoxSlideError->sizePolicy().hasHeightForWidth());
|
||||||
|
spinBoxSlideError->setSizePolicy(sizePolicy1);
|
||||||
|
spinBoxSlideError->setMaximum(10000);
|
||||||
|
spinBoxSlideError->setSingleStep(100);
|
||||||
|
spinBoxSlideError->setValue(1000);
|
||||||
|
|
||||||
|
horizontalLayout_20->addWidget(spinBoxSlideError);
|
||||||
|
|
||||||
|
|
||||||
|
verticalLayout_3->addLayout(horizontalLayout_20);
|
||||||
|
|
||||||
horizontalSpacer_2 = new QSpacerItem(21, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
horizontalSpacer_2 = new QSpacerItem(21, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
|
||||||
verticalLayout_3->addItem(horizontalSpacer_2);
|
verticalLayout_3->addItem(horizontalSpacer_2);
|
||||||
|
|
||||||
verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
|
||||||
|
|
||||||
verticalLayout_3->addItem(verticalSpacer_3);
|
|
||||||
|
|
||||||
label_23 = new QLabel(controlTab);
|
label_23 = new QLabel(controlTab);
|
||||||
label_23->setObjectName(QString::fromUtf8("label_23"));
|
label_23->setObjectName(QString::fromUtf8("label_23"));
|
||||||
label_23->setFont(font1);
|
label_23->setFont(font1);
|
||||||
@ -515,8 +583,12 @@ public:
|
|||||||
|
|
||||||
verticalLayout_3->addLayout(horizontalLayout_9);
|
verticalLayout_3->addLayout(horizontalLayout_9);
|
||||||
|
|
||||||
|
verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||||
|
|
||||||
horizontalLayout_19->addLayout(verticalLayout_3);
|
verticalLayout_3->addItem(verticalSpacer_3);
|
||||||
|
|
||||||
|
|
||||||
|
horizontalLayout_5->addLayout(verticalLayout_3);
|
||||||
|
|
||||||
verticalLayout_6 = new QVBoxLayout();
|
verticalLayout_6 = new QVBoxLayout();
|
||||||
verticalLayout_6->setObjectName(QString::fromUtf8("verticalLayout_6"));
|
verticalLayout_6->setObjectName(QString::fromUtf8("verticalLayout_6"));
|
||||||
@ -641,7 +713,7 @@ public:
|
|||||||
verticalLayout_6->addItem(verticalSpacer);
|
verticalLayout_6->addItem(verticalSpacer);
|
||||||
|
|
||||||
|
|
||||||
horizontalLayout_19->addLayout(verticalLayout_6);
|
horizontalLayout_5->addLayout(verticalLayout_6);
|
||||||
|
|
||||||
verticalLayout_2 = new QVBoxLayout();
|
verticalLayout_2 = new QVBoxLayout();
|
||||||
verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
|
verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
|
||||||
@ -777,7 +849,7 @@ public:
|
|||||||
verticalLayout_2->addItem(verticalSpacer_2);
|
verticalLayout_2->addItem(verticalSpacer_2);
|
||||||
|
|
||||||
|
|
||||||
horizontalLayout_19->addLayout(verticalLayout_2);
|
horizontalLayout_5->addLayout(verticalLayout_2);
|
||||||
|
|
||||||
verticalLayout = new QVBoxLayout();
|
verticalLayout = new QVBoxLayout();
|
||||||
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
|
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
|
||||||
@ -816,7 +888,7 @@ public:
|
|||||||
verticalLayout->addLayout(horizontalLayout_2);
|
verticalLayout->addLayout(horizontalLayout_2);
|
||||||
|
|
||||||
|
|
||||||
horizontalLayout_19->addLayout(verticalLayout);
|
horizontalLayout_5->addLayout(verticalLayout);
|
||||||
|
|
||||||
tabWidget->addTab(controlTab, QString());
|
tabWidget->addTab(controlTab, QString());
|
||||||
logTab = new QWidget();
|
logTab = new QWidget();
|
||||||
@ -906,56 +978,62 @@ public:
|
|||||||
QObject::connect(dialVolume, SIGNAL(sliderMoved(int)), MainWindow, SLOT(volume_slot(int)));
|
QObject::connect(dialVolume, SIGNAL(sliderMoved(int)), MainWindow, SLOT(volume_slot(int)));
|
||||||
QObject::connect(pushButtonStopRecord, SIGNAL(released()), MainWindow, SLOT(stop_record()));
|
QObject::connect(pushButtonStopRecord, SIGNAL(released()), MainWindow, SLOT(stop_record()));
|
||||||
QObject::connect(pushButtonRecord, SIGNAL(released()), MainWindow, SLOT(record()));
|
QObject::connect(pushButtonRecord, SIGNAL(released()), MainWindow, SLOT(record()));
|
||||||
QObject::connect(pushButtonLoadTarget, SIGNAL(released()), MainWindow, SLOT(load_target()));
|
|
||||||
QObject::connect(pushButtonGenerateTarget, SIGNAL(released()), MainWindow, SLOT(generate_target_blocks()));
|
|
||||||
QObject::connect(spinBoxBlockSizeTarget, SIGNAL(valueChanged(int)), MainWindow, SLOT(target_block_size(int)));
|
|
||||||
QObject::connect(doubleSpinBoxRatio, SIGNAL(valueChanged(double)), MainWindow, SLOT(ratio_slot(double)));
|
|
||||||
QObject::connect(spinBoxFFT1Start, SIGNAL(valueChanged(int)), MainWindow, SLOT(fft1_start_slot(int)));
|
|
||||||
QObject::connect(spinBoxFFT1End, SIGNAL(valueChanged(int)), MainWindow, SLOT(fft1_end_slot(int)));
|
|
||||||
QObject::connect(radioButton_hammingTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_hamming(bool)));
|
|
||||||
QObject::connect(doubleSpinBoxBlockOverlapTarget, SIGNAL(valueChanged(double)), MainWindow, SLOT(target_block_overlap(double)));
|
|
||||||
QObject::connect(radioButton_rectangleTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_rectangle(bool)));
|
|
||||||
QObject::connect(radioButton_flattopTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_flattop(bool)));
|
|
||||||
QObject::connect(radioButton_blackmanTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_blackman(bool)));
|
|
||||||
QObject::connect(radioButton_bartlettTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_bartlett(bool)));
|
|
||||||
QObject::connect(radioButton_dodgyTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_dodgy(bool)));
|
QObject::connect(radioButton_dodgyTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_dodgy(bool)));
|
||||||
|
QObject::connect(radioButton_blackmanTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_blackman(bool)));
|
||||||
|
QObject::connect(spinBoxFFT1End, SIGNAL(valueChanged(int)), MainWindow, SLOT(fft1_end_slot(int)));
|
||||||
|
QObject::connect(doubleSpinBoxRatio, SIGNAL(valueChanged(double)), MainWindow, SLOT(ratio_slot(double)));
|
||||||
QObject::connect(radioButton_hannTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_hann(bool)));
|
QObject::connect(radioButton_hannTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_hann(bool)));
|
||||||
QObject::connect(radioButton_gaussianTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_gaussian(bool)));
|
QObject::connect(radioButton_gaussianTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_gaussian(bool)));
|
||||||
|
QObject::connect(sliderSynapses, SIGNAL(valueChanged(int)), spinBoxSynapses, SLOT(setValue(int)));
|
||||||
|
QObject::connect(doubleSpinBoxTargetMix, SIGNAL(valueChanged(double)), MainWindow, SLOT(target_mix_slot(double)));
|
||||||
|
QObject::connect(pushButtonGenerateTarget, SIGNAL(released()), MainWindow, SLOT(generate_target_blocks()));
|
||||||
|
QObject::connect(spinBoxBlockSizeTarget, SIGNAL(valueChanged(int)), MainWindow, SLOT(target_block_size(int)));
|
||||||
|
QObject::connect(pushButtonLoadTarget, SIGNAL(released()), MainWindow, SLOT(load_target()));
|
||||||
|
QObject::connect(spinBoxFFT1Start, SIGNAL(valueChanged(int)), MainWindow, SLOT(fft1_start_slot(int)));
|
||||||
|
QObject::connect(radioButton_hammingTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_hamming(bool)));
|
||||||
|
QObject::connect(radioButton_flattopTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_flattop(bool)));
|
||||||
|
QObject::connect(radioButton_bartlettTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_bartlett(bool)));
|
||||||
|
QObject::connect(doubleSpinBoxBlockOverlapTarget, SIGNAL(valueChanged(double)), MainWindow, SLOT(target_block_overlap(double)));
|
||||||
|
QObject::connect(radioButton_rectangleTarget, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_rectangle(bool)));
|
||||||
|
QObject::connect(spinBoxSynapses, SIGNAL(valueChanged(int)), sliderSynapses, SLOT(setValue(int)));
|
||||||
|
QObject::connect(spinBoxSynapses, SIGNAL(valueChanged(int)), MainWindow, SLOT(synapses(int)));
|
||||||
QObject::connect(sliderRatio, SIGNAL(valueChanged(int)), MainWindow, SLOT(ratio_slot(int)));
|
QObject::connect(sliderRatio, SIGNAL(valueChanged(int)), MainWindow, SLOT(ratio_slot(int)));
|
||||||
QObject::connect(sliderNRatio, SIGNAL(valueChanged(int)), MainWindow, SLOT(n_ratio_slot(int)));
|
QObject::connect(sliderNRatio, SIGNAL(valueChanged(int)), MainWindow, SLOT(n_ratio_slot(int)));
|
||||||
QObject::connect(doubleSpinBoxNRatio, SIGNAL(valueChanged(double)), MainWindow, SLOT(n_ratio_slot(double)));
|
QObject::connect(doubleSpinBoxNRatio, SIGNAL(valueChanged(double)), MainWindow, SLOT(n_ratio_slot(double)));
|
||||||
QObject::connect(sliderNMix, SIGNAL(valueChanged(int)), MainWindow, SLOT(n_mix_slot(int)));
|
QObject::connect(radioButton_dodgy, SIGNAL(toggled(bool)), MainWindow, SLOT(window_dodgy(bool)));
|
||||||
QObject::connect(sliderTargetMix, SIGNAL(valueChanged(int)), MainWindow, SLOT(target_mix_slot(int)));
|
QObject::connect(sliderTargetMix, SIGNAL(valueChanged(int)), MainWindow, SLOT(target_mix_slot(int)));
|
||||||
|
QObject::connect(sliderNMix, SIGNAL(valueChanged(int)), MainWindow, SLOT(n_mix_slot(int)));
|
||||||
QObject::connect(doubleSpinBoxNMix, SIGNAL(valueChanged(double)), MainWindow, SLOT(n_mix_slot(double)));
|
QObject::connect(doubleSpinBoxNMix, SIGNAL(valueChanged(double)), MainWindow, SLOT(n_mix_slot(double)));
|
||||||
QObject::connect(doubleSpinBoxTargetMix, SIGNAL(valueChanged(double)), MainWindow, SLOT(target_mix_slot(double)));
|
QObject::connect(pushButtonLoadBrain, SIGNAL(released()), MainWindow, SLOT(load_brain()));
|
||||||
|
QObject::connect(radioButtonSynaptic, SIGNAL(toggled(bool)), MainWindow, SLOT(algo_synaptic(bool)));
|
||||||
QObject::connect(doubleSpinBoxBoredom, SIGNAL(valueChanged(double)), MainWindow, SLOT(boredom_slot(double)));
|
QObject::connect(doubleSpinBoxBoredom, SIGNAL(valueChanged(double)), MainWindow, SLOT(boredom_slot(double)));
|
||||||
QObject::connect(sliderBoredom, SIGNAL(valueChanged(int)), MainWindow, SLOT(boredom_slot(int)));
|
|
||||||
QObject::connect(doubleSpinBoxNovelty, SIGNAL(valueChanged(double)), MainWindow, SLOT(novelty_slot(double)));
|
QObject::connect(doubleSpinBoxNovelty, SIGNAL(valueChanged(double)), MainWindow, SLOT(novelty_slot(double)));
|
||||||
QObject::connect(sliderNovelty, SIGNAL(valueChanged(int)), MainWindow, SLOT(novelty_slot(int)));
|
QObject::connect(sliderNovelty, SIGNAL(valueChanged(int)), MainWindow, SLOT(novelty_slot(int)));
|
||||||
QObject::connect(sliderSynapses, SIGNAL(valueChanged(int)), spinBoxSynapses, SLOT(setValue(int)));
|
QObject::connect(sliderBoredom, SIGNAL(valueChanged(int)), MainWindow, SLOT(boredom_slot(int)));
|
||||||
QObject::connect(sliderSynapses, SIGNAL(valueChanged(int)), MainWindow, SLOT(synapses(int)));
|
|
||||||
QObject::connect(spinBoxSynapses, SIGNAL(valueChanged(int)), sliderSynapses, SLOT(setValue(int)));
|
|
||||||
QObject::connect(spinBoxSynapses, SIGNAL(valueChanged(int)), MainWindow, SLOT(synapses(int)));
|
|
||||||
QObject::connect(radioButtonAlgoBasic, SIGNAL(toggled(bool)), MainWindow, SLOT(algo_basic(bool)));
|
|
||||||
QObject::connect(radioButtonAlgoRevBasic, SIGNAL(toggled(bool)), MainWindow, SLOT(algo_rev_basic(bool)));
|
|
||||||
QObject::connect(radioButtonSynaptic, SIGNAL(toggled(bool)), MainWindow, SLOT(algo_synaptic(bool)));
|
|
||||||
QObject::connect(radioButtonSynapticSlide, SIGNAL(toggled(bool)), MainWindow, SLOT(algo_synaptic_slide(bool)));
|
|
||||||
QObject::connect(pushButtonLoadBrain, SIGNAL(released()), MainWindow, SLOT(load_brain()));
|
|
||||||
QObject::connect(pushButtonSaveBrain, SIGNAL(released()), MainWindow, SLOT(save_brain()));
|
|
||||||
QObject::connect(spinBoxBlockSize, SIGNAL(valueChanged(int)), MainWindow, SLOT(block_size(int)));
|
|
||||||
QObject::connect(doubleSpinBoxBlockOverlap, SIGNAL(valueChanged(double)), MainWindow, SLOT(block_overlap(double)));
|
|
||||||
QObject::connect(radioButton_dodgy, SIGNAL(toggled(bool)), MainWindow, SLOT(window_dodgy(bool)));
|
|
||||||
QObject::connect(radioButton_bartlett, SIGNAL(toggled(bool)), MainWindow, SLOT(window_bartlett(bool)));
|
QObject::connect(radioButton_bartlett, SIGNAL(toggled(bool)), MainWindow, SLOT(window_bartlett(bool)));
|
||||||
QObject::connect(radioButton_blackman, SIGNAL(toggled(bool)), MainWindow, SLOT(window_blackman(bool)));
|
QObject::connect(radioButton_blackman, SIGNAL(toggled(bool)), MainWindow, SLOT(window_blackman(bool)));
|
||||||
QObject::connect(radioButton_flattop, SIGNAL(toggled(bool)), MainWindow, SLOT(window_flattop(bool)));
|
QObject::connect(sliderSynapses, SIGNAL(valueChanged(int)), MainWindow, SLOT(synapses(int)));
|
||||||
|
QObject::connect(radioButtonSynapticSlide, SIGNAL(toggled(bool)), MainWindow, SLOT(algo_synaptic_slide(bool)));
|
||||||
|
QObject::connect(spinBoxBlockSize, SIGNAL(valueChanged(int)), MainWindow, SLOT(block_size(int)));
|
||||||
|
QObject::connect(doubleSpinBoxBlockOverlap, SIGNAL(valueChanged(double)), MainWindow, SLOT(block_overlap(double)));
|
||||||
QObject::connect(radioButton_gaussian, SIGNAL(toggled(bool)), MainWindow, SLOT(window_gaussian(bool)));
|
QObject::connect(radioButton_gaussian, SIGNAL(toggled(bool)), MainWindow, SLOT(window_gaussian(bool)));
|
||||||
QObject::connect(radioButton_hamming, SIGNAL(toggled(bool)), MainWindow, SLOT(window_hamming(bool)));
|
QObject::connect(radioButton_flattop, SIGNAL(toggled(bool)), MainWindow, SLOT(window_flattop(bool)));
|
||||||
QObject::connect(radioButton_hann, SIGNAL(toggled(bool)), MainWindow, SLOT(window_hann(bool)));
|
QObject::connect(radioButtonAlgoBasic, SIGNAL(toggled(bool)), MainWindow, SLOT(algo_basic(bool)));
|
||||||
|
QObject::connect(radioButtonAlgoRevBasic, SIGNAL(toggled(bool)), MainWindow, SLOT(algo_rev_basic(bool)));
|
||||||
QObject::connect(radioButton_rectagle, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_rectangle(bool)));
|
QObject::connect(radioButton_rectagle, SIGNAL(toggled(bool)), MainWindow, SLOT(window_target_rectangle(bool)));
|
||||||
QObject::connect(pushButtonGenerate, SIGNAL(released()), MainWindow, SLOT(generate()));
|
QObject::connect(radioButton_hamming, SIGNAL(toggled(bool)), MainWindow, SLOT(window_hamming(bool)));
|
||||||
QObject::connect(pushButtonLoadSound, SIGNAL(released()), MainWindow, SLOT(load_sound()));
|
QObject::connect(pushButtonSaveBrain, SIGNAL(released()), MainWindow, SLOT(save_brain()));
|
||||||
QObject::connect(pushButtonDeleteSound, SIGNAL(released()), MainWindow, SLOT(delete_sound()));
|
QObject::connect(pushButtonDeleteSound, SIGNAL(released()), MainWindow, SLOT(delete_sound()));
|
||||||
QObject::connect(pushButtonClearBrain, SIGNAL(released()), MainWindow, SLOT(clear_brain()));
|
QObject::connect(pushButtonClearBrain, SIGNAL(released()), MainWindow, SLOT(clear_brain()));
|
||||||
|
QObject::connect(pushButtonGenerate, SIGNAL(released()), MainWindow, SLOT(generate()));
|
||||||
|
QObject::connect(pushButtonLoadSound, SIGNAL(released()), MainWindow, SLOT(load_sound()));
|
||||||
|
QObject::connect(radioButton_hann, SIGNAL(toggled(bool)), MainWindow, SLOT(window_hann(bool)));
|
||||||
|
QObject::connect(sliderSearchStretch, SIGNAL(valueChanged(int)), spinBoxSearchStretch, SLOT(setValue(int)));
|
||||||
|
QObject::connect(spinBoxSearchStretch, SIGNAL(valueChanged(int)), sliderSearchStretch, SLOT(setValue(int)));
|
||||||
|
QObject::connect(sliderSearchStretch, SIGNAL(valueChanged(int)), MainWindow, SLOT(search_stretch(int)));
|
||||||
|
QObject::connect(sliderSlideError, SIGNAL(valueChanged(int)), spinBoxSlideError, SLOT(setValue(int)));
|
||||||
|
QObject::connect(spinBoxSlideError, SIGNAL(valueChanged(int)), sliderSlideError, SLOT(setValue(int)));
|
||||||
|
QObject::connect(sliderSlideError, SIGNAL(valueChanged(int)), MainWindow, SLOT(slide_error(int)));
|
||||||
|
|
||||||
tabWidget->setCurrentIndex(0);
|
tabWidget->setCurrentIndex(0);
|
||||||
|
|
||||||
@ -965,7 +1043,7 @@ public:
|
|||||||
|
|
||||||
void retranslateUi(QMainWindow *MainWindow)
|
void retranslateUi(QMainWindow *MainWindow)
|
||||||
{
|
{
|
||||||
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "samplebrain 0.6", 0, QApplication::UnicodeUTF8));
|
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "samplebrain 0.7", 0, QApplication::UnicodeUTF8));
|
||||||
label_19->setText(QApplication::translate("MainWindow", "brain tweaks", 0, QApplication::UnicodeUTF8));
|
label_19->setText(QApplication::translate("MainWindow", "brain tweaks", 0, QApplication::UnicodeUTF8));
|
||||||
label_6->setText(QApplication::translate("MainWindow", "fft / mfcc", 0, QApplication::UnicodeUTF8));
|
label_6->setText(QApplication::translate("MainWindow", "fft / mfcc", 0, QApplication::UnicodeUTF8));
|
||||||
#ifndef QT_NO_TOOLTIP
|
#ifndef QT_NO_TOOLTIP
|
||||||
@ -999,17 +1077,17 @@ public:
|
|||||||
#endif // QT_NO_TOOLTIP
|
#endif // QT_NO_TOOLTIP
|
||||||
label_25->setText(QApplication::translate("MainWindow", "boredom", 0, QApplication::UnicodeUTF8));
|
label_25->setText(QApplication::translate("MainWindow", "boredom", 0, QApplication::UnicodeUTF8));
|
||||||
#ifndef QT_NO_TOOLTIP
|
#ifndef QT_NO_TOOLTIP
|
||||||
sliderBoredom->setToolTip(QApplication::translate("MainWindow", "how long it takes for the novelty to ware off", 0, QApplication::UnicodeUTF8));
|
sliderBoredom->setToolTip(QApplication::translate("MainWindow", "how long it takes for the novelty to wear off", 0, QApplication::UnicodeUTF8));
|
||||||
#endif // QT_NO_TOOLTIP
|
#endif // QT_NO_TOOLTIP
|
||||||
#ifndef QT_NO_TOOLTIP
|
#ifndef QT_NO_TOOLTIP
|
||||||
label_26->setToolTip(QString());
|
label_28->setToolTip(QString());
|
||||||
#endif // QT_NO_TOOLTIP
|
#endif // QT_NO_TOOLTIP
|
||||||
label_26->setText(QApplication::translate("MainWindow", "synpases", 0, QApplication::UnicodeUTF8));
|
label_28->setText(QApplication::translate("MainWindow", "search stretch", 0, QApplication::UnicodeUTF8));
|
||||||
#ifndef QT_NO_TOOLTIP
|
#ifndef QT_NO_TOOLTIP
|
||||||
sliderSynapses->setToolTip(QApplication::translate("MainWindow", "how many connections to search (ordered in closeness)", 0, QApplication::UnicodeUTF8));
|
sliderSearchStretch->setToolTip(QApplication::translate("MainWindow", "repeat search (set novelty to 0 for dodgy jungle timessssstretch)", 0, QApplication::UnicodeUTF8));
|
||||||
#endif // QT_NO_TOOLTIP
|
#endif // QT_NO_TOOLTIP
|
||||||
#ifndef QT_NO_TOOLTIP
|
#ifndef QT_NO_TOOLTIP
|
||||||
spinBoxSynapses->setToolTip(QApplication::translate("MainWindow", "how many connections to search (ordered in closeness)", 0, QApplication::UnicodeUTF8));
|
spinBoxSearchStretch->setToolTip(QApplication::translate("MainWindow", "how many connections to search (ordered in closeness)", 0, QApplication::UnicodeUTF8));
|
||||||
#endif // QT_NO_TOOLTIP
|
#endif // QT_NO_TOOLTIP
|
||||||
label_27->setText(QApplication::translate("MainWindow", "algorithm", 0, QApplication::UnicodeUTF8));
|
label_27->setText(QApplication::translate("MainWindow", "algorithm", 0, QApplication::UnicodeUTF8));
|
||||||
#ifndef QT_NO_TOOLTIP
|
#ifndef QT_NO_TOOLTIP
|
||||||
@ -1028,6 +1106,26 @@ public:
|
|||||||
radioButtonSynapticSlide->setToolTip(QApplication::translate("MainWindow", "search based on synapses and sonify search process", 0, QApplication::UnicodeUTF8));
|
radioButtonSynapticSlide->setToolTip(QApplication::translate("MainWindow", "search based on synapses and sonify search process", 0, QApplication::UnicodeUTF8));
|
||||||
#endif // QT_NO_TOOLTIP
|
#endif // QT_NO_TOOLTIP
|
||||||
radioButtonSynapticSlide->setText(QApplication::translate("MainWindow", "synaptic slide", 0, QApplication::UnicodeUTF8));
|
radioButtonSynapticSlide->setText(QApplication::translate("MainWindow", "synaptic slide", 0, QApplication::UnicodeUTF8));
|
||||||
|
#ifndef QT_NO_TOOLTIP
|
||||||
|
label_26->setToolTip(QString());
|
||||||
|
#endif // QT_NO_TOOLTIP
|
||||||
|
label_26->setText(QApplication::translate("MainWindow", "num synpases", 0, QApplication::UnicodeUTF8));
|
||||||
|
#ifndef QT_NO_TOOLTIP
|
||||||
|
sliderSynapses->setToolTip(QApplication::translate("MainWindow", "how many connections to search (ordered in closeness)", 0, QApplication::UnicodeUTF8));
|
||||||
|
#endif // QT_NO_TOOLTIP
|
||||||
|
#ifndef QT_NO_TOOLTIP
|
||||||
|
spinBoxSynapses->setToolTip(QApplication::translate("MainWindow", "how many connections to search (ordered in closeness)", 0, QApplication::UnicodeUTF8));
|
||||||
|
#endif // QT_NO_TOOLTIP
|
||||||
|
#ifndef QT_NO_TOOLTIP
|
||||||
|
label_29->setToolTip(QString());
|
||||||
|
#endif // QT_NO_TOOLTIP
|
||||||
|
label_29->setText(QApplication::translate("MainWindow", "synaptic slide error", 0, QApplication::UnicodeUTF8));
|
||||||
|
#ifndef QT_NO_TOOLTIP
|
||||||
|
sliderSlideError->setToolTip(QApplication::translate("MainWindow", "block difference higher than this causes a new search, skipping the target", 0, QApplication::UnicodeUTF8));
|
||||||
|
#endif // QT_NO_TOOLTIP
|
||||||
|
#ifndef QT_NO_TOOLTIP
|
||||||
|
spinBoxSlideError->setToolTip(QApplication::translate("MainWindow", "how many connections to search (ordered in closeness)", 0, QApplication::UnicodeUTF8));
|
||||||
|
#endif // QT_NO_TOOLTIP
|
||||||
label_23->setText(QApplication::translate("MainWindow", "mix", 0, QApplication::UnicodeUTF8));
|
label_23->setText(QApplication::translate("MainWindow", "mix", 0, QApplication::UnicodeUTF8));
|
||||||
label_21->setText(QApplication::translate("MainWindow", "dynamic / normalised ", 0, QApplication::UnicodeUTF8));
|
label_21->setText(QApplication::translate("MainWindow", "dynamic / normalised ", 0, QApplication::UnicodeUTF8));
|
||||||
#ifndef QT_NO_TOOLTIP
|
#ifndef QT_NO_TOOLTIP
|
||||||
@ -1087,4 +1185,4 @@ namespace Ui {
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // SAMPLEBRAINUQB562_H
|
#endif // SAMPLEBRAINJ32146_H
|
||||||
|
@ -26,7 +26,7 @@ using namespace std;
|
|||||||
using namespace spiralcore;
|
using namespace spiralcore;
|
||||||
|
|
||||||
static const u32 NUM_FIXED_SYNAPSES = 1000;
|
static const u32 NUM_FIXED_SYNAPSES = 1000;
|
||||||
static const double usage_factor = 1000000;
|
static const double usage_factor = 1000;
|
||||||
|
|
||||||
brain::brain() :
|
brain::brain() :
|
||||||
m_current_block_index(0),
|
m_current_block_index(0),
|
||||||
|
@ -123,13 +123,16 @@ int main(int argc, char *argv[])
|
|||||||
source.set_usage_falloff(0.9);
|
source.set_usage_falloff(0.9);
|
||||||
rr.get_params()->m_num_synapses=40;
|
rr.get_params()->m_num_synapses=40;
|
||||||
rr.set_slide_error(3400.5);
|
rr.set_slide_error(3400.5);
|
||||||
rr.set_search_algo(renderer::SYNAPTIC_SLIDE);
|
rr.set_search_algo(renderer::SYNAPTIC);
|
||||||
rr.set_target_mix(0.2);
|
rr.set_target_mix(0.2);
|
||||||
|
rr.set_stretch(10);
|
||||||
a->start_recording("debug");
|
a->start_recording("debug");
|
||||||
a->m_client.set_callback(run_audio, &rr);
|
a->m_client.set_callback(run_audio, &rr);
|
||||||
|
|
||||||
//target.resynth("shosta-dream-0.5.wav",source,0.5);
|
//target.resynth("shosta-dream-0.5.wav",source,0.5);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while (true) sleep(1);
|
while (true) sleep(1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ void renderer::init(brain &source, brain &target) {
|
|||||||
m_slide_error=1;
|
m_slide_error=1;
|
||||||
m_target_index=0;
|
m_target_index=0;
|
||||||
m_target_counter=0;
|
m_target_counter=0;
|
||||||
|
m_stretch=1;
|
||||||
m_last_tgt_shift=0;
|
m_last_tgt_shift=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +59,7 @@ void renderer::process(u32 nframes, float *buf) {
|
|||||||
clean_up();
|
clean_up();
|
||||||
|
|
||||||
m_render_time+=nframes;
|
m_render_time+=nframes;
|
||||||
m_target_time+=nframes;
|
m_target_time+=nframes/(float)m_stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool renderer::find_render_blocks(u32 nframes) {
|
bool renderer::find_render_blocks(u32 nframes) {
|
||||||
@ -70,7 +71,8 @@ bool renderer::find_render_blocks(u32 nframes) {
|
|||||||
|
|
||||||
// stuff has changed - recompute and abort
|
// stuff has changed - recompute and abort
|
||||||
if (tgt_shift!=m_last_tgt_shift ||
|
if (tgt_shift!=m_last_tgt_shift ||
|
||||||
tgt_end>=m_target.get_num_blocks() || m_source.get_num_blocks()==0) {
|
tgt_end>=m_target.get_num_blocks() ||
|
||||||
|
m_source.get_num_blocks()==0) {
|
||||||
reset();
|
reset();
|
||||||
m_last_tgt_shift = tgt_shift;
|
m_last_tgt_shift = tgt_shift;
|
||||||
// next time...
|
// next time...
|
||||||
@ -78,13 +80,19 @@ bool renderer::find_render_blocks(u32 nframes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// cerr<<"-----------------"<<endl;
|
/* cerr<<"-----------------"<<endl;
|
||||||
// cerr<<"tgt start:"<<m_target_index<<endl;
|
cerr<<"tgt start:"<<m_target_index<<endl;
|
||||||
// cerr<<"tgt end:"<<tgt_end<<endl;
|
cerr<<"tgt end:"<<tgt_end<<endl;
|
||||||
|
cerr<<":"<<tgt_end-m_target_index<<endl;
|
||||||
|
cerr<<"block time "<<m_target_counter*tgt_shift<<endl;
|
||||||
|
cerr<<"target time "<<m_target_time<<endl;
|
||||||
|
cerr<<"render time "<<m_render_time<<endl;
|
||||||
|
|
||||||
|
cerr<<": "<<(s32)m_render_time-(s32)(m_target_time)<<endl;*/
|
||||||
|
|
||||||
// search phase
|
// search phase
|
||||||
// get indices for current buffer
|
// get indices for current buffer
|
||||||
u32 counter = m_target_counter;
|
u32 counter = m_target_index;
|
||||||
//u32 cur_time = m_render_time;
|
//u32 cur_time = m_render_time;
|
||||||
while (counter<=tgt_end) {
|
while (counter<=tgt_end) {
|
||||||
u32 time=m_target_counter*tgt_shift;
|
u32 time=m_target_counter*tgt_shift;
|
||||||
@ -107,8 +115,9 @@ bool renderer::find_render_blocks(u32 nframes) {
|
|||||||
m_render_blocks.push_back(render_block(src_index,m_target_index,time));
|
m_render_blocks.push_back(render_block(src_index,m_target_index,time));
|
||||||
|
|
||||||
if (m_source.get_current_error()<m_slide_error &&
|
if (m_source.get_current_error()<m_slide_error &&
|
||||||
m_target_counter%1==0) {
|
m_target_counter%m_stretch==0) {
|
||||||
m_target_index++;
|
m_target_index++;
|
||||||
|
//m_target_time+=tgt_shift;
|
||||||
}
|
}
|
||||||
m_target_counter++;
|
m_target_counter++;
|
||||||
|
|
||||||
@ -116,8 +125,9 @@ bool renderer::find_render_blocks(u32 nframes) {
|
|||||||
// put them in the index list
|
// put them in the index list
|
||||||
m_render_blocks.push_back(render_block(src_index,m_target_index,time));
|
m_render_blocks.push_back(render_block(src_index,m_target_index,time));
|
||||||
|
|
||||||
if (m_target_counter%1==0) {
|
if (m_target_counter%m_stretch==0) {
|
||||||
m_target_index++;
|
m_target_index++;
|
||||||
|
//m_target_time+=tgt_shift;
|
||||||
}
|
}
|
||||||
m_target_counter++;
|
m_target_counter++;
|
||||||
}
|
}
|
||||||
@ -214,6 +224,14 @@ void renderer::old_process(u32 nframes, float *buf) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cerr<<"-----------------"<<endl;
|
||||||
|
cerr<<"tgt start:"<<m_target_index<<endl;
|
||||||
|
cerr<<"tgt end:"<<tgt_end<<endl;
|
||||||
|
cerr<<":"<<tgt_end-m_target_index<<endl;
|
||||||
|
cerr<<"block time "<<m_target_index*tgt_shift<<endl;
|
||||||
|
cerr<<"render time "<<m_render_time<<endl;
|
||||||
|
cerr<<": "<<(s32)m_render_time-(s32)(m_target_index*tgt_shift)<<endl;
|
||||||
|
|
||||||
|
|
||||||
// cerr<<"-----------------"<<endl;
|
// cerr<<"-----------------"<<endl;
|
||||||
// cerr<<"tgt start:"<<m_target_index<<endl;
|
// cerr<<"tgt start:"<<m_target_index<<endl;
|
||||||
|
@ -51,6 +51,7 @@ renderer(brain &source, brain &target) :
|
|||||||
void set_n_mix(float s) { m_n_mix=s; }
|
void set_n_mix(float s) { m_n_mix=s; }
|
||||||
void set_target_mix(float s) { m_target_mix=s; }
|
void set_target_mix(float s) { m_target_mix=s; }
|
||||||
void set_slide_error(double s) { m_slide_error=s; }
|
void set_slide_error(double s) { m_slide_error=s; }
|
||||||
|
void set_stretch(u32 s) { m_stretch=s; }
|
||||||
search_params *get_params() { return &m_search_params; }
|
search_params *get_params() { return &m_search_params; }
|
||||||
|
|
||||||
brain &get_source() { return m_source; }
|
brain &get_source() { return m_source; }
|
||||||
@ -83,7 +84,7 @@ private:
|
|||||||
bool m_playing;
|
bool m_playing;
|
||||||
u32 m_target_index;
|
u32 m_target_index;
|
||||||
u32 m_target_counter;
|
u32 m_target_counter;
|
||||||
u32 m_target_time;
|
float m_target_time;
|
||||||
u32 m_render_time;
|
u32 m_render_time;
|
||||||
u32 m_stretch;
|
u32 m_stretch;
|
||||||
float m_n_mix;
|
float m_n_mix;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user