diff --git a/samplebrain/interface/samplebrain.ui b/samplebrain/interface/samplebrain.ui
index 85389c8..bb74099 100644
--- a/samplebrain/interface/samplebrain.ui
+++ b/samplebrain/interface/samplebrain.ui
@@ -11,7 +11,7 @@
- samplebrain 0.7
+ samplebrain 0.8
@@ -409,7 +409,7 @@
1
- 10
+ 50
1
@@ -434,7 +434,7 @@
1
- 10
+ 50
1
diff --git a/samplebrain/qt/generated/ui_samplebrain.h b/samplebrain/qt/generated/ui_samplebrain.h
index 3f63a52..ba69b27 100644
--- a/samplebrain/qt/generated/ui_samplebrain.h
+++ b/samplebrain/qt/generated/ui_samplebrain.h
@@ -1,14 +1,14 @@
/********************************************************************************
-** Form generated from reading UI file 'samplebrainj32146.ui'
+** Form generated from reading UI file 'samplebrainj21537.ui'
**
-** Created: Thu Aug 6 13:25:50 2015
+** Created: Fri Aug 7 09:55:34 2015
** by: Qt User Interface Compiler version 4.8.1
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
-#ifndef SAMPLEBRAINJ32146_H
-#define SAMPLEBRAINJ32146_H
+#ifndef SAMPLEBRAINJ21537_H
+#define SAMPLEBRAINJ21537_H
#include
#include
@@ -385,7 +385,7 @@ public:
sizePolicy.setHeightForWidth(sliderSearchStretch->sizePolicy().hasHeightForWidth());
sliderSearchStretch->setSizePolicy(sizePolicy);
sliderSearchStretch->setMinimum(1);
- sliderSearchStretch->setMaximum(10);
+ sliderSearchStretch->setMaximum(50);
sliderSearchStretch->setValue(1);
sliderSearchStretch->setOrientation(Qt::Horizontal);
@@ -396,7 +396,7 @@ public:
sizePolicy1.setHeightForWidth(spinBoxSearchStretch->sizePolicy().hasHeightForWidth());
spinBoxSearchStretch->setSizePolicy(sizePolicy1);
spinBoxSearchStretch->setMinimum(1);
- spinBoxSearchStretch->setMaximum(10);
+ spinBoxSearchStretch->setMaximum(50);
spinBoxSearchStretch->setValue(1);
horizontalLayout_19->addWidget(spinBoxSearchStretch);
@@ -1043,7 +1043,7 @@ public:
void retranslateUi(QMainWindow *MainWindow)
{
- MainWindow->setWindowTitle(QApplication::translate("MainWindow", "samplebrain 0.7", 0, QApplication::UnicodeUTF8));
+ MainWindow->setWindowTitle(QApplication::translate("MainWindow", "samplebrain 0.8", 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
@@ -1185,4 +1185,4 @@ namespace Ui {
QT_END_NAMESPACE
-#endif // SAMPLEBRAINJ32146_H
+#endif // SAMPLEBRAINJ21537_H
diff --git a/samplebrain/src/main.cpp b/samplebrain/src/main.cpp
index 30d673f..73bffc7 100644
--- a/samplebrain/src/main.cpp
+++ b/samplebrain/src/main.cpp
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
*/
brain source;
- ifstream ifs("shosta.brain",ios::binary);
+ ifstream ifs("mix.brain",ios::binary);
ifs||source;
ifs.close();
@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
rr.get_params()->m_num_synapses=40;
rr.set_slide_error(3400.5);
rr.set_search_algo(renderer::SYNAPTIC);
- rr.set_target_mix(0.2);
+ rr.set_target_mix(0.9);
rr.set_stretch(10);
a->start_recording("debug");
a->m_client.set_callback(run_audio, &rr);
diff --git a/samplebrain/src/renderer.cpp b/samplebrain/src/renderer.cpp
index 42cf1b4..7b60854 100644
--- a/samplebrain/src/renderer.cpp
+++ b/samplebrain/src/renderer.cpp
@@ -33,7 +33,7 @@ void renderer::init(brain &source, brain &target) {
m_search_algo=BASIC;
m_slide_error=1;
m_target_index=0;
- m_target_counter=0;
+ m_render_index=0;
m_stretch=1;
m_last_tgt_shift=0;
}
@@ -44,7 +44,7 @@ void renderer::reset() {
m_target_time=0;
m_render_time=0;
m_target_index=0;
- m_target_counter=0;
+ m_render_index=0;
m_render_blocks.clear();
m_source.jiggle();
}
@@ -59,15 +59,21 @@ void renderer::process(u32 nframes, float *buf) {
clean_up();
m_render_time+=nframes;
- m_target_time+=nframes/(float)m_stretch;
+ //m_target_time+=nframes/(float)m_stretch;
}
+// target_time = samples time into target stream
+// render_time = position in output stream, updated per process - used for offsets
+
bool renderer::find_render_blocks(u32 nframes) {
// get new blocks from source for the current buffer
// where are we phase?
u32 tgt_shift = m_target.get_block_size()-m_target.get_overlap();
+ m_target_index = m_target_time/(float)tgt_shift;
u32 tgt_end = (m_target_time+nframes)/(float)tgt_shift;
+ u32 rnd_end = (m_render_time+nframes)/(float)tgt_shift;
+
// stuff has changed - recompute and abort
if (tgt_shift!=m_last_tgt_shift ||
@@ -79,23 +85,26 @@ bool renderer::find_render_blocks(u32 nframes) {
return false;
}
-
-/* cerr<<"-----------------"<