diff --git a/python/features/__init__.pyc b/python/features/__init__.pyc
index c07e3b9..b773fc6 100644
Binary files a/python/features/__init__.pyc and b/python/features/__init__.pyc differ
diff --git a/python/features/base.pyc b/python/features/base.pyc
index 7c27d70..fe94496 100644
Binary files a/python/features/base.pyc and b/python/features/base.pyc differ
diff --git a/python/features/sigproc.pyc b/python/features/sigproc.pyc
index 4d16a0b..fbf3dbc 100644
Binary files a/python/features/sigproc.pyc and b/python/features/sigproc.pyc differ
diff --git a/samplebrain/interface/samplebrain.ui b/samplebrain/interface/samplebrain.ui
index 160bb47..110b8e9 100644
--- a/samplebrain/interface/samplebrain.ui
+++ b/samplebrain/interface/samplebrain.ui
@@ -7,11 +7,11 @@
0
0
910
- 795
+ 659
- samplebrain 0.15
+ samplebrain 0.16
@@ -25,7 +25,7 @@
- 1
+ 0
@@ -507,84 +507,41 @@
-
-
-
-
- Comic Sans MS
- 10
- 75
- true
-
-
-
- algorithm
-
-
-
- -
-
+
-
-
-
- full brain search
+
+
+
+ 9
+
- basic
+ algorithm
-
- true
-
-
- buttonGroup_3
-
-
-
-
- full brain reverse search
-
-
- rev basic
-
-
- buttonGroup_3
-
-
-
- -
-
-
- search based on synapse connections
-
-
- synaptic
-
-
- false
-
-
- buttonGroup_3
-
-
-
- -
-
-
- true
-
-
- search based on synapses and sonify search process
-
-
- synaptic slide
-
-
- true
-
-
- buttonGroup_3
-
+
+
-
+
+ basic
+
+
+ -
+
+ reversed
+
+
+ -
+
+ synaptic
+
+
+ -
+
+ slide
+
+
@@ -722,14 +679,14 @@
-
-
+
- Qt::Horizontal
+ Qt::Vertical
- 21
- 20
+ 20
+ 40
@@ -827,97 +784,58 @@
-
-
-
-
-
-
- bartlett
-
-
- buttonGroup_2
-
-
-
- -
-
-
- blackman
-
-
- buttonGroup_2
-
-
-
- -
-
-
- gaussian
-
-
- buttonGroup_2
-
-
-
- -
-
-
- hamming
-
-
- buttonGroup_2
-
-
-
- -
-
-
- hann
-
-
- buttonGroup_2
-
-
-
- -
-
-
- flat top
-
-
- buttonGroup_2
-
-
-
- -
-
-
- dodgy
-
-
- true
-
-
- buttonGroup_2
-
-
-
- -
-
-
- rectangle
-
-
- buttonGroup_2
-
-
-
- -
+
+
-
window shape
+ -
+
+
-
+
+ dodgy
+
+
+ -
+
+ bartlett
+
+
+ -
+
+ blackman
+
+
+ -
+
+ flat top
+
+
+ -
+
+ gaussian
+
+
+ -
+
+ hamming
+
+
+ -
+
+ hann
+
+
+ -
+
+ rectangle
+
+
+
+
-
@@ -1019,7 +937,7 @@
- dynamic / normalised
+ normalised
@@ -1163,7 +1081,32 @@
-
-
+
+
+
+ 0
+ 200
+
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 259
+ 198
+
+
+
+
-
+
+
+
+
+
-
@@ -1182,7 +1125,7 @@
-
-
+
Comic Sans MS
@@ -1191,26 +1134,12 @@
- delete selected
+ clear brain
- -
-
-
-
- Comic Sans MS
- 75
- true
-
-
-
- clear brain
-
-
-
-
-
@@ -1271,97 +1200,58 @@
-
-
-
-
-
-
- gaussian
-
-
- buttonGroup
-
-
-
- -
-
-
- hamming
-
-
- buttonGroup
-
-
-
- -
-
-
- dodgy
-
-
- true
-
-
- buttonGroup
-
-
-
- -
-
-
- blackman
-
-
- buttonGroup
-
-
-
- -
-
-
- rectangle
-
-
- buttonGroup
-
-
-
- -
-
-
- bartlett
-
-
- buttonGroup
-
-
-
- -
-
-
- flat top
-
-
- buttonGroup
-
-
-
- -
-
-
- hann
-
-
- buttonGroup
-
-
-
- -
-
+
+
-
+
window shape
+ -
+
+
-
+
+ dodgy
+
+
+ -
+
+ bartlett
+
+
+ -
+
+ blackman
+
+
+ -
+
+ flat top
+
+
+ -
+
+ gaussian
+
+
+ -
+
+ hamming
+
+
+ -
+
+ hann
+
+
+ -
+
+ rectangle
+
+
+
+
-
@@ -1688,38 +1578,6 @@
-
- radioButton_dodgyTarget
- toggled(bool)
- MainWindow
- window_target_dodgy(bool)
-
-
- 449
- 261
-
-
- 361
- 301
-
-
-
-
- radioButton_blackmanTarget
- toggled(bool)
- MainWindow
- window_target_blackman(bool)
-
-
- 449
- 319
-
-
- 361
- 301
-
-
-
spinBoxFFT1End
valueChanged(int)
@@ -1752,38 +1610,6 @@
-
- radioButton_hannTarget
- toggled(bool)
- MainWindow
- window_target_hann(bool)
-
-
- 619
- 319
-
-
- 361
- 301
-
-
-
-
- radioButton_gaussianTarget
- toggled(bool)
- MainWindow
- window_target_gaussian(bool)
-
-
- 619
- 261
-
-
- 361
- 301
-
-
-
sliderSynapses
valueChanged(int)
@@ -1880,54 +1706,6 @@
-
- radioButton_hammingTarget
- toggled(bool)
- MainWindow
- window_target_hamming(bool)
-
-
- 619
- 290
-
-
- 361
- 301
-
-
-
-
- radioButton_flattopTarget
- toggled(bool)
- MainWindow
- window_target_flattop(bool)
-
-
- 449
- 348
-
-
- 361
- 301
-
-
-
-
- radioButton_bartlettTarget
- toggled(bool)
- MainWindow
- window_target_bartlett(bool)
-
-
- 449
- 290
-
-
- 361
- 301
-
-
-
doubleSpinBoxBlockOverlapTarget
valueChanged(double)
@@ -1944,22 +1722,6 @@
-
- radioButton_rectangleTarget
- toggled(bool)
- MainWindow
- window_target_rectangle(bool)
-
-
- 619
- 348
-
-
- 361
- 301
-
-
-
spinBoxSynapses
valueChanged(int)
@@ -2040,22 +1802,6 @@
-
- radioButton_dodgy
- toggled(bool)
- MainWindow
- window_dodgy(bool)
-
-
- 615
- 203
-
-
- 566
- 345
-
-
-
sliderTargetMix
valueChanged(int)
@@ -2120,22 +1866,6 @@
-
- radioButtonSynaptic
- toggled(bool)
- MainWindow
- algo_synaptic(bool)
-
-
- 215
- 348
-
-
- 566
- 345
-
-
-
doubleSpinBoxBoredom
valueChanged(double)
@@ -2200,38 +1930,6 @@
-
- radioButton_bartlett
- toggled(bool)
- MainWindow
- window_bartlett(bool)
-
-
- 615
- 232
-
-
- 566
- 345
-
-
-
-
- radioButton_blackman
- toggled(bool)
- MainWindow
- window_blackman(bool)
-
-
- 615
- 261
-
-
- 566
- 345
-
-
-
sliderSynapses
valueChanged(int)
@@ -2248,22 +1946,6 @@
-
- radioButtonSynapticSlide
- toggled(bool)
- MainWindow
- algo_synaptic_slide(bool)
-
-
- 314
- 348
-
-
- 566
- 345
-
-
-
spinBoxBlockSize
valueChanged(int)
@@ -2296,102 +1978,6 @@
-
- radioButton_gaussian
- toggled(bool)
- MainWindow
- window_gaussian(bool)
-
-
- 728
- 203
-
-
- 566
- 345
-
-
-
-
- radioButton_flattop
- toggled(bool)
- MainWindow
- window_flattop(bool)
-
-
- 615
- 290
-
-
- 566
- 345
-
-
-
-
- radioButtonAlgoBasic
- toggled(bool)
- MainWindow
- algo_basic(bool)
-
-
- 51
- 348
-
-
- 566
- 345
-
-
-
-
- radioButtonAlgoRevBasic
- toggled(bool)
- MainWindow
- algo_rev_basic(bool)
-
-
- 129
- 348
-
-
- 566
- 345
-
-
-
-
- radioButton_rectagle
- toggled(bool)
- MainWindow
- window_target_rectangle(bool)
-
-
- 728
- 290
-
-
- 566
- 345
-
-
-
-
- radioButton_hamming
- toggled(bool)
- MainWindow
- window_hamming(bool)
-
-
- 728
- 232
-
-
- 566
- 345
-
-
-
pushButtonSaveBrain
released()
@@ -2408,22 +1994,6 @@
-
- pushButtonDeleteSound
- released()
- MainWindow
- delete_sound()
-
-
- 951
- 550
-
-
- 566
- 345
-
-
-
pushButtonClearBrain
released()
@@ -2472,22 +2042,6 @@
-
- radioButton_hann
- toggled(bool)
- MainWindow
- window_hann(bool)
-
-
- 728
- 261
-
-
- 566
- 345
-
-
-
sliderSearchStretch
valueChanged(int)
@@ -2696,6 +2250,54 @@
+
+ comboBoxAlgorithm
+ currentIndexChanged(int)
+ MainWindow
+ algo(int)
+
+
+ 273
+ 395
+
+
+ 454
+ 329
+
+
+
+
+ comboBoxTargetShape
+ currentIndexChanged(int)
+ MainWindow
+ target_shape(int)
+
+
+ 557
+ 233
+
+
+ 454
+ 329
+
+
+
+
+ comboBoxBrainShape
+ currentIndexChanged(int)
+ MainWindow
+ brain_shape(int)
+
+
+ 824
+ 432
+
+
+ 454
+ 329
+
+
+
play_slot()
@@ -2721,22 +2323,6 @@
generate_target_blocks()
clear_brain()
restart_audio()
- window_dodgy(bool)
- window_bartlett(bool)
- window_blackman(bool)
- window_flattop(bool)
- window_gaussian(bool)
- window_hamming(bool)
- window_hann(bool)
- window_rectangle(bool)
- window_target_dodgy(bool)
- window_target_bartlett(bool)
- window_target_blackman(bool)
- window_target_flattop(bool)
- window_target_gaussian(bool)
- window_target_hamming(bool)
- window_target_hann(bool)
- window_target_rectangle(bool)
record()
stop_record()
n_ratio_slot(int)
@@ -2751,10 +2337,6 @@
boredom_slot(int)
boredom_slot(double)
synapses(int)
- algo_basic(bool)
- algo_rev_basic(bool)
- algo_synaptic(bool)
- algo_synaptic_slide(bool)
load_brain()
save_brain()
slide_error(int)
@@ -2766,6 +2348,9 @@
load_session()
save_session()
stereo_mode(bool)
+ target_shape(int)
+ brain_shape(int)
+ algo(int)
diff --git a/samplebrain/qt/MainWindow.cpp b/samplebrain/qt/MainWindow.cpp
index 3e48042..ffc55d4 100644
--- a/samplebrain/qt/MainWindow.cpp
+++ b/samplebrain/qt/MainWindow.cpp
@@ -31,6 +31,15 @@ MainWindow::MainWindow() :
m_Ui.setupUi(this);
setUnifiedTitleAndToolBarOnMac(true);
+ m_sound_item_enable_mapper = new QSignalMapper(this);
+ m_Ui.brain_contents->setAlignment(Qt::AlignTop);
+ m_Ui.brain_contents->setSpacing(0);
+ m_Ui.brain_contents->setMargin(0);
+ m_Ui.brain_contents->setContentsMargins(0,0,0,0);
+ connect(m_sound_item_enable_mapper,
+ SIGNAL(mapped(int)), this, SLOT(sound_enable(int)));
+ m_current_sound_id=0;
+
// add default local dest
// turn on first one
@@ -108,9 +117,9 @@ void MainWindow::init_from_session(const string &filename) {
float source_overlap;
int t_int;
// skip this...
- ifs||target_windowsize||target_overlap;
ifs||source_windowsize||source_overlap;
- ifs||target_window||source_window;
+ ifs||target_windowsize||target_overlap;
+ ifs||source_window||target_window;
// todo: probably don't need to load all the sample data too :/
ifs||s;
ifs||t;
@@ -133,12 +142,7 @@ void MainWindow::init_from_session(const string &filename) {
m_Ui.sliderSearchStretch->setValue(r.get_stretch());
m_Ui.spinBoxSearchStretch->setValue(r.get_stretch());
- switch(r.get_search_algo()) {
- case renderer::BASIC: m_Ui.radioButtonAlgoBasic->setChecked(true); break;
- case renderer::REV_BASIC: m_Ui.radioButtonAlgoRevBasic->setChecked(true); break;
- case renderer::SYNAPTIC: m_Ui.radioButtonSynaptic->setChecked(true); break;
- case renderer::SYNAPTIC_SLIDE: m_Ui.radioButtonSynapticSlide->setChecked(true); break;
- };
+ m_Ui.comboBoxAlgorithm->setCurrentIndex(r.get_search_algo());
m_Ui.sliderSynapses->setValue(p->m_num_synapses);
m_Ui.spinBoxSynapses->setValue(p->m_num_synapses);
@@ -149,50 +153,22 @@ void MainWindow::init_from_session(const string &filename) {
m_Ui.spinBoxBlockSizeTarget->setValue(t.get_block_size());
m_Ui.doubleSpinBoxBlockOverlapTarget->setValue(t.get_overlap()/(float)t.get_block_size());
- m_Ui.radioButton_dodgyTarget->setChecked(false);
- m_Ui.radioButton_bartlettTarget->setChecked(false);
- m_Ui.radioButton_blackmanTarget->setChecked(false);
- m_Ui.radioButton_flattopTarget->setChecked(false);
- m_Ui.radioButton_gaussianTarget->setChecked(false);
- m_Ui.radioButton_hammingTarget->setChecked(false);
- m_Ui.radioButton_hannTarget->setChecked(false);
- m_Ui.radioButton_rectangleTarget->setChecked(false);
-
- switch(target_window) {
- case window::DODGY: m_Ui.radioButton_dodgyTarget->setChecked(true); break;
- case window::BARTLETT: m_Ui.radioButton_bartlettTarget->setChecked(true); break;
- case window::BLACKMAN: m_Ui.radioButton_blackmanTarget->setChecked(true); break;
- case window::FLAT_TOP: m_Ui.radioButton_flattopTarget->setChecked(true); break;
- case window::GAUSSIAN: m_Ui.radioButton_gaussianTarget->setChecked(true); break;
- case window::HAMMING: m_Ui.radioButton_hammingTarget->setChecked(true); break;
- case window::HANN: m_Ui.radioButton_hannTarget->setChecked(true); break;
- case window::RECTANGLE: m_Ui.radioButton_rectangleTarget->setChecked(true); break;
- default: break;
- };
+ m_Ui.comboBoxTargetShape->setCurrentIndex(target_window);
// source
m_Ui.spinBoxBlockSize->setValue(s.get_block_size());
m_Ui.doubleSpinBoxBlockOverlap->setValue(s.get_overlap()/(float)s.get_block_size());
- switch(source_window) {
- case window::DODGY: m_Ui.radioButton_dodgy->setChecked(true); break;
- case window::BARTLETT: m_Ui.radioButton_bartlett->setChecked(true); break;
- case window::BLACKMAN: m_Ui.radioButton_blackman->setChecked(true); break;
- case window::FLAT_TOP: m_Ui.radioButton_flattop->setChecked(true); break;
- case window::GAUSSIAN: m_Ui.radioButton_gaussian->setChecked(true); break;
- case window::HAMMING: m_Ui.radioButton_hamming->setChecked(true); break;
- case window::HANN: m_Ui.radioButton_hann->setChecked(true); break;
- case window::RECTANGLE: m_Ui.radioButton_rectagle->setChecked(true); break;
- default: break;
- };
+ m_Ui.comboBoxBrainShape->setCurrentIndex(source_window);
// brain samples
- m_Ui.listWidgetSounds->clear();
+ // m_Ui.listWidgetSounds->clear();
const std::list samples = s.get_samples();
for (std::list::const_iterator i=samples.begin();
i!=samples.end(); ++i) {
- m_Ui.listWidgetSounds->addItem(QString::fromStdString(i->m_filename));
+ add_sound_item(i->m_filename);
}
+
// mix
m_Ui.sliderTargetMix->setValue(r.get_target_mix()*100);
m_Ui.doubleSpinBoxTargetMix->setValue(r.get_target_mix());
@@ -204,3 +180,53 @@ void MainWindow::init_from_session(const string &filename) {
}
+
+
+void MainWindow::add_sound_item(const string &name) {
+ sound_item si;
+ si.m_filename = name;
+ si.m_id = m_current_sound_id++;
+ QString style("background-color:lightblue;");
+ if (m_sound_items.size()%2==0) style="background-color:pink;";
+
+ si.m_container = new QHBoxLayout();
+ si.m_enable = new QCheckBox();
+ si.m_enable->setChecked(true);
+ si.m_enable->setStyleSheet(style);
+ si.m_container->addWidget(si.m_enable);
+ QLabel *l = new QLabel();
+
+
+ QFileInfo fi(QString::fromStdString(name));
+ l->setText(fi.fileName());
+ l->setStyleSheet(style);
+ si.m_container->addWidget(l);
+
+ QSpacerItem *spacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+ //spacer->setStyleSheet(style);
+ si.m_container->addItem(spacer);
+
+ QPushButton *del = new QPushButton();
+ del->setText("x");
+ del->setMaximumWidth(20);
+ del->setMaximumHeight(20);
+ si.m_container->addWidget(del);
+
+ m_Ui.brain_contents->addLayout(si.m_container);
+
+ QObject::connect(si.m_enable, SIGNAL(clicked()), m_sound_item_enable_mapper, SLOT(map()));
+ m_sound_item_enable_mapper->setMapping(si.m_enable, si.m_id);
+
+ m_sound_items.push_back(si);
+}
+
+void MainWindow::clear_sound_items() {
+ for (auto si:m_sound_items) {
+ delete si.m_container;
+ }
+ m_sound_items.clear();
+}
+
+
+void MainWindow::delete_sound_item(const string &name) {
+}
diff --git a/samplebrain/qt/MainWindow.h b/samplebrain/qt/MainWindow.h
index 326f6fc..d840235 100644
--- a/samplebrain/qt/MainWindow.h
+++ b/samplebrain/qt/MainWindow.h
@@ -128,11 +128,7 @@ private slots:
}
void volume_slot(int s) { send_audio_osc("/volume","f",s/100.0f); }
-
- void algo_basic(bool s) { if (s) send_audio_osc("/search_algo","i",0); }
- void algo_rev_basic(bool s) { if (s) send_audio_osc("/search_algo","i",1); }
- void algo_synaptic(bool s) { if (s) send_audio_osc("/search_algo","i",2); }
- void algo_synaptic_slide(bool s) { if (s) send_audio_osc("/search_algo","i",3); }
+ void algo(int n) { send_audio_osc("/search_algo","i",n); }
void run_slot() {}
void load_target() {
@@ -160,40 +156,26 @@ private slots:
send_process_osc("/load_sample","s",m_last_file.toStdString().c_str());
- m_Ui.listWidgetSounds->addItem(m_last_file);
+ add_sound_item(m_last_file.toStdString());
+ //m_Ui.listWidgetSounds->addItem(m_last_file);
}
void delete_sound() {
- QList itemList = m_Ui.listWidgetSounds->selectedItems();
- for (int i=0; itext().toStdString().c_str());
- }
- qDeleteAll(m_Ui.listWidgetSounds->selectedItems());
+ //QList itemList = m_Ui.listWidgetSounds->selectedItems();
+ //for (int i=0; itext().toStdString().c_str());
+ //}
+ //qDeleteAll(m_Ui.listWidgetSounds->selectedItems());
}
void clear_brain() {
- for (int i=0; icount(); i++) {
- send_process_osc("/delete_sample","s",m_Ui.listWidgetSounds->item(i)->text().toStdString().c_str());
- }
- m_Ui.listWidgetSounds->clear();
+ //for (int i=0; icount(); i++) {
+ // send_process_osc("/delete_sample","s",m_Ui.listWidgetSounds->item(i)->text().toStdString().c_str());
+ //}
+ //m_Ui.listWidgetSounds->clear();
}
void restart_audio() { send_audio_osc("/restart_audio",""); }
- void window_dodgy(bool s) { if (s) send_process_osc("/window_type","i",window::DODGY); }
- void window_bartlett(bool s) { if (s) send_process_osc("/window_type","i",window::BARTLETT); }
- void window_blackman(bool s) { if (s) send_process_osc("/window_type","i",window::BLACKMAN); }
- void window_flattop(bool s) { if (s) send_process_osc("/window_type","i",window::FLAT_TOP); }
- void window_gaussian(bool s) { if (s) send_process_osc("/window_type","i",window::GAUSSIAN); }
- void window_hamming(bool s) { if (s) send_process_osc("/window_type","i",window::HAMMING); }
- void window_hann(bool s) { if (s) send_process_osc("/window_type","i",window::HANN); }
- void window_rectangle(bool s) { if (s) send_process_osc("/window_type","i",window::RECTANGLE); }
-
- void window_target_dodgy(bool s) { if (s) send_process_osc("/target_window_type","i",window::DODGY); }
- void window_target_bartlett(bool s) { if (s) send_process_osc("/target_window_type","i",window::BARTLETT); }
- void window_target_blackman(bool s) { if (s) send_process_osc("/target_window_type","i",window::BLACKMAN); }
- void window_target_flattop(bool s) { if (s) send_process_osc("/target_window_type","i",window::FLAT_TOP); }
- void window_target_gaussian(bool s) { if (s) send_process_osc("/target_window_type","i",window::GAUSSIAN); }
- void window_target_hamming(bool s) { if (s) send_process_osc("/target_window_type","i",window::HAMMING); }
- void window_target_hann(bool s) { if (s) send_process_osc("/target_window_type","i",window::HANN); }
- void window_target_rectangle(bool s) { if (s) send_process_osc("/target_window_type","i",window::RECTANGLE); }
+ void brain_shape(int n) { send_process_osc("/window_type","i",n); }
+ void target_shape(int n) { send_process_osc("/target_window_type","i",n); }
void record() {
if (m_save_wav=="") {
@@ -271,7 +253,6 @@ private slots:
}
void net_enable(int id) {
- cerr<<"enable "<isChecked()) {
@@ -290,13 +271,43 @@ private slots:
}
- void net_connect(int id) {
- cerr<<"connect "<isChecked()) {
+ send_process_osc("/activate_sound","s",si.m_filename.c_str());
+ } else {
+ send_process_osc("/deactivate_sound","s",si.m_filename.c_str());
+ }
+ }
+ }
}
private:
+ ///////////////////////////////////////////////
+
+ // we want to be able to send out to
+ // multiple addresses over the network
+ class sound_item {
+ public:
+ int m_id;
+ string m_filename;
+ // can't find a way to address these via qt
+ QCheckBox *m_enable;
+ QHBoxLayout *m_container;
+ };
+
+ vector m_sound_items;
+
+ void add_sound_item(const string &name);
+ void delete_sound_item(const string &name);
+ void clear_sound_items();
+
+ ////////////////////////////////////////////////
+
+
// we want to be able to send out to
// multiple addresses over the network
class osc_destination {
@@ -358,4 +369,7 @@ private:
u32 m_record_id;
Ui_MainWindow m_Ui;
feedback m_feedback;
+
+ int m_current_sound_id;
+ QSignalMapper* m_sound_item_enable_mapper;
};
diff --git a/samplebrain/qt/audio_thread.cpp b/samplebrain/qt/audio_thread.cpp
index 2b68062..5893e63 100644
--- a/samplebrain/qt/audio_thread.cpp
+++ b/samplebrain/qt/audio_thread.cpp
@@ -175,6 +175,6 @@ void audio_thread::process(sample &s, sample &s2) {
}
pthread_mutex_unlock(m_brain_mutex);
} else {
- cerr<<"audio no lock..."<
#include
#include
#include
#include
+#include
#include
#include
-#include
#include
#include
#include
-#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -74,12 +73,9 @@ public:
QLabel *label_28;
QSlider *sliderSearchStretch;
QSpinBox *spinBoxSearchStretch;
- QLabel *label_27;
- QHBoxLayout *horizontalLayout_18;
- QRadioButton *radioButtonAlgoBasic;
- QRadioButton *radioButtonAlgoRevBasic;
- QRadioButton *radioButtonSynaptic;
- QRadioButton *radioButtonSynapticSlide;
+ QHBoxLayout *horizontalLayout_25;
+ QLabel *label_32;
+ QComboBox *comboBoxAlgorithm;
QHBoxLayout *horizontalLayout_17;
QLabel *label_26;
QSlider *sliderSynapses;
@@ -88,7 +84,7 @@ public:
QLabel *label_29;
QSlider *sliderSlideError;
QSpinBox *spinBoxSlideError;
- QSpacerItem *horizontalSpacer_2;
+ QSpacerItem *verticalSpacer_3;
QVBoxLayout *verticalLayout_6;
QLabel *label_16;
QPushButton *pushButtonLoadTarget;
@@ -98,16 +94,9 @@ public:
QHBoxLayout *horizontalLayout_14;
QLabel *label_18;
QDoubleSpinBox *doubleSpinBoxBlockOverlapTarget;
- QGridLayout *gridLayout_2;
- QRadioButton *radioButton_bartlettTarget;
- QRadioButton *radioButton_blackmanTarget;
- QRadioButton *radioButton_gaussianTarget;
- QRadioButton *radioButton_hammingTarget;
- QRadioButton *radioButton_hannTarget;
- QRadioButton *radioButton_flattopTarget;
- QRadioButton *radioButton_dodgyTarget;
- QRadioButton *radioButton_rectangleTarget;
+ QHBoxLayout *horizontalLayout_23;
QLabel *label_14;
+ QComboBox *comboBoxTargetShape;
QPushButton *pushButtonGenerateTarget;
QLabel *label_23;
QHBoxLayout *horizontalLayout_22;
@@ -126,10 +115,12 @@ public:
QSpacerItem *verticalSpacer;
QVBoxLayout *verticalLayout_2;
QLabel *label_3;
- QListWidget *listWidgetSounds;
+ QScrollArea *scrollArea;
+ QWidget *scrollAreaWidgetContents;
+ QVBoxLayout *verticalLayout_5;
+ QVBoxLayout *brain_contents;
QHBoxLayout *horizontalLayout_2;
QPushButton *pushButtonLoadSound;
- QPushButton *pushButtonDeleteSound;
QPushButton *pushButtonClearBrain;
QHBoxLayout *horizontalLayout_4;
QLabel *label;
@@ -137,16 +128,9 @@ public:
QHBoxLayout *horizontalLayout_6;
QLabel *label_2;
QDoubleSpinBox *doubleSpinBoxBlockOverlap;
- QGridLayout *gridLayout;
- QRadioButton *radioButton_gaussian;
- QRadioButton *radioButton_hamming;
- QRadioButton *radioButton_dodgy;
- QRadioButton *radioButton_blackman;
- QRadioButton *radioButton_rectagle;
- QRadioButton *radioButton_bartlett;
- QRadioButton *radioButton_flattop;
- QRadioButton *radioButton_hann;
- QLabel *label_4;
+ QHBoxLayout *horizontalLayout_24;
+ QLabel *label_15;
+ QComboBox *comboBoxBrainShape;
QPushButton *pushButtonGenerate;
QHBoxLayout *horizontalLayout_7;
QPushButton *pushButtonLoadBrain;
@@ -175,7 +159,7 @@ public:
{
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
- MainWindow->resize(910, 795);
+ MainWindow->resize(910, 659);
centralwidget = new QWidget(MainWindow);
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
verticalLayout_4 = new QVBoxLayout(centralwidget);
@@ -443,51 +427,23 @@ public:
verticalLayout_3->addLayout(horizontalLayout_19);
- label_27 = new QLabel(controlTab);
- label_27->setObjectName(QString::fromUtf8("label_27"));
+ horizontalLayout_25 = new QHBoxLayout();
+ horizontalLayout_25->setObjectName(QString::fromUtf8("horizontalLayout_25"));
+ label_32 = new QLabel(controlTab);
+ label_32->setObjectName(QString::fromUtf8("label_32"));
QFont font3;
- font3.setFamily(QString::fromUtf8("Comic Sans MS"));
- font3.setPointSize(10);
- font3.setBold(true);
- font3.setWeight(75);
- label_27->setFont(font3);
+ font3.setPointSize(9);
+ label_32->setFont(font3);
- verticalLayout_3->addWidget(label_27);
+ horizontalLayout_25->addWidget(label_32);
- horizontalLayout_18 = new QHBoxLayout();
- horizontalLayout_18->setObjectName(QString::fromUtf8("horizontalLayout_18"));
- radioButtonAlgoBasic = new QRadioButton(controlTab);
- buttonGroup_3 = new QButtonGroup(MainWindow);
- buttonGroup_3->setObjectName(QString::fromUtf8("buttonGroup_3"));
- buttonGroup_3->addButton(radioButtonAlgoBasic);
- radioButtonAlgoBasic->setObjectName(QString::fromUtf8("radioButtonAlgoBasic"));
- radioButtonAlgoBasic->setChecked(true);
+ comboBoxAlgorithm = new QComboBox(controlTab);
+ comboBoxAlgorithm->setObjectName(QString::fromUtf8("comboBoxAlgorithm"));
- horizontalLayout_18->addWidget(radioButtonAlgoBasic);
-
- radioButtonAlgoRevBasic = new QRadioButton(controlTab);
- buttonGroup_3->addButton(radioButtonAlgoRevBasic);
- radioButtonAlgoRevBasic->setObjectName(QString::fromUtf8("radioButtonAlgoRevBasic"));
-
- horizontalLayout_18->addWidget(radioButtonAlgoRevBasic);
-
- radioButtonSynaptic = new QRadioButton(controlTab);
- buttonGroup_3->addButton(radioButtonSynaptic);
- radioButtonSynaptic->setObjectName(QString::fromUtf8("radioButtonSynaptic"));
- radioButtonSynaptic->setChecked(false);
-
- horizontalLayout_18->addWidget(radioButtonSynaptic);
-
- radioButtonSynapticSlide = new QRadioButton(controlTab);
- buttonGroup_3->addButton(radioButtonSynapticSlide);
- radioButtonSynapticSlide->setObjectName(QString::fromUtf8("radioButtonSynapticSlide"));
- radioButtonSynapticSlide->setEnabled(true);
- radioButtonSynapticSlide->setCheckable(true);
-
- horizontalLayout_18->addWidget(radioButtonSynapticSlide);
+ horizontalLayout_25->addWidget(comboBoxAlgorithm);
- verticalLayout_3->addLayout(horizontalLayout_18);
+ verticalLayout_3->addLayout(horizontalLayout_25);
horizontalLayout_17 = new QHBoxLayout();
horizontalLayout_17->setObjectName(QString::fromUtf8("horizontalLayout_17"));
@@ -551,9 +507,9 @@ public:
verticalLayout_3->addLayout(horizontalLayout_20);
- horizontalSpacer_2 = new QSpacerItem(21, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+ verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
- verticalLayout_3->addItem(horizontalSpacer_2);
+ verticalLayout_3->addItem(verticalSpacer_3);
horizontalLayout_5->addLayout(verticalLayout_3);
@@ -609,66 +565,20 @@ public:
verticalLayout_6->addLayout(horizontalLayout_14);
- gridLayout_2 = new QGridLayout();
- gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
- radioButton_bartlettTarget = new QRadioButton(controlTab);
- buttonGroup_2 = new QButtonGroup(MainWindow);
- buttonGroup_2->setObjectName(QString::fromUtf8("buttonGroup_2"));
- buttonGroup_2->addButton(radioButton_bartlettTarget);
- radioButton_bartlettTarget->setObjectName(QString::fromUtf8("radioButton_bartlettTarget"));
-
- gridLayout_2->addWidget(radioButton_bartlettTarget, 3, 0, 1, 1);
-
- radioButton_blackmanTarget = new QRadioButton(controlTab);
- buttonGroup_2->addButton(radioButton_blackmanTarget);
- radioButton_blackmanTarget->setObjectName(QString::fromUtf8("radioButton_blackmanTarget"));
-
- gridLayout_2->addWidget(radioButton_blackmanTarget, 4, 0, 1, 1);
-
- radioButton_gaussianTarget = new QRadioButton(controlTab);
- buttonGroup_2->addButton(radioButton_gaussianTarget);
- radioButton_gaussianTarget->setObjectName(QString::fromUtf8("radioButton_gaussianTarget"));
-
- gridLayout_2->addWidget(radioButton_gaussianTarget, 2, 1, 1, 1);
-
- radioButton_hammingTarget = new QRadioButton(controlTab);
- buttonGroup_2->addButton(radioButton_hammingTarget);
- radioButton_hammingTarget->setObjectName(QString::fromUtf8("radioButton_hammingTarget"));
-
- gridLayout_2->addWidget(radioButton_hammingTarget, 3, 1, 1, 1);
-
- radioButton_hannTarget = new QRadioButton(controlTab);
- buttonGroup_2->addButton(radioButton_hannTarget);
- radioButton_hannTarget->setObjectName(QString::fromUtf8("radioButton_hannTarget"));
-
- gridLayout_2->addWidget(radioButton_hannTarget, 4, 1, 1, 1);
-
- radioButton_flattopTarget = new QRadioButton(controlTab);
- buttonGroup_2->addButton(radioButton_flattopTarget);
- radioButton_flattopTarget->setObjectName(QString::fromUtf8("radioButton_flattopTarget"));
-
- gridLayout_2->addWidget(radioButton_flattopTarget, 5, 0, 1, 1);
-
- radioButton_dodgyTarget = new QRadioButton(controlTab);
- buttonGroup_2->addButton(radioButton_dodgyTarget);
- radioButton_dodgyTarget->setObjectName(QString::fromUtf8("radioButton_dodgyTarget"));
- radioButton_dodgyTarget->setChecked(true);
-
- gridLayout_2->addWidget(radioButton_dodgyTarget, 2, 0, 1, 1);
-
- radioButton_rectangleTarget = new QRadioButton(controlTab);
- buttonGroup_2->addButton(radioButton_rectangleTarget);
- radioButton_rectangleTarget->setObjectName(QString::fromUtf8("radioButton_rectangleTarget"));
-
- gridLayout_2->addWidget(radioButton_rectangleTarget, 5, 1, 1, 1);
-
+ horizontalLayout_23 = new QHBoxLayout();
+ horizontalLayout_23->setObjectName(QString::fromUtf8("horizontalLayout_23"));
label_14 = new QLabel(controlTab);
label_14->setObjectName(QString::fromUtf8("label_14"));
- gridLayout_2->addWidget(label_14, 1, 0, 1, 1);
+ horizontalLayout_23->addWidget(label_14);
+
+ comboBoxTargetShape = new QComboBox(controlTab);
+ comboBoxTargetShape->setObjectName(QString::fromUtf8("comboBoxTargetShape"));
+
+ horizontalLayout_23->addWidget(comboBoxTargetShape);
- verticalLayout_6->addLayout(gridLayout_2);
+ verticalLayout_6->addLayout(horizontalLayout_23);
pushButtonGenerateTarget = new QPushButton(controlTab);
pushButtonGenerateTarget->setObjectName(QString::fromUtf8("pushButtonGenerateTarget"));
@@ -793,10 +703,23 @@ public:
verticalLayout_2->addWidget(label_3);
- listWidgetSounds = new QListWidget(controlTab);
- listWidgetSounds->setObjectName(QString::fromUtf8("listWidgetSounds"));
+ scrollArea = new QScrollArea(controlTab);
+ scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
+ scrollArea->setMinimumSize(QSize(0, 200));
+ scrollArea->setWidgetResizable(true);
+ scrollAreaWidgetContents = new QWidget();
+ scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
+ scrollAreaWidgetContents->setGeometry(QRect(0, 0, 259, 198));
+ verticalLayout_5 = new QVBoxLayout(scrollAreaWidgetContents);
+ verticalLayout_5->setObjectName(QString::fromUtf8("verticalLayout_5"));
+ brain_contents = new QVBoxLayout();
+ brain_contents->setObjectName(QString::fromUtf8("brain_contents"));
- verticalLayout_2->addWidget(listWidgetSounds);
+ verticalLayout_5->addLayout(brain_contents);
+
+ scrollArea->setWidget(scrollAreaWidgetContents);
+
+ verticalLayout_2->addWidget(scrollArea);
horizontalLayout_2 = new QHBoxLayout();
horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
@@ -806,20 +729,14 @@ public:
horizontalLayout_2->addWidget(pushButtonLoadSound);
- pushButtonDeleteSound = new QPushButton(controlTab);
- pushButtonDeleteSound->setObjectName(QString::fromUtf8("pushButtonDeleteSound"));
- pushButtonDeleteSound->setFont(font);
-
- horizontalLayout_2->addWidget(pushButtonDeleteSound);
-
-
- verticalLayout_2->addLayout(horizontalLayout_2);
-
pushButtonClearBrain = new QPushButton(controlTab);
pushButtonClearBrain->setObjectName(QString::fromUtf8("pushButtonClearBrain"));
pushButtonClearBrain->setFont(font);
- verticalLayout_2->addWidget(pushButtonClearBrain);
+ horizontalLayout_2->addWidget(pushButtonClearBrain);
+
+
+ verticalLayout_2->addLayout(horizontalLayout_2);
horizontalLayout_4 = new QHBoxLayout();
horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4"));
@@ -858,66 +775,20 @@ public:
verticalLayout_2->addLayout(horizontalLayout_6);
- gridLayout = new QGridLayout();
- gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
- radioButton_gaussian = new QRadioButton(controlTab);
- buttonGroup = new QButtonGroup(MainWindow);
- buttonGroup->setObjectName(QString::fromUtf8("buttonGroup"));
- buttonGroup->addButton(radioButton_gaussian);
- radioButton_gaussian->setObjectName(QString::fromUtf8("radioButton_gaussian"));
+ horizontalLayout_24 = new QHBoxLayout();
+ horizontalLayout_24->setObjectName(QString::fromUtf8("horizontalLayout_24"));
+ label_15 = new QLabel(controlTab);
+ label_15->setObjectName(QString::fromUtf8("label_15"));
- gridLayout->addWidget(radioButton_gaussian, 3, 1, 1, 1);
+ horizontalLayout_24->addWidget(label_15);
- radioButton_hamming = new QRadioButton(controlTab);
- buttonGroup->addButton(radioButton_hamming);
- radioButton_hamming->setObjectName(QString::fromUtf8("radioButton_hamming"));
+ comboBoxBrainShape = new QComboBox(controlTab);
+ comboBoxBrainShape->setObjectName(QString::fromUtf8("comboBoxBrainShape"));
- gridLayout->addWidget(radioButton_hamming, 4, 1, 1, 1);
-
- radioButton_dodgy = new QRadioButton(controlTab);
- buttonGroup->addButton(radioButton_dodgy);
- radioButton_dodgy->setObjectName(QString::fromUtf8("radioButton_dodgy"));
- radioButton_dodgy->setChecked(true);
-
- gridLayout->addWidget(radioButton_dodgy, 3, 0, 1, 1);
-
- radioButton_blackman = new QRadioButton(controlTab);
- buttonGroup->addButton(radioButton_blackman);
- radioButton_blackman->setObjectName(QString::fromUtf8("radioButton_blackman"));
-
- gridLayout->addWidget(radioButton_blackman, 5, 0, 1, 1);
-
- radioButton_rectagle = new QRadioButton(controlTab);
- buttonGroup->addButton(radioButton_rectagle);
- radioButton_rectagle->setObjectName(QString::fromUtf8("radioButton_rectagle"));
-
- gridLayout->addWidget(radioButton_rectagle, 6, 1, 1, 1);
-
- radioButton_bartlett = new QRadioButton(controlTab);
- buttonGroup->addButton(radioButton_bartlett);
- radioButton_bartlett->setObjectName(QString::fromUtf8("radioButton_bartlett"));
-
- gridLayout->addWidget(radioButton_bartlett, 4, 0, 1, 1);
-
- radioButton_flattop = new QRadioButton(controlTab);
- buttonGroup->addButton(radioButton_flattop);
- radioButton_flattop->setObjectName(QString::fromUtf8("radioButton_flattop"));
-
- gridLayout->addWidget(radioButton_flattop, 6, 0, 1, 1);
-
- radioButton_hann = new QRadioButton(controlTab);
- buttonGroup->addButton(radioButton_hann);
- radioButton_hann->setObjectName(QString::fromUtf8("radioButton_hann"));
-
- gridLayout->addWidget(radioButton_hann, 5, 1, 1, 1);
-
- label_4 = new QLabel(controlTab);
- label_4->setObjectName(QString::fromUtf8("label_4"));
-
- gridLayout->addWidget(label_4, 2, 0, 1, 1);
+ horizontalLayout_24->addWidget(comboBoxBrainShape);
- verticalLayout_2->addLayout(gridLayout);
+ verticalLayout_2->addLayout(horizontalLayout_24);
pushButtonGenerate = new QPushButton(controlTab);
pushButtonGenerate->setObjectName(QString::fromUtf8("pushButtonGenerate"));
@@ -1054,56 +925,35 @@ public:
QObject::connect(dialVolume, SIGNAL(sliderMoved(int)), MainWindow, SLOT(volume_slot(int)));
QObject::connect(pushButtonStopRecord, SIGNAL(released()), MainWindow, SLOT(stop_record()));
QObject::connect(pushButtonRecord, SIGNAL(released()), MainWindow, SLOT(record()));
- 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_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(sliderNRatio, SIGNAL(valueChanged(int)), MainWindow, SLOT(n_ratio_slot(int)));
QObject::connect(doubleSpinBoxNRatio, SIGNAL(valueChanged(double)), MainWindow, SLOT(n_ratio_slot(double)));
- 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(sliderNMix, SIGNAL(valueChanged(int)), MainWindow, SLOT(n_mix_slot(int)));
QObject::connect(doubleSpinBoxNMix, SIGNAL(valueChanged(double)), MainWindow, SLOT(n_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(doubleSpinBoxNovelty, SIGNAL(valueChanged(double)), MainWindow, SLOT(novelty_slot(double)));
QObject::connect(sliderNovelty, SIGNAL(valueChanged(int)), MainWindow, SLOT(novelty_slot(int)));
QObject::connect(sliderBoredom, SIGNAL(valueChanged(int)), MainWindow, SLOT(boredom_slot(int)));
- 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(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_flattop, SIGNAL(toggled(bool)), MainWindow, SLOT(window_flattop(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_hamming, SIGNAL(toggled(bool)), MainWindow, SLOT(window_hamming(bool)));
QObject::connect(pushButtonSaveBrain, SIGNAL(released()), MainWindow, SLOT(save_brain()));
- QObject::connect(pushButtonDeleteSound, SIGNAL(released()), MainWindow, SLOT(delete_sound()));
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)));
@@ -1117,6 +967,9 @@ public:
QObject::connect(pushButtonLoadSession, SIGNAL(released()), MainWindow, SLOT(load_session()));
QObject::connect(pushButtonSaveSession, SIGNAL(released()), MainWindow, SLOT(save_session()));
QObject::connect(checkBoxStereo, SIGNAL(clicked(bool)), MainWindow, SLOT(stereo_mode(bool)));
+ QObject::connect(comboBoxAlgorithm, SIGNAL(currentIndexChanged(int)), MainWindow, SLOT(algo(int)));
+ QObject::connect(comboBoxTargetShape, SIGNAL(currentIndexChanged(int)), MainWindow, SLOT(target_shape(int)));
+ QObject::connect(comboBoxBrainShape, SIGNAL(currentIndexChanged(int)), MainWindow, SLOT(brain_shape(int)));
tabWidget->setCurrentIndex(0);
@@ -1126,7 +979,7 @@ public:
void retranslateUi(QMainWindow *MainWindow)
{
- MainWindow->setWindowTitle(QApplication::translate("MainWindow", "samplebrain 0.15", 0, QApplication::UnicodeUTF8));
+ MainWindow->setWindowTitle(QApplication::translate("MainWindow", "samplebrain 0.16", 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));
#ifndef QT_NO_TOOLTIP
@@ -1179,23 +1032,14 @@ public:
#ifndef QT_NO_TOOLTIP
spinBoxSearchStretch->setToolTip(QApplication::translate("MainWindow", "how many connections to search (ordered in closeness)", 0, QApplication::UnicodeUTF8));
#endif // QT_NO_TOOLTIP
- label_27->setText(QApplication::translate("MainWindow", "algorithm", 0, QApplication::UnicodeUTF8));
-#ifndef QT_NO_TOOLTIP
- radioButtonAlgoBasic->setToolTip(QApplication::translate("MainWindow", "full brain search", 0, QApplication::UnicodeUTF8));
-#endif // QT_NO_TOOLTIP
- radioButtonAlgoBasic->setText(QApplication::translate("MainWindow", "basic", 0, QApplication::UnicodeUTF8));
-#ifndef QT_NO_TOOLTIP
- radioButtonAlgoRevBasic->setToolTip(QApplication::translate("MainWindow", "full brain reverse search", 0, QApplication::UnicodeUTF8));
-#endif // QT_NO_TOOLTIP
- radioButtonAlgoRevBasic->setText(QApplication::translate("MainWindow", "rev basic", 0, QApplication::UnicodeUTF8));
-#ifndef QT_NO_TOOLTIP
- radioButtonSynaptic->setToolTip(QApplication::translate("MainWindow", "search based on synapse connections", 0, QApplication::UnicodeUTF8));
-#endif // QT_NO_TOOLTIP
- radioButtonSynaptic->setText(QApplication::translate("MainWindow", "synaptic", 0, QApplication::UnicodeUTF8));
-#ifndef QT_NO_TOOLTIP
- radioButtonSynapticSlide->setToolTip(QApplication::translate("MainWindow", "search based on synapses and sonify search process", 0, QApplication::UnicodeUTF8));
-#endif // QT_NO_TOOLTIP
- radioButtonSynapticSlide->setText(QApplication::translate("MainWindow", "synaptic slide", 0, QApplication::UnicodeUTF8));
+ label_32->setText(QApplication::translate("MainWindow", "algorithm", 0, QApplication::UnicodeUTF8));
+ comboBoxAlgorithm->clear();
+ comboBoxAlgorithm->insertItems(0, QStringList()
+ << QApplication::translate("MainWindow", "basic", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "reversed", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "synaptic", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "slide", 0, QApplication::UnicodeUTF8)
+ );
#ifndef QT_NO_TOOLTIP
label_26->setToolTip(QString());
#endif // QT_NO_TOOLTIP
@@ -1220,22 +1064,25 @@ public:
pushButtonLoadTarget->setText(QApplication::translate("MainWindow", "load target", 0, QApplication::UnicodeUTF8));
label_17->setText(QApplication::translate("MainWindow", "block size", 0, QApplication::UnicodeUTF8));
label_18->setText(QApplication::translate("MainWindow", "block overlap", 0, QApplication::UnicodeUTF8));
- radioButton_bartlettTarget->setText(QApplication::translate("MainWindow", "bartlett", 0, QApplication::UnicodeUTF8));
- radioButton_blackmanTarget->setText(QApplication::translate("MainWindow", "blackman", 0, QApplication::UnicodeUTF8));
- radioButton_gaussianTarget->setText(QApplication::translate("MainWindow", "gaussian", 0, QApplication::UnicodeUTF8));
- radioButton_hammingTarget->setText(QApplication::translate("MainWindow", "hamming", 0, QApplication::UnicodeUTF8));
- radioButton_hannTarget->setText(QApplication::translate("MainWindow", "hann", 0, QApplication::UnicodeUTF8));
- radioButton_flattopTarget->setText(QApplication::translate("MainWindow", "flat top", 0, QApplication::UnicodeUTF8));
- radioButton_dodgyTarget->setText(QApplication::translate("MainWindow", "dodgy", 0, QApplication::UnicodeUTF8));
- radioButton_rectangleTarget->setText(QApplication::translate("MainWindow", "rectangle", 0, QApplication::UnicodeUTF8));
label_14->setText(QApplication::translate("MainWindow", "window shape", 0, QApplication::UnicodeUTF8));
+ comboBoxTargetShape->clear();
+ comboBoxTargetShape->insertItems(0, QStringList()
+ << QApplication::translate("MainWindow", "dodgy", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "bartlett", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "blackman", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "flat top", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "gaussian", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "hamming", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "hann", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "rectangle", 0, QApplication::UnicodeUTF8)
+ );
pushButtonGenerateTarget->setText(QApplication::translate("MainWindow", "(re)generate blocks", 0, QApplication::UnicodeUTF8));
label_23->setText(QApplication::translate("MainWindow", "mix", 0, QApplication::UnicodeUTF8));
label_31->setText(QApplication::translate("MainWindow", "autotune", 0, QApplication::UnicodeUTF8));
#ifndef QT_NO_TOOLTIP
sliderAutotune->setToolTip(QApplication::translate("MainWindow", "amount to match the frequency", 0, QApplication::UnicodeUTF8));
#endif // QT_NO_TOOLTIP
- label_21->setText(QApplication::translate("MainWindow", "dynamic / normalised ", 0, QApplication::UnicodeUTF8));
+ label_21->setText(QApplication::translate("MainWindow", "normalised ", 0, QApplication::UnicodeUTF8));
#ifndef QT_NO_TOOLTIP
sliderNMix->setToolTip(QApplication::translate("MainWindow", "mix in the normalised blocks", 0, QApplication::UnicodeUTF8));
#endif // QT_NO_TOOLTIP
@@ -1246,19 +1093,21 @@ public:
checkBoxStereo->setText(QApplication::translate("MainWindow", "stereo mode", 0, QApplication::UnicodeUTF8));
label_3->setText(QApplication::translate("MainWindow", "brain contents", 0, QApplication::UnicodeUTF8));
pushButtonLoadSound->setText(QApplication::translate("MainWindow", "load sound", 0, QApplication::UnicodeUTF8));
- pushButtonDeleteSound->setText(QApplication::translate("MainWindow", "delete selected", 0, QApplication::UnicodeUTF8));
pushButtonClearBrain->setText(QApplication::translate("MainWindow", "clear brain", 0, QApplication::UnicodeUTF8));
label->setText(QApplication::translate("MainWindow", "block size", 0, QApplication::UnicodeUTF8));
label_2->setText(QApplication::translate("MainWindow", "block overlap", 0, QApplication::UnicodeUTF8));
- radioButton_gaussian->setText(QApplication::translate("MainWindow", "gaussian", 0, QApplication::UnicodeUTF8));
- radioButton_hamming->setText(QApplication::translate("MainWindow", "hamming", 0, QApplication::UnicodeUTF8));
- radioButton_dodgy->setText(QApplication::translate("MainWindow", "dodgy", 0, QApplication::UnicodeUTF8));
- radioButton_blackman->setText(QApplication::translate("MainWindow", "blackman", 0, QApplication::UnicodeUTF8));
- radioButton_rectagle->setText(QApplication::translate("MainWindow", "rectangle", 0, QApplication::UnicodeUTF8));
- radioButton_bartlett->setText(QApplication::translate("MainWindow", "bartlett", 0, QApplication::UnicodeUTF8));
- radioButton_flattop->setText(QApplication::translate("MainWindow", "flat top", 0, QApplication::UnicodeUTF8));
- radioButton_hann->setText(QApplication::translate("MainWindow", "hann", 0, QApplication::UnicodeUTF8));
- label_4->setText(QApplication::translate("MainWindow", "window shape", 0, QApplication::UnicodeUTF8));
+ label_15->setText(QApplication::translate("MainWindow", "window shape", 0, QApplication::UnicodeUTF8));
+ comboBoxBrainShape->clear();
+ comboBoxBrainShape->insertItems(0, QStringList()
+ << QApplication::translate("MainWindow", "dodgy", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "bartlett", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "blackman", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "flat top", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "gaussian", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "hamming", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "hann", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "rectangle", 0, QApplication::UnicodeUTF8)
+ );
pushButtonGenerate->setText(QApplication::translate("MainWindow", "(re)generate brain", 0, QApplication::UnicodeUTF8));
pushButtonLoadBrain->setText(QApplication::translate("MainWindow", "load brain", 0, QApplication::UnicodeUTF8));
pushButtonSaveBrain->setText(QApplication::translate("MainWindow", "save brain", 0, QApplication::UnicodeUTF8));
@@ -1281,4 +1130,4 @@ namespace Ui {
QT_END_NAMESPACE
-#endif // SAMPLEBRAINZ17592_H
+#endif // SAMPLEBRAINU19467_H
diff --git a/samplebrain/qt/process_thread.cpp b/samplebrain/qt/process_thread.cpp
index 0673830..6749dd8 100644
--- a/samplebrain/qt/process_thread.cpp
+++ b/samplebrain/qt/process_thread.cpp
@@ -67,6 +67,19 @@ void process_thread::process() {
m_source.delete_sound(cmd.get_string(0));
pthread_mutex_unlock(m_brain_mutex);
}
+ if (name=="/activate_sound") {
+ cerr<<"recieved activate"<::iterator i=m_sample_sections.begin();
+ i!=m_sample_sections.end(); ++i) {
+ if (filename==i->m_filename) {
+ i->m_enabled=active;
+ }
+ }
+}
+
+
void brain::clear() {
m_blocks.clear();
m_samples.clear();
m_active_sounds.clear();
+ m_sample_sections.clear();
}
// rewrites whole brain
@@ -103,16 +115,40 @@ void brain::init(u32 block_size, u32 overlap, window::type t, bool ditchpcm) {
status::update("all samples processed");
}
-void brain::chop_and_add(const sound &s, u32 count, bool ditchpcm) {
- u32 pos=0;
- if (m_overlap>=m_block_size) m_overlap=0;
- while (pos+m_block_size-1=m_block_size) m_overlap=0;
+ while (pos+m_block_size-1furthest) {
+ // check each sample section
+ for (auto ss : m_sample_sections) {
+ if (ss.m_enabled) { // are we turned on?
+ // loop through indexes for this section
+ for (u32 i=ss.m_start; ifurthest) {
furthest=diff;
- furthest_index = index;
+ furthest_index = i;
+ }
}
- ++index;
+ }
}
-
deplete_usage();
m_blocks[furthest_index].get_usage()+=usage_factor;
m_current_block_index = furthest_index;
@@ -252,7 +295,7 @@ void brain::build_synapses_fixed(search_params ¶ms) {
status::update("Done: %d synapses grown for %d blocks",num_synapses*brain_size,brain_size);
}
-
+// randomise the current block
void brain::jiggle() {
if (m_blocks.size()>0) {
m_current_block_index=rand()%m_blocks.size();
@@ -261,6 +304,15 @@ void brain::jiggle() {
}
}
+bool brain::is_block_active(u32 index) {
+ // check each sample section
+ for (auto ss : m_sample_sections) {
+ if (index>=ss.m_start && index0) {
+ s||b.m_num_blocks;
+ }
+ return s;
+}
+
+ios &spiralcore::operator||(ios &s, brain::sample_section &b) {
+ u32 version=1;
+ string id("sample_section");
+ s||id||version;
+ s||b.m_filename||b.m_enabled||b.m_start||b.m_end;
return s;
}
ios &spiralcore::operator||(ios &s, brain &b) {
- u32 version=0;
+ u32 version=1;
string id("brain");
// changes here need to be reflected in interface loading
s||id||version;
@@ -355,6 +420,9 @@ ios &spiralcore::operator||(ios &s, brain &b) {
s||b.m_block_size||b.m_overlap||b.m_window;
s||b.m_current_block_index||b.m_current_error||
b.m_average_error||b.m_usage_falloff;
+ if (version>0) {
+ stream_vector(s,b.m_sample_sections);
+ }
return s;
}
diff --git a/samplebrain/src/brain.h b/samplebrain/src/brain.h
index 1866dab..cf9db8a 100644
--- a/samplebrain/src/brain.h
+++ b/samplebrain/src/brain.h
@@ -37,20 +37,6 @@ public:
// rewrites whole brain
void init(u32 block_size, u32 overlap, window::type t, bool ditchpcm=false);
- // randomise the synaptic pointer
- void jiggle();
-
- class sound {
- public:
- sound(const std::string &name, const sample &sample) :
- m_filename(name), m_sample(sample) {}
-
- sound() {}; // needed for streaming
-
- std::string m_filename;
- sample m_sample;
- };
-
void clear();
// load, chop up and add to brain
@@ -58,12 +44,9 @@ public:
void load_sound(std::string filename, stereo_mode mode);
void delete_sound(std::string filename);
void clear_sounds() { m_samples.clear(); }
- // take another brain and rebuild this brain from bits of that one
- // (presumably this one is made from a single sample)
- //void resynth(const std::string &filename, const brain &other, const search_params ¶ms);
+ // turns on/off a sound in realtime without reprocessing
+ void activate_sound(std::string filename, bool active);
-
- const std::list &get_samples() { return m_samples; }
const sample &get_block_pcm(u32 index) const;
const sample &get_block_n_pcm(u32 index) const;
const block &get_block(u32 index) const;
@@ -84,20 +67,49 @@ public:
void build_synapses_fixed(search_params ¶ms);
u32 search_synapses(const block &target, search_params ¶ms);
double get_current_error() { return m_current_error; }
+ // randomise the synaptic pointer
+ void jiggle();
static bool unit_test();
- friend ios &operator||(ios &s, brain &b);
+ class sound {
+ public:
+ sound(const std::string &name, const sample &sample) :
+ m_filename(name), m_sample(sample), m_num_blocks(0) {}
+ sound() {}; // needed for streaming
+ std::string m_filename;
+ sample m_sample;
+ // filled in during chop_and_add
+ u32 m_num_blocks;
+ };
+
+ const std::list &get_samples() { return m_samples; }
private:
- void chop_and_add(const sound &s, u32 count, bool ditchpcm=false);
+ void chop_and_add(sound &s, u32 count, bool ditchpcm=false);
void deplete_usage();
u32 stickify(const block &target, u32 closest_index, f32 dist, const search_params ¶ms);
+ void recompute_sample_sections();
+ // checks sample sections
+ bool is_block_active(u32 index);
+
+ // we store the blocks in a flat list, so we can directly index
+ // them, but we need to filter them by source sound - so we need
+ // to be able to turn large contiguous sets of them on and off
+ // (without a big impact on the processing time)
+ class sample_section {
+ public:
+ std::string m_filename;
+ bool m_enabled;
+ u32 m_start,m_end;
+ };
vector m_blocks;
std::list m_samples;
vector m_active_sounds;
+ vector m_sample_sections;
+
u32 m_block_size;
u32 m_overlap;
@@ -108,9 +120,15 @@ private:
double m_current_error;
double m_average_error;
float m_usage_falloff;
+
+ friend ios &operator||(ios &s, brain &b);
+ friend ios &operator||(ios &s, sample_section &b);
+ friend ios &operator||(ios &s, sound &b);
+
};
ios &operator||(ios &s, brain::sound &b);
+ios &operator||(ios &s, brain::sample_section &b);
ios &operator||(ios &s, brain &b);
}