mirror of
https://gitlab.com/then-try-this/samplebrain.git
synced 2025-07-04 03:03:34 +00:00
Compare commits
20 Commits
0.18.3_rel
...
0.18.4_rel
Author | SHA1 | Date | |
---|---|---|---|
ac83efce3b | |||
7b41c94610 | |||
07ea3e63ef | |||
182baa59c3 | |||
ed0cf2eaac | |||
a9755b3f72 | |||
a30779b759 | |||
1c912d3977 | |||
004d9970c8 | |||
0a309ef8cd | |||
28a8bd31f8 | |||
b569c47d40 | |||
ad2a70a8d6 | |||
014becd12f | |||
78aa2b2b3e | |||
4a4ab8b41a | |||
21522f38e0 | |||
729edb25cd | |||
fb8d607e2d | |||
a2b77951ca |
132
README.md
132
README.md
@ -14,7 +14,7 @@ tweakable parameters until it became slightly out of control.
|
||||
|
||||

|
||||
|
||||
Quick start:
|
||||
# How do I use this thing?
|
||||
|
||||
1. Load a bunch of short wav files into the brain
|
||||
2. Click (re)generate brain
|
||||
@ -23,41 +23,42 @@ Quick start:
|
||||
5. Press play
|
||||
6. Tweak brain
|
||||
|
||||
The default block size (3000) is really high to prevent CPU glitches -
|
||||
500 to 1000 is a better range. Larger wav files like whole tracks can
|
||||
be used, but take a long time to process, after which they can be
|
||||
saved as "brain" files and instantly reloaded.
|
||||
Larger wav files like whole tracks can be used, but take a long time
|
||||
to process, after which they can be saved as "brain" files and
|
||||
instantly reloaded.
|
||||
|
||||
# [Demo brain session](https://static.thentrythis.org/samplebrain/demo.samplebrain)
|
||||
|
||||
Load this file using "load session" not "load brain" (sessions contain
|
||||
Check the [Manual](docs/manual.md) here for the details on all the
|
||||
parameters and try out the [demo brain session](https://static.thentrythis.org/samplebrain/demo.samplebrain).
|
||||
Load the demo using "load session" not "load brain" (sessions contain
|
||||
both the target and brain samples). The original samples used to
|
||||
create the demo session [can be found here for
|
||||
testing](https://static.thentrythis.org/samplebrain/samples/).
|
||||
|
||||
# [Manual](docs/manual.md)
|
||||
|
||||
Full description of all the parameters and a bit of the thinking
|
||||
behind it.
|
||||
|
||||
# Download
|
||||
|
||||
As this is experimental non-commercial software (only originally
|
||||
written to run on a couple of computers!) you will have to bear with
|
||||
us as we gradually stabilise things based on your feedback. There
|
||||
might currently be problems running it on 64bit Windows.
|
||||
|
||||
* **Windows**: [samplebrain_0.18.4_win.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18.4_win.zip)
|
||||
* **Mac (intel/m1)**: [samplebrain_0.18.4_macintel.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18.4_macintel.app.zip)
|
||||
|
||||
Changes in 0.18.4: New audio device settings window and updated
|
||||
windows build. Better default block size, tool tip tweaks and fixes
|
||||
for dark themes by [Claude Heiland-Allen](https://mathr.co.uk/).
|
||||
|
||||
For old versions see the [changelog](changelog.md)
|
||||
|
||||
* **Windows**: [samplebrain_0.18.2_win.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18.2_win.zip)
|
||||
* **Mac (intel/m1)**: [samplebrain_0.18.1_macintel.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18.1_macintel.app.zip)
|
||||
|
||||
Thank you to [Nik Gaffney](http://fo.am) for help with the Apple builds
|
||||
|
||||
Mac note: As this software is not on the apple store, to run the
|
||||
binary you need to tell your mac it's ok: Go to System Preferences >
|
||||
Security & Privacy > General. At the bottom of the window, select
|
||||
"Allow apps to be downloaded from Anywhere".
|
||||
|
||||
### Linux
|
||||
Thank you to [Nik Gaffney](http://fo.am) for help with the Apple
|
||||
builds.
|
||||
|
||||
# Linux install
|
||||
<a href='https://flathub.org/apps/details/org.thentrythis.Samplebrain'><img width='200' alt='Download on Flathub' src='https://flathub.org/assets/badges/flathub-badge-en.png'/></a>
|
||||
|
||||
#### Ubuntu
|
||||
@ -69,96 +70,13 @@ If you'd like the right font, optionally:
|
||||
|
||||
$ sudo apt install ttf-mscorefonts-installer
|
||||
|
||||
# Old/broken/spurious binaries
|
||||
|
||||
* **Windows**: [samplebrain_0.18.1_win.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18.1_win.zip)
|
||||
* **Windows**: [samplebrain_0.18_win.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18_win.zip)
|
||||
* **Mac (intel)**: [samplebrain_0.18_macintel.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18_macintel.zip)
|
||||
* **Mac (m1)**: [samplebrain_0.18_m1_v2.dmg](https://static.thentrythis.org/samplebrain/samplebrain_0.18_m1_v2.dmg)
|
||||
|
||||
# Building from source
|
||||
## Linux (Ubuntu)
|
||||
Install libraries for the sample engine (use brew on mac, MinGW on win):
|
||||
|
||||
$ sudo apt install libsndfile1-dev portaudio19-dev liblo-dev libfftw3-dev
|
||||
|
||||
Install dependencies for the interface:
|
||||
|
||||
$ sudo apt install build-essential qtcreator qt5-default
|
||||
|
||||
Build & run it:
|
||||
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ qmake ..
|
||||
$ make
|
||||
$ sudo make install
|
||||
$ samplebrain
|
||||
|
||||
## Mac
|
||||
Install libraries for sample engine:
|
||||
|
||||
$ brew install fftw portaudio liblo libsndfile
|
||||
|
||||
Install dependencies for the interface:
|
||||
|
||||
$ brew install qt
|
||||
$ brew link qt
|
||||
|
||||
Build & run it:
|
||||
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ qmake ..
|
||||
$ make
|
||||
|
||||
`samplebrain.app` should then be in the app folder for you to run.
|
||||
|
||||
# Mac build additions
|
||||
|
||||
To make a mac app bundle:
|
||||
|
||||
Run `macdeployqt` which copies all dependencies inside the app.
|
||||
|
||||
$ cd build
|
||||
$ macdeployqt
|
||||
|
||||
If the icon is not visible, you might need to copy desktop/samplebrain.icns (the icon) to the Resources directory in the app bundle.
|
||||
|
||||
$ cp ../desktop/samplebrain.icns samplebrain.app/Contents/Resources
|
||||
|
||||
Then edit Info.plist to add samplebrain.icns to CFBundleIconFile. Key `CFBundleIconFile` should match:
|
||||
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>samplebrain.icns</string>
|
||||
|
||||
You might also need to resign the app bundle after making any changes
|
||||
|
||||
$ codesign --force --deep --sign - samplebrain.app
|
||||
|
||||
## What's here
|
||||
|
||||
1. brain:
|
||||
* samplebrain engine code
|
||||
2. app:
|
||||
* code to build the Qt GUI app
|
||||
3. gui:
|
||||
* qt designer project files
|
||||
4. desktop:
|
||||
* various icon files etc
|
||||
4. cooking:
|
||||
* some sketches and ideas
|
||||
* proof of concept written in python
|
||||
* brief initial (abandoned) attempt at clojure version
|
||||
# [Building from source](building.md)
|
||||
|
||||
MFCC algo courtesy of the Aquila library by Zbigniew Siciarz MIT/X11
|
||||
licence 2007-2014 (see brain/src/aquila/LICENCE)
|
||||
|
||||
This program is free software licenced under GNU General Public
|
||||
License version 2 (see LICENCE).
|
||||
|
||||
Written by [Dave Griffiths at Then Try This](http://thentrythis.org).
|
||||
licence 2007-2014 (see brain/src/aquila/LICENCE). This program is free
|
||||
software licenced under GNU General Public License version 2 (see
|
||||
LICENCE). Written by [Dave Griffiths at Then Try This](http://thentrythis.org).
|
||||
|
||||
## Links
|
||||
|
||||
To find related tech like [CataRT](http://imtr.ircam.fr/imtr/CataRT), [bbcut2](https://composerprogrammer.com/bbcut2.html), [eargram](https://sites.google.com/site/eargram/) and [sCrAmBlEd?HaCkZ!](https://www.youtube.com/watch?v=eRlhKaxcKpA) search up [granular synthesis](http://granularsynthesis.com/guide.php), [concatenative synthesis](https://hal.archives-ouvertes.fr/hal-01161337), [neural audio synthesis](https://github.com/acids-ircam/RAVE), [sinewave speech](http://www.lifesci.sussex.ac.uk/home/Chris_Darwin/SWS/), automated breakbeat cutting, audio mosaicing and plunderphonics/plundermatics.
|
||||
To find related tech like [CataRT](https://ircam-ismm.github.io/max-msp/catart.html), [bbcut2](https://composerprogrammer.com/bbcut2.html), [eargram](https://sites.google.com/site/eargram/) and [sCrAmBlEd?HaCkZ!](https://www.youtube.com/watch?v=eRlhKaxcKpA) search up [granular synthesis](http://granularsynthesis.com/guide.php), [concatenative synthesis](https://hal.archives-ouvertes.fr/hal-01161337), [neural audio synthesis](https://github.com/acids-ircam/RAVE), [sinewave speech](http://www.lifesci.sussex.ac.uk/home/Chris_Darwin/SWS/), automated breakbeat cutting, audio mosaicing and plunderphonics/plundermatics.
|
||||
|
@ -14,6 +14,9 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifndef MAIN_WINDOW
|
||||
#define MAIN_WINDOW
|
||||
|
||||
#include <QtGui>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
@ -45,7 +48,9 @@ MainWindow::MainWindow() :
|
||||
m_Ui.brain_contents->setAlignment(Qt::AlignTop);
|
||||
m_Ui.brain_contents->setSpacing(0);
|
||||
m_Ui.brain_contents->setContentsMargins(0,0,0,0);
|
||||
|
||||
|
||||
m_settings_dialog = new SettingsDialog(this);
|
||||
|
||||
// add default local dest
|
||||
// turn on first one
|
||||
|
||||
@ -183,3 +188,5 @@ void MainWindow::init_from_session(const string &filename) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
104
app/MainWindow.h
104
app/MainWindow.h
@ -19,6 +19,7 @@
|
||||
#include <QFileDialog>
|
||||
#include <QLineEdit>
|
||||
#include "ui_samplebrain.h"
|
||||
#include "SettingsDialog.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <lo/lo.h>
|
||||
@ -26,6 +27,7 @@
|
||||
#include <list>
|
||||
#include "feedback.h"
|
||||
#include "sound_items.h"
|
||||
#include "audio_thread.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace spiralcore;
|
||||
@ -37,7 +39,65 @@ class MainWindow : public QMainWindow
|
||||
public:
|
||||
MainWindow();
|
||||
|
||||
// all this to work around liblo's use of varargs...
|
||||
void send_audio_osc(const char *name, const char *types) {
|
||||
for (auto dest:m_destinations) {
|
||||
if (dest.m_enabled) {
|
||||
lo_send(dest.m_audio_address,name,types);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void send_audio_osc(const char *name, const char *types, T val) {
|
||||
for (auto dest:m_destinations) {
|
||||
if (dest.m_enabled) {
|
||||
lo_send(dest.m_audio_address,name,types,val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void send_process_osc(const char *name, const char *types) {
|
||||
for (auto dest:m_destinations) {
|
||||
if (dest.m_enabled) {
|
||||
lo_send(dest.m_process_address,name,types);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void send_process_osc(const char *name, const char *types, T val) {
|
||||
for (auto dest:m_destinations) {
|
||||
if (dest.m_enabled) {
|
||||
lo_send(dest.m_process_address,name,types,val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void set_audio_thread(audio_thread *at) {
|
||||
m_audio_thread=at;
|
||||
m_audio_thread->start_audio();
|
||||
|
||||
for (auto &d:m_audio_thread->m_audio_device->m_client.m_devices) {
|
||||
if (d.id==0) {
|
||||
m_settings_dialog->m_Ui.deviceComboBox->clear();
|
||||
}
|
||||
m_settings_dialog->m_Ui.deviceComboBox->addItem(d.name.c_str());
|
||||
|
||||
if (d.default_output==1) {
|
||||
m_settings_dialog->m_device=d.name;
|
||||
m_settings_dialog->m_Ui.deviceComboBox->setCurrentText(d.name.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
m_settings_dialog->m_Ui.messagesLabel->setText(m_audio_thread->m_audio_device->m_client.m_status.c_str());
|
||||
}
|
||||
|
||||
audio_thread *get_audio_thread() {
|
||||
return m_audio_thread;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
private slots:
|
||||
@ -310,7 +370,7 @@ private slots:
|
||||
}
|
||||
|
||||
void update_status() {
|
||||
m_feedback.poll(m_Ui.statusbar,&m_sound_items);
|
||||
m_feedback.poll(m_Ui.statusbar,&m_sound_items,m_settings_dialog);
|
||||
}
|
||||
|
||||
void stereo_mode(bool s) {
|
||||
@ -336,7 +396,10 @@ private slots:
|
||||
|
||||
}
|
||||
|
||||
|
||||
void settings() {
|
||||
m_settings_dialog->show();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
///////////////////////////////////////////////
|
||||
@ -362,41 +425,6 @@ private:
|
||||
|
||||
vector<osc_destination> m_destinations;
|
||||
|
||||
// all this to work around liblo's use of varargs...
|
||||
void send_audio_osc(const char *name, const char *types) {
|
||||
for (auto dest:m_destinations) {
|
||||
if (dest.m_enabled) {
|
||||
lo_send(dest.m_audio_address,name,types);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void send_audio_osc(const char *name, const char *types, T val) {
|
||||
for (auto dest:m_destinations) {
|
||||
if (dest.m_enabled) {
|
||||
lo_send(dest.m_audio_address,name,types,val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void send_process_osc(const char *name, const char *types) {
|
||||
for (auto dest:m_destinations) {
|
||||
if (dest.m_enabled) {
|
||||
lo_send(dest.m_process_address,name,types);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void send_process_osc(const char *name, const char *types, T val) {
|
||||
for (auto dest:m_destinations) {
|
||||
if (dest.m_enabled) {
|
||||
lo_send(dest.m_process_address,name,types,val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void init_from_session(const string &filename);
|
||||
void add_gui_address(osc_destination &dest,
|
||||
@ -411,5 +439,7 @@ private:
|
||||
QSignalMapper* m_sound_item_delete_mapper;
|
||||
sound_items m_sound_items;
|
||||
|
||||
SettingsDialog *m_settings_dialog;
|
||||
audio_thread *m_audio_thread;
|
||||
|
||||
};
|
||||
|
39
app/SettingsDialog.cpp
Normal file
39
app/SettingsDialog.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2022 Then Try This
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include <QtGui>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "SettingsDialog.h"
|
||||
#include "feedback.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
SettingsDialog::SettingsDialog(MainWindow *parent):
|
||||
m_device(""),
|
||||
m_parent(parent),
|
||||
m_buffersize(2048),
|
||||
m_samplerate(44100) {
|
||||
m_Ui.setupUi(this);
|
||||
}
|
||||
|
||||
void SettingsDialog::connect() {
|
||||
audio_thread *at = m_parent->get_audio_thread();
|
||||
at->restart_audio(m_device,m_samplerate,m_buffersize);
|
||||
m_Ui.messagesLabel->setText(at->m_audio_device->m_client.m_status.c_str());
|
||||
}
|
75
app/SettingsDialog.h
Normal file
75
app/SettingsDialog.h
Normal file
@ -0,0 +1,75 @@
|
||||
// Copyright (C) 2022 Then Try This
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifndef SETTINGS_DIALOG
|
||||
#define SETTINGS_DIALOG
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include <QLineEdit>
|
||||
#include "ui_settings.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <lo/lo.h>
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class SettingsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SettingsDialog(MainWindow *parent);
|
||||
|
||||
Ui_SettingsDialog m_Ui;
|
||||
string m_device;
|
||||
|
||||
protected:
|
||||
|
||||
private slots:
|
||||
|
||||
void samplerate(QString str) {
|
||||
try { m_samplerate=stoi(str.toStdString()); }
|
||||
catch(std::exception const & e) {
|
||||
m_samplerate=44100;
|
||||
}
|
||||
}
|
||||
void output_device(QString v) { m_device=v.toStdString(); }
|
||||
void buffersize(QString str) {
|
||||
try { m_buffersize=stoi(str.toStdString()); }
|
||||
catch(std::exception const & e) {
|
||||
m_buffersize=44100;
|
||||
}
|
||||
}
|
||||
void accept() { connect(); hide(); }
|
||||
void reject() { hide(); }
|
||||
void apply() { connect(); }
|
||||
|
||||
private:
|
||||
|
||||
void connect();
|
||||
MainWindow *m_parent;
|
||||
|
||||
unsigned int m_buffersize;
|
||||
unsigned int m_samplerate;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -26,15 +26,20 @@ audio_thread::audio_thread(process_thread &p) :
|
||||
m_process_thread(p),
|
||||
m_brain_mutex(p.m_brain_mutex),
|
||||
m_stereo_mode(false),
|
||||
m_mic_mode(false)
|
||||
m_mic_mode(false),
|
||||
m_bufsize(2048),
|
||||
m_samplerate(44100),
|
||||
m_device("")
|
||||
{
|
||||
start_audio();
|
||||
// start_audio();
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_left_renderer = new renderer(p.m_source,p.m_left_target);
|
||||
m_right_renderer = new renderer(p.m_source,p.m_right_target);
|
||||
m_block_stream = new block_stream();
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
m_osc.run();
|
||||
// it this threadsafe?
|
||||
// m_audio_device->report_devices();
|
||||
}
|
||||
|
||||
static bool state = 1;
|
||||
@ -48,18 +53,28 @@ audio_thread::~audio_thread() {
|
||||
|
||||
void audio_thread::start_audio() {
|
||||
if (m_audio_device!=NULL) delete m_audio_device;
|
||||
m_audio_device = new audio_device("samplebrain",48000,2048);
|
||||
//m_audio_device = new audio_device("samplebrain",48000,2048*4);
|
||||
m_audio_device = new audio_device("samplebrain",m_samplerate,m_bufsize);
|
||||
m_audio_device->m_client.set_callback(run_audio, this);
|
||||
}
|
||||
|
||||
void audio_thread::restart_audio(const string device, unsigned int samplerate, unsigned int bufsize) {
|
||||
m_samplerate = samplerate;
|
||||
m_bufsize = bufsize;
|
||||
m_device = device;
|
||||
m_audio_device->connect(m_device,
|
||||
"samplebrain",
|
||||
m_samplerate,
|
||||
m_bufsize);
|
||||
}
|
||||
|
||||
|
||||
void audio_thread::run_audio(void* c, unsigned int frames) {
|
||||
if (state) {
|
||||
audio_thread *at = (audio_thread*)c;
|
||||
at->m_audio_device->left_out.zero();
|
||||
at->process(at->m_audio_device->left_in,
|
||||
at->m_audio_device->right_in,
|
||||
at->m_audio_device->left_out,
|
||||
at->m_audio_device->right_in,
|
||||
at->m_audio_device->left_out,
|
||||
at->m_audio_device->right_out);
|
||||
at->m_audio_device->maybe_record();
|
||||
}
|
||||
@ -186,12 +201,12 @@ void audio_thread::process(sample &left_in, sample &right_in, sample &left_out,
|
||||
}
|
||||
|
||||
m_left_renderer->process(left_out.get_length(),
|
||||
left_out.get_non_const_buffer(),
|
||||
bs);
|
||||
left_out.get_non_const_buffer(),
|
||||
bs);
|
||||
if (m_stereo_mode) {
|
||||
m_right_renderer->process(right_out.get_length(),
|
||||
right_out.get_non_const_buffer(),
|
||||
bs);
|
||||
right_out.get_non_const_buffer(),
|
||||
bs);
|
||||
} else {
|
||||
right_out=left_out;
|
||||
}
|
||||
|
@ -24,11 +24,14 @@
|
||||
|
||||
namespace spiralcore {
|
||||
|
||||
class audio_thread {
|
||||
public:
|
||||
class audio_thread {
|
||||
public:
|
||||
audio_thread(process_thread &p);
|
||||
~audio_thread();
|
||||
|
||||
void start_audio();
|
||||
void restart_audio(const string device, unsigned int samplerate, unsigned int bufsize);
|
||||
|
||||
void process(sample &left_in, sample &right_in, sample &left_out, sample &right_out);
|
||||
|
||||
static void run_audio(void* c, unsigned int frames);
|
||||
@ -38,14 +41,16 @@ public:
|
||||
renderer *m_right_renderer;
|
||||
block_stream *m_block_stream;
|
||||
|
||||
private:
|
||||
void start_audio();
|
||||
private:
|
||||
|
||||
OSC_server m_osc;
|
||||
process_thread &m_process_thread;
|
||||
pthread_mutex_t* m_brain_mutex;
|
||||
bool m_stereo_mode;
|
||||
bool m_mic_mode;
|
||||
};
|
||||
u32 m_bufsize;
|
||||
u32 m_samplerate;
|
||||
string m_device;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include "feedback.h"
|
||||
#include "sound_items.h"
|
||||
#include "SettingsDialog.h"
|
||||
#include <iostream>
|
||||
|
||||
using namespace spiralcore;
|
||||
@ -28,7 +29,7 @@ feedback::feedback(string address) :
|
||||
}
|
||||
|
||||
|
||||
void feedback::poll(QStatusBar *s, sound_items *sound_items) {
|
||||
void feedback::poll(QStatusBar *s, sound_items *sound_items, SettingsDialog *settings) {
|
||||
command_ring_buffer::command cmd;
|
||||
|
||||
while (m_osc.get(cmd)) {
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <string>
|
||||
#include <QtGui>
|
||||
#include <QStatusBar>
|
||||
#include "SettingsDialog.h"
|
||||
#include "spiralcore/OSC_server.h"
|
||||
|
||||
#pragma once
|
||||
@ -26,12 +27,12 @@ class sound_items;
|
||||
|
||||
class feedback {
|
||||
public:
|
||||
feedback(std::string address);
|
||||
void poll(QStatusBar *s, sound_items *sound_items);
|
||||
feedback(std::string address);
|
||||
void poll(QStatusBar *s, sound_items *sound_items, SettingsDialog *settings);
|
||||
|
||||
private:
|
||||
|
||||
OSC_server m_osc;
|
||||
OSC_server m_osc;
|
||||
};
|
||||
|
||||
}
|
||||
|
BIN
app/images/settings.png
Normal file
BIN
app/images/settings.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
@ -34,9 +34,9 @@ static void* _process(void *c) {
|
||||
|
||||
process_thread::process_thread() :
|
||||
m_osc("8889"),
|
||||
m_source_block_size(3000),
|
||||
m_source_block_size(1000),
|
||||
m_source_overlap(0.75),
|
||||
m_target_block_size(3000),
|
||||
m_target_block_size(1000),
|
||||
m_target_overlap(0.75),
|
||||
m_window_type(window::DODGY),
|
||||
m_target_window_type(window::DODGY)
|
||||
@ -63,82 +63,82 @@ void process_thread::process() {
|
||||
string name = cmd.m_name;
|
||||
//cerr<<name<<endl;
|
||||
if (name=="/load_sample") {
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_source.load_sound(cmd.get_string(0),brain::MIX);
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_source.load_sound(cmd.get_string(0),brain::MIX);
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
}
|
||||
if (name=="/delete_sample") {
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_source.delete_sound(cmd.get_string(0));
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_source.delete_sound(cmd.get_string(0));
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
}
|
||||
if (name=="/activate_sound") {
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_source.activate_sound(cmd.get_string(0),1);
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_source.activate_sound(cmd.get_string(0),1);
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
}
|
||||
if (name=="/deactivate_sound") {
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_source.activate_sound(cmd.get_string(0),0);
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_source.activate_sound(cmd.get_string(0),0);
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
}
|
||||
if (name=="/source_block_size") {
|
||||
m_source_block_size = cmd.get_int(0);
|
||||
m_source_block_size = cmd.get_int(0);
|
||||
}
|
||||
if (name=="/source_overlap") {
|
||||
m_source_overlap = m_source_block_size*cmd.get_float(0);
|
||||
m_source_overlap = m_source_block_size*cmd.get_float(0);
|
||||
}
|
||||
if (name=="/generate_brain") {
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_source.init(m_source_block_size, m_source_overlap, m_window_type);
|
||||
search_params p(1,0,0,100,0);
|
||||
m_source.build_synapses_fixed(p);
|
||||
m_left_renderer->reset();
|
||||
m_right_renderer->reset();
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_source.init(m_source_block_size, m_source_overlap, m_window_type);
|
||||
search_params p(1,0,0,100,0);
|
||||
m_source.build_synapses_fixed(p);
|
||||
m_left_renderer->reset();
|
||||
m_right_renderer->reset();
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
}
|
||||
if (name=="/load_target") {
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_left_target.clear_sounds();
|
||||
m_left_target.load_sound(cmd.get_string(0),brain::LEFT);
|
||||
m_right_target.clear_sounds();
|
||||
m_right_target.load_sound(cmd.get_string(0),brain::RIGHT);
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_left_target.clear_sounds();
|
||||
m_left_target.load_sound(cmd.get_string(0),brain::LEFT);
|
||||
m_right_target.clear_sounds();
|
||||
m_right_target.load_sound(cmd.get_string(0),brain::RIGHT);
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
}
|
||||
if (name=="/target_block_size") {
|
||||
m_target_block_size = cmd.get_int(0);
|
||||
m_block_stream->init(m_target_block_size, m_target_overlap, m_target_window_type);
|
||||
m_target_block_size = cmd.get_int(0);
|
||||
m_block_stream->init(m_target_block_size, m_target_overlap, m_target_window_type);
|
||||
}
|
||||
if (name=="/target_overlap") {
|
||||
m_target_overlap = m_target_block_size*cmd.get_float(0);
|
||||
m_block_stream->init(m_target_block_size, m_target_overlap, m_target_window_type);
|
||||
m_target_overlap = m_target_block_size*cmd.get_float(0);
|
||||
m_block_stream->init(m_target_block_size, m_target_overlap, m_target_window_type);
|
||||
}
|
||||
if (name=="/generate_target") {
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_left_target.init(m_target_block_size, m_target_overlap, m_target_window_type);
|
||||
m_right_target.init(m_target_block_size, m_target_overlap, m_target_window_type);
|
||||
// probably elsewhere
|
||||
m_block_stream->init(m_target_block_size, m_target_overlap, m_target_window_type);
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
pthread_mutex_lock(m_brain_mutex);
|
||||
m_left_target.init(m_target_block_size, m_target_overlap, m_target_window_type);
|
||||
m_right_target.init(m_target_block_size, m_target_overlap, m_target_window_type);
|
||||
// probably elsewhere
|
||||
m_block_stream->init(m_target_block_size, m_target_overlap, m_target_window_type);
|
||||
pthread_mutex_unlock(m_brain_mutex);
|
||||
}
|
||||
if (name=="/window_type") {
|
||||
m_window_type=(window::type)cmd.get_int(0);
|
||||
m_window_type=(window::type)cmd.get_int(0);
|
||||
}
|
||||
if (name=="/target_window_type") {
|
||||
m_target_window_type=(window::type)cmd.get_int(0);
|
||||
m_block_stream->init(m_target_block_size, m_target_overlap, m_target_window_type);
|
||||
m_target_window_type=(window::type)cmd.get_int(0);
|
||||
m_block_stream->init(m_target_block_size, m_target_overlap, m_target_window_type);
|
||||
}
|
||||
if (name=="/load_brain") {
|
||||
load_source(cmd.get_string(0));
|
||||
load_source(cmd.get_string(0));
|
||||
}
|
||||
if (name=="/save_brain") {
|
||||
save_source(cmd.get_string(0));
|
||||
save_source(cmd.get_string(0));
|
||||
}
|
||||
if (name=="/load_session") {
|
||||
load_session(cmd.get_string(0));
|
||||
load_session(cmd.get_string(0));
|
||||
}
|
||||
if (name=="/save_session") {
|
||||
save_session(cmd.get_string(0));
|
||||
save_session(cmd.get_string(0));
|
||||
}
|
||||
}
|
||||
#ifdef WIN32
|
||||
@ -181,9 +181,6 @@ void process_thread::load_session(const std::string &filename) {
|
||||
ifs||m_source_block_size||m_source_overlap;
|
||||
ifs||m_target_block_size||m_target_overlap;
|
||||
ifs||m_window_type||m_target_window_type;
|
||||
|
||||
cerr<<"loading window type session "<<m_target_window_type<<endl;
|
||||
|
||||
ifs||m_source;
|
||||
ifs||m_left_target;
|
||||
ifs||m_right_target;
|
||||
@ -200,9 +197,6 @@ void process_thread::save_session(const std::string &filename) {
|
||||
ofs||(*m_right_renderer);
|
||||
ofs||m_source_block_size||m_source_overlap;
|
||||
ofs||m_target_block_size||m_target_overlap;
|
||||
|
||||
cerr<<"saving window type session "<<m_target_window_type<<endl;
|
||||
|
||||
ofs||m_window_type||m_target_window_type;
|
||||
ofs||m_source;
|
||||
ofs||m_left_target;
|
||||
|
@ -30,12 +30,11 @@ int main( int argc , char *argv[] ){
|
||||
QApplication app(argc, argv);
|
||||
MainWindow mainWin;
|
||||
mainWin.show();
|
||||
|
||||
cerr<<"Qt version: "<<qVersion()<<endl;
|
||||
|
||||
process_thread pt;
|
||||
audio_thread at(pt);
|
||||
pt.register_renderer(at.m_left_renderer, at.m_right_renderer, at.m_block_stream);
|
||||
|
||||
mainWin.set_audio_thread(&at);
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="images">
|
||||
<file>images/settings.png</file>
|
||||
<file>images/at.png</file>
|
||||
<file>images/pause.png</file>
|
||||
<file>images/play.png</file>
|
||||
|
@ -33,7 +33,7 @@ sound_items::sound_item &sound_items::add(QVBoxLayout *container, const string &
|
||||
sound_item si;
|
||||
si.m_filename = name;
|
||||
si.m_id = m_current_sound_id++;
|
||||
QString style("background-color:lightgrey;");
|
||||
QString style("color:black;background-color:lightgrey;");
|
||||
|
||||
si.m_container = new QHBoxLayout();
|
||||
si.m_container->setSpacing(10);
|
||||
@ -89,8 +89,8 @@ void sound_items::clear() {
|
||||
void sound_items::recolour() {
|
||||
u32 c=0;
|
||||
for (auto &si:m_sound_items) {
|
||||
QString style("background-color:lightblue;");
|
||||
if (c%2==0) style="background-color:pink;";
|
||||
QString style("color:black;background-color:lightblue;");
|
||||
if (c%2==0) style="color:black;background-color:pink;";
|
||||
si.m_enable->setStyleSheet(style);
|
||||
si.m_del->setStyleSheet(style);
|
||||
si.m_label->setStyleSheet(style);
|
||||
@ -101,7 +101,7 @@ void sound_items::recolour() {
|
||||
void sound_items::change_colour(const std::string &name, const std::string &colour) {
|
||||
for (auto &si:m_sound_items) {
|
||||
if (si.m_filename==name) {
|
||||
QString style("background-color:"+QString::fromStdString(colour)+";");
|
||||
QString style("color:black;background-color:"+QString::fromStdString(colour)+";");
|
||||
si.m_enable->setStyleSheet(style);
|
||||
si.m_del->setStyleSheet(style);
|
||||
si.m_label->setStyleSheet(style);
|
||||
|
@ -77,7 +77,7 @@ block::block(u64 id, const string &filename, const sample &pcm, u32 rate, const
|
||||
m_orig_filename(filename),
|
||||
m_usage(0)
|
||||
{
|
||||
init_fft(m_pcm.get_length());
|
||||
init_fft(m_pcm.get_length(),rate);
|
||||
assert(m_mfcc_proc!=NULL);
|
||||
assert(m_fftw!=NULL);
|
||||
|
||||
@ -97,12 +97,12 @@ block::block(u64 id, const string &filename, const sample &pcm, u32 rate, const
|
||||
}
|
||||
|
||||
|
||||
void block::init_fft(u32 block_size) {
|
||||
void block::init_fft(u32 block_size, u32 rate) {
|
||||
if (m_fftw == NULL || m_fftw->m_length!=block_size) {
|
||||
if (m_fftw == NULL) delete m_fftw;
|
||||
m_fftw = new FFT(block_size,100);
|
||||
m_fftw = new FFT(block_size,rate,100);
|
||||
if (m_mfcc_proc == NULL) delete m_mfcc_proc;
|
||||
m_mfcc_proc = new Aquila::Mfcc(block_size);
|
||||
m_mfcc_proc = new Aquila::Mfcc(block_size,rate);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ namespace spiralcore {
|
||||
// returns distance based on ratio of fft-mfcc values
|
||||
double compare(const block &other, const search_params ¶ms) const;
|
||||
|
||||
static void init_fft(u32 block_size);
|
||||
static void init_fft(u32 block_size, u32 rate);
|
||||
static bool unit_test();
|
||||
|
||||
const sample &get_pcm() const { return m_pcm; }
|
||||
|
@ -377,34 +377,6 @@ void brain::deplete_usage() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// take another brain and rebuild this brain from bits of that one
|
||||
// (presumably this one is made from a single sample)
|
||||
/*void brain::resynth(const string &filename, const brain &other, const search_params ¶ms){
|
||||
sample out((m_block_size-m_overlap)*m_blocks.size());
|
||||
out.zero();
|
||||
u32 pos = 0;
|
||||
u32 count = 0;
|
||||
cerr<<other.m_blocks.size()<<" brain blocks..."<<endl;
|
||||
cerr<<endl;
|
||||
for (vector<block>::iterator i=m_blocks.begin(); i!=m_blocks.end(); ++i) {
|
||||
cerr<<'\r';
|
||||
cerr<<"searching: "<<count/float(m_blocks.size())*100;
|
||||
u32 index = other.search(*i, params);
|
||||
//cerr<<index<<endl;
|
||||
out.mul_mix(other.get_block_pcm(index),pos,0.2);
|
||||
|
||||
if (count%1000==0) {
|
||||
audio_device::save_sample(filename,out);
|
||||
}
|
||||
|
||||
++count;
|
||||
pos += (m_block_size-m_overlap);
|
||||
}
|
||||
audio_device::save_sample(filename,out);
|
||||
}
|
||||
*/
|
||||
|
||||
ios &spiralcore::operator||(ios &s, brain::sound &b) {
|
||||
u32 version=1;
|
||||
string id("brain::sound");
|
||||
|
@ -24,8 +24,9 @@ using namespace std;
|
||||
|
||||
static const int MAX_FFT_LENGTH = 4096;
|
||||
|
||||
FFT::FFT(u32 length, u32 bins) :
|
||||
FFT::FFT(u32 length, u32 rate, u32 bins) :
|
||||
m_length(length),
|
||||
m_rate(rate),
|
||||
m_num_bins(bins),
|
||||
m_in(new double[length]),
|
||||
m_spectrum(new fftw_complex[length]),
|
||||
@ -35,26 +36,19 @@ FFT::FFT(u32 length, u32 bins) :
|
||||
m_plan = fftw_plan_dft_r2c_1d(m_length, m_in, m_spectrum, FFTW_ESTIMATE);
|
||||
}
|
||||
|
||||
FFT::~FFT()
|
||||
{
|
||||
FFT::~FFT() {
|
||||
delete[] m_in;
|
||||
fftw_destroy_plan(m_plan);
|
||||
}
|
||||
|
||||
void FFT::impulse2freq(const float *imp)
|
||||
{
|
||||
void FFT::impulse2freq(const float *imp) {
|
||||
unsigned int i;
|
||||
|
||||
for (i=0; i<m_length; i++)
|
||||
{
|
||||
m_in[i] = imp[i];
|
||||
}
|
||||
|
||||
for (i=0; i<m_length; i++) {
|
||||
m_in[i] = imp[i];
|
||||
}
|
||||
fftw_execute(m_plan);
|
||||
}
|
||||
|
||||
static const float SRATE = 44100;
|
||||
|
||||
float FFT::calculate_dominant_freq() {
|
||||
double highest = 0;
|
||||
u32 index = 0;
|
||||
@ -65,7 +59,7 @@ float FFT::calculate_dominant_freq() {
|
||||
highest=t;
|
||||
}
|
||||
}
|
||||
float freq = index * (SRATE/(float)m_length);
|
||||
float freq = index * (m_rate/(float)m_length);
|
||||
if (freq<0.01) freq=0.01;
|
||||
return freq;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ namespace spiralcore {
|
||||
class FFT
|
||||
{
|
||||
public:
|
||||
FFT(u32 length, u32 num_bins);
|
||||
FFT(u32 length, u32 rate, u32 num_bins);
|
||||
~FFT();
|
||||
void impulse2freq(const float *imp);
|
||||
void calculate_bins();
|
||||
@ -35,6 +35,7 @@ namespace spiralcore {
|
||||
|
||||
fftw_plan m_plan;
|
||||
u32 m_length;
|
||||
u32 m_rate;
|
||||
u32 m_num_bins;
|
||||
double *m_in;
|
||||
fftw_complex *m_spectrum;
|
||||
|
@ -26,7 +26,7 @@ namespace Aquila
|
||||
{
|
||||
//auto spectrum = m_fft->fft(source);
|
||||
|
||||
Aquila::MelFilterBank bank(44100, m_inputSize);
|
||||
Aquila::MelFilterBank bank(m_sampleRate, m_inputSize);
|
||||
auto filterOutput = bank.applyAll(spectrum);
|
||||
|
||||
Aquila::Dct dct;
|
||||
|
@ -59,8 +59,9 @@ namespace Aquila
|
||||
*
|
||||
* @param inputSize input length (common to all inputs)
|
||||
*/
|
||||
Mfcc(std::size_t inputSize):
|
||||
m_inputSize(inputSize)//, m_fft(FftFactory::getFft(inputSize))
|
||||
Mfcc(std::size_t inputSize, unsigned int sampleRate):
|
||||
m_inputSize(inputSize), // m_fft(FftFactory::getFft(inputSize))
|
||||
m_sampleRate(sampleRate)
|
||||
{
|
||||
}
|
||||
|
||||
@ -71,7 +72,8 @@ namespace Aquila
|
||||
* Number of samples in each processed input.
|
||||
*/
|
||||
const std::size_t m_inputSize;
|
||||
|
||||
const unsigned int m_sampleRate;
|
||||
|
||||
/**
|
||||
* FFT calculator.
|
||||
*/
|
||||
|
@ -22,31 +22,40 @@ using namespace std;
|
||||
using namespace spiralcore;
|
||||
|
||||
audio_device::audio_device(const string &clientname, u32 samplerate, u32 buffer_size) :
|
||||
left_out(buffer_size),
|
||||
right_out(buffer_size),
|
||||
left_in(buffer_size),
|
||||
right_in(buffer_size),
|
||||
m_recording(false),
|
||||
m_record_filename("")
|
||||
{
|
||||
portaudio_client::device_options opt;
|
||||
opt.buffer_size = buffer_size;
|
||||
opt.num_buffers = 2;
|
||||
opt.samplerate = samplerate;
|
||||
opt.in_channels = 2;
|
||||
opt.out_channels = 2;
|
||||
m_record_filename(""),
|
||||
m_samplerate(samplerate) {
|
||||
// connect to default device
|
||||
m_client.init();
|
||||
connect("", clientname, samplerate, buffer_size);
|
||||
}
|
||||
|
||||
m_client.set_outputs(left_out.get_buffer(), right_out.get_buffer());
|
||||
m_client.set_inputs(left_in.get_non_const_buffer(), right_in.get_non_const_buffer());
|
||||
m_client.attach(clientname,opt);
|
||||
void audio_device::connect(const string &output_device_name, const string &clientname, u32 samplerate, u32 buffer_size) {
|
||||
m_client.detach();
|
||||
|
||||
left_out.allocate(buffer_size);
|
||||
right_out.allocate(buffer_size);
|
||||
left_in.allocate(buffer_size);
|
||||
right_in.allocate(buffer_size);
|
||||
m_samplerate = samplerate;
|
||||
|
||||
portaudio_client::device_options opt;
|
||||
opt.buffer_size = buffer_size;
|
||||
opt.num_buffers = 2;
|
||||
opt.samplerate = samplerate;
|
||||
opt.in_channels = 2;
|
||||
opt.out_channels = 2;
|
||||
|
||||
m_client.set_outputs(left_out.get_buffer(), right_out.get_buffer());
|
||||
m_client.set_inputs(left_in.get_non_const_buffer(), right_in.get_non_const_buffer());
|
||||
m_client.attach(output_device_name,clientname,opt);
|
||||
}
|
||||
|
||||
void audio_device::save_sample(const string &filename, const sample s) {
|
||||
SF_INFO sfinfo;
|
||||
sfinfo.format=SF_FORMAT_WAV | SF_FORMAT_FLOAT;
|
||||
sfinfo.frames=s.get_length();
|
||||
sfinfo.samplerate=44100;
|
||||
sfinfo.samplerate=m_samplerate;
|
||||
sfinfo.channels=1;
|
||||
sfinfo.sections=1;
|
||||
sfinfo.seekable=0;
|
||||
@ -82,5 +91,4 @@ void audio_device::maybe_record() {
|
||||
}
|
||||
}
|
||||
|
||||
void audio_device::start_graph(graph *graph) {
|
||||
}
|
||||
|
||||
|
@ -24,11 +24,11 @@ class graph;
|
||||
|
||||
namespace spiralcore {
|
||||
|
||||
class audio_device {
|
||||
public:
|
||||
class audio_device {
|
||||
public:
|
||||
audio_device(const string &clientname, u32 samplerate, u32 buffer_size);
|
||||
|
||||
void start_graph(graph *graph);
|
||||
void connect(const string &output_device, const string &clientname, u32 samplerate, u32 buffer_size);
|
||||
|
||||
void start_recording(std::string filename);
|
||||
void stop_recording();
|
||||
@ -39,18 +39,18 @@ public:
|
||||
sample left_in;
|
||||
sample right_in;
|
||||
graph *m_graph;
|
||||
|
||||
|
||||
portaudio_client m_client;
|
||||
|
||||
static void save_sample(const std::string &filename, const sample s);
|
||||
void save_sample(const std::string &filename, const sample s);
|
||||
|
||||
private:
|
||||
private:
|
||||
bool m_recording;
|
||||
std::string m_record_filename;
|
||||
sample m_record_buffer_left;
|
||||
sample m_record_buffer_right;
|
||||
u32 m_record_counter;
|
||||
|
||||
};
|
||||
u32 m_samplerate;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -19,15 +19,16 @@
|
||||
|
||||
#include "portaudio_client.h"
|
||||
|
||||
bool portaudio_client::m_attached = false;
|
||||
long unsigned int portaudio_client::m_buffer_size = 0;
|
||||
long unsigned int portaudio_client::m_sample_rate = 44100;
|
||||
bool portaudio_client::m_initialised = false;
|
||||
int portaudio_client::m_attached_device = -1;
|
||||
void (*portaudio_client::run_callback)(void*, unsigned int buf_size)=NULL;
|
||||
void *portaudio_client::run_context = NULL;
|
||||
const float *portaudio_client::m_right_data=NULL;
|
||||
const float *portaudio_client::m_left_data=NULL;
|
||||
float *portaudio_client::m_right_in_data=NULL;
|
||||
float *portaudio_client::m_left_in_data=NULL;
|
||||
PaStream *portaudio_client::m_stream=NULL;
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
@ -37,58 +38,106 @@ portaudio_client::portaudio_client() {
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
portaudio_client::~portaudio_client() {
|
||||
detach();
|
||||
detach();
|
||||
}
|
||||
|
||||
bool portaudio_client::init() {
|
||||
m_initialised=false;
|
||||
if (!m_initialised) {
|
||||
PaError err;
|
||||
err = Pa_Initialize();
|
||||
if( err != paNoError ) {
|
||||
Pa_Terminate();
|
||||
m_status="error initialising portaudio: "+string(Pa_GetErrorText(err))+"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
// load all the devices we have
|
||||
PaDeviceIndex default_output_num = Pa_GetDefaultOutputDevice();
|
||||
PaDeviceIndex default_input_num = Pa_GetDefaultInputDevice();
|
||||
|
||||
m_devices.clear();
|
||||
// get all devices we have available
|
||||
int numDevices = Pa_GetDeviceCount();
|
||||
if(numDevices <= 0) {
|
||||
m_status="portaudio error: no audio devices found";
|
||||
return false;
|
||||
}
|
||||
|
||||
const PaDeviceInfo *deviceInfo;
|
||||
|
||||
for(int i=0; i<numDevices; i++) {
|
||||
deviceInfo = Pa_GetDeviceInfo(i);
|
||||
if (deviceInfo->maxOutputChannels>=2) {
|
||||
device_desc desc;
|
||||
desc.name = deviceInfo->name;
|
||||
desc.id = i;
|
||||
desc.default_input = i==default_input_num;
|
||||
desc.default_output = i==default_output_num;
|
||||
m_devices.push_back(desc);
|
||||
}
|
||||
}
|
||||
|
||||
m_initialised=true;
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int portaudio_client::device_name_to_id(const string &name) {
|
||||
for (auto &d:m_devices) {
|
||||
if (d.name==name) return d.id;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool portaudio_client::attach(const string &client_name, const device_options &dopt) {
|
||||
if (m_attached) return true;
|
||||
|
||||
PaError err;
|
||||
err = Pa_Initialize();
|
||||
if( err != paNoError ) {
|
||||
cerr<<"could not init portaudio_client"<<endl;
|
||||
Pa_Terminate();
|
||||
fprintf( stderr, "an error occured while using the portaudio stream\n" );
|
||||
fprintf( stderr, "error number: %d\n", err );
|
||||
fprintf( stderr, "error message: %s\n", Pa_GetErrorText( err ) );
|
||||
}
|
||||
|
||||
PaDeviceIndex output_device_num = Pa_GetDefaultOutputDevice();
|
||||
PaDeviceIndex input_device_num = Pa_GetDefaultInputDevice();
|
||||
|
||||
PaStreamParameters output_parameters;
|
||||
output_parameters.device = output_device_num;
|
||||
if (output_parameters.device == paNoDevice) {
|
||||
cerr<<"error: no default output device."<<endl;
|
||||
} else {
|
||||
output_parameters.channelCount = 2; /* stereo output */
|
||||
output_parameters.sampleFormat = paFloat32; /* 32 bit floating point output */
|
||||
output_parameters.suggestedLatency = Pa_GetDeviceInfo( output_parameters.device )->defaultLowOutputLatency;
|
||||
output_parameters.hostApiSpecificStreamInfo = NULL;
|
||||
cerr<<"Connecting to "<<Pa_GetDeviceInfo( output_parameters.device )->name<<" for output"<<endl;
|
||||
}
|
||||
bool portaudio_client::attach(const string &requested_output_device, const string &client_name, const device_options &dopt) {
|
||||
if (!init()) return false;
|
||||
detach();
|
||||
|
||||
int requested_output_id = device_name_to_id(requested_output_device);
|
||||
|
||||
PaStreamParameters input_parameters;
|
||||
PaStreamParameters output_parameters;
|
||||
if (requested_output_device=="" || requested_output_id==-1) {
|
||||
// start up by connecting to the default one
|
||||
PaDeviceIndex default_output_num = Pa_GetDefaultOutputDevice();
|
||||
if (default_output_num == paNoDevice) {
|
||||
m_status="error: no default output device.";
|
||||
return false;
|
||||
} else {
|
||||
output_parameters.device = default_output_num;
|
||||
}
|
||||
} else {
|
||||
output_parameters.device = requested_output_id;
|
||||
}
|
||||
|
||||
output_parameters.channelCount = 2; /* stereo output */
|
||||
output_parameters.sampleFormat = paFloat32; /* 32 bit floating point output */
|
||||
output_parameters.suggestedLatency = Pa_GetDeviceInfo( output_parameters.device )->defaultLowOutputLatency;
|
||||
output_parameters.hostApiSpecificStreamInfo = NULL;
|
||||
m_status="connecting to "+string(Pa_GetDeviceInfo(output_parameters.device)->name)+" for output\n";
|
||||
|
||||
// turn off input for the moment, it's causing
|
||||
// too many cross platform security issues
|
||||
|
||||
/*PaStreamParameters input_parameters;
|
||||
PaStreamParameters *input_p=&input_parameters;
|
||||
input_parameters.device = input_device_num;
|
||||
if (true || input_parameters.device == paNoDevice) {
|
||||
cerr<<"error: no default input device."<<endl;
|
||||
input_p=0;
|
||||
} else {
|
||||
input_parameters.channelCount = 2; /* stereo output */
|
||||
input_parameters.sampleFormat = paFloat32; /* 32 bit floating point output */
|
||||
input_parameters.channelCount = 2;
|
||||
input_parameters.sampleFormat = paFloat32;
|
||||
input_parameters.suggestedLatency = Pa_GetDeviceInfo( input_parameters.device )->defaultLowInputLatency;
|
||||
input_parameters.hostApiSpecificStreamInfo = NULL;
|
||||
cerr<<"Connecting to "<<Pa_GetDeviceInfo( input_parameters.device )->name<<" for input"<<endl;
|
||||
}
|
||||
} */
|
||||
|
||||
PaStream *stream;
|
||||
|
||||
err = Pa_OpenStream(&stream,
|
||||
input_p,
|
||||
PaError err = Pa_OpenStream(&m_stream,
|
||||
NULL,
|
||||
&output_parameters,
|
||||
dopt.samplerate,
|
||||
dopt.buffer_size,
|
||||
@ -96,31 +145,38 @@ bool portaudio_client::attach(const string &client_name, const device_options &d
|
||||
process,
|
||||
NULL);
|
||||
|
||||
m_attached_device=output_parameters.device;
|
||||
|
||||
if(err != paNoError) {
|
||||
cerr<<"could not attach portaudio_client: "<<Pa_GetErrorText( err )<<endl;
|
||||
Pa_Terminate();
|
||||
m_status+="could not attach: "+string(Pa_GetErrorText(err))+"\n";
|
||||
detach();
|
||||
return false;
|
||||
}
|
||||
|
||||
err = Pa_StartStream(stream);
|
||||
err = Pa_StartStream(m_stream);
|
||||
|
||||
if(err != paNoError) {
|
||||
cerr<<"could not start stream: "<<Pa_GetErrorText( err )<<endl;
|
||||
Pa_Terminate();
|
||||
m_status+="could not start stream: "+string(Pa_GetErrorText(err))+"\n";
|
||||
detach();
|
||||
return false;
|
||||
}
|
||||
|
||||
m_attached=true;
|
||||
cerr<<"connected to portaudio..."<<endl;
|
||||
m_status+="we are connected to portaudio!\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void portaudio_client::detach() {
|
||||
cerr<<"detaching from portaudio"<<endl;
|
||||
Pa_Terminate();
|
||||
m_attached=false;
|
||||
if (m_attached_device!=-1) {
|
||||
if (m_stream!=NULL) {
|
||||
Pa_CloseStream(m_stream);
|
||||
}
|
||||
m_stream=NULL;
|
||||
m_status+="detaching from portaudio\n";
|
||||
Pa_Terminate();
|
||||
m_attached_device=-1;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -30,9 +30,9 @@ class portaudio_client
|
||||
public:
|
||||
portaudio_client();
|
||||
~portaudio_client();
|
||||
bool init();
|
||||
|
||||
class device_options
|
||||
{
|
||||
class device_options {
|
||||
public:
|
||||
enum type {READ,WRITE,READWRITE};
|
||||
unsigned int buffer_size;
|
||||
@ -42,13 +42,25 @@ class portaudio_client
|
||||
unsigned int out_channels;
|
||||
};
|
||||
|
||||
bool attach(const string &client_name, const device_options &dopt);
|
||||
class device_desc {
|
||||
public:
|
||||
string name;
|
||||
int id;
|
||||
bool default_input;
|
||||
bool default_output;
|
||||
};
|
||||
|
||||
vector<portaudio_client::device_desc> m_devices;
|
||||
|
||||
bool attach(const string &requested_output_device, const string &client_name, const device_options &dopt);
|
||||
void detach();
|
||||
bool is_attached() { return m_attached; }
|
||||
bool is_attached() { return m_attached_device!=-1; }
|
||||
void set_callback(void(*run)(void*, unsigned int),void *context) { run_callback=run; run_context=context; }
|
||||
void set_outputs(const float *l, const float *r) { m_left_data=l; m_right_data=r; }
|
||||
void set_inputs(float *l, float *r) { m_left_in_data=l; m_right_in_data=r; }
|
||||
|
||||
string m_status;
|
||||
|
||||
protected:
|
||||
|
||||
static int process(const void *input_buffer, void *output_buffer,
|
||||
@ -59,17 +71,21 @@ class portaudio_client
|
||||
|
||||
private:
|
||||
|
||||
int device_name_to_id(const string &name);
|
||||
|
||||
static long unsigned int m_buffer_size;
|
||||
static long unsigned int m_sample_rate;
|
||||
static bool m_attached;
|
||||
|
||||
static bool m_initialised;
|
||||
static int m_attached_device;
|
||||
|
||||
static const float *m_right_data;
|
||||
static const float *m_left_data;
|
||||
static float *m_right_in_data;
|
||||
static float *m_left_in_data;
|
||||
|
||||
|
||||
static void(*run_callback)(void *, unsigned int);
|
||||
static void *run_context;
|
||||
static PaStream *m_stream;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -24,11 +24,13 @@ namespace spiralcore {
|
||||
|
||||
class status {
|
||||
public:
|
||||
static void _update(const std::string &msg);
|
||||
static void update(const char *msg, ...);
|
||||
static void sound_item(const std::string &name, const std::string &colour);
|
||||
static void sound_item_refresh();
|
||||
static lo_address m_address;
|
||||
static void _update(const std::string &msg);
|
||||
static void update(const char *msg, ...);
|
||||
static void sound_item(const std::string &name, const std::string &colour);
|
||||
static void sound_item_refresh();
|
||||
static void add_audio_device(int id, const std::string &name, bool default_output);
|
||||
static void audio_device_status(const std::string &status);
|
||||
static lo_address m_address;
|
||||
};
|
||||
|
||||
}
|
||||
|
59
building.md
Normal file
59
building.md
Normal file
@ -0,0 +1,59 @@
|
||||
# Building from source
|
||||
## Linux (Ubuntu)
|
||||
Install libraries for the sample engine (use brew on mac, MinGW on win):
|
||||
|
||||
$ sudo apt install libsndfile1-dev portaudio19-dev liblo-dev libfftw3-dev
|
||||
|
||||
Install dependencies for the interface:
|
||||
|
||||
$ sudo apt install build-essential qtcreator qt5-default
|
||||
|
||||
Build & run it:
|
||||
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ qmake ..
|
||||
$ make
|
||||
$ sudo make install
|
||||
$ samplebrain
|
||||
|
||||
## Mac
|
||||
Install libraries for sample engine:
|
||||
|
||||
$ brew install fftw portaudio liblo libsndfile
|
||||
|
||||
Install dependencies for the interface:
|
||||
|
||||
$ brew install qt
|
||||
$ brew link qt
|
||||
|
||||
Build & run it:
|
||||
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ qmake ..
|
||||
$ make
|
||||
|
||||
`samplebrain.app` should then be in the app folder for you to run.
|
||||
|
||||
# Mac build additions
|
||||
|
||||
To make a mac app bundle:
|
||||
|
||||
Run `macdeployqt` which copies all dependencies inside the app.
|
||||
|
||||
$ cd build
|
||||
$ macdeployqt
|
||||
|
||||
If the icon is not visible, you might need to copy desktop/samplebrain.icns (the icon) to the Resources directory in the app bundle.
|
||||
|
||||
$ cp ../desktop/samplebrain.icns samplebrain.app/Contents/Resources
|
||||
|
||||
Then edit Info.plist to add samplebrain.icns to CFBundleIconFile. Key `CFBundleIconFile` should match:
|
||||
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>samplebrain.icns</string>
|
||||
|
||||
You might also need to resign the app bundle after making any changes
|
||||
|
||||
$ codesign --force --deep --sign - samplebrain.app
|
27
changelog.md
Normal file
27
changelog.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Changlog
|
||||
|
||||
0.18.3
|
||||
|
||||
* **Windows**: [samplebrain_0.18.3_win.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18.3_win.zip)
|
||||
* **Mac (intel/m1)**: [samplebrain_0.18.3_macintel.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18.3_macintel.app.zip)
|
||||
|
||||
Changes: Release fixes loading samples from paths longer than 255 characters
|
||||
|
||||
0.18.2
|
||||
|
||||
* **Windows**: [samplebrain_0.18.2_win.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18.2_win.zip)
|
||||
|
||||
Changes: Crash fix when closing load session file dialog
|
||||
|
||||
0.18.1
|
||||
|
||||
* **Windows**: [samplebrain_0.18.1_win.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18.1_win.zip)
|
||||
* **Mac (intel/m1)**: [samplebrain_0.18.1_macintel.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18.1_macintel.app.zip)
|
||||
|
||||
Changes: Turned off microphone input to prevent security problems
|
||||
|
||||
0.18 (initial release)
|
||||
|
||||
* **Windows**: [samplebrain_0.18_win.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18_win.zip)
|
||||
* **Mac (intel)**: [samplebrain_0.18_macintel.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18_macintel.zip)
|
||||
* **Mac (m1)**: [samplebrain_0.18_m1_v2.dmg](https://static.thentrythis.org/samplebrain/samplebrain_0.18_m1_v2.dmg)
|
@ -11,7 +11,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>samplebrain 0.18.3</string>
|
||||
<string>samplebrain 0.18.4</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
@ -96,6 +96,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>plain fft match vs mfcc values </string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
@ -156,6 +159,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>match original or normalised blocks</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
@ -298,6 +304,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>use new blocks rather than similar ones</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
@ -361,6 +370,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>how long it takes for the novelty to wear off</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
@ -403,7 +415,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>how long it takes for the novelty to wear off</string>
|
||||
<string>likelihood of playing the next block rather than the closest</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
@ -424,6 +436,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>likelihood of playing the next block rather than the closest</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
@ -491,7 +506,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>how many connections to search (ordered in closeness)</string>
|
||||
<string>repeat search (set novelty to 0 for dodgy jungle timessssstretch)</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
@ -666,7 +681,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>how many connections to search (ordered in closeness)</string>
|
||||
<string>block difference higher than this causes a new search, skipping the target</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
@ -752,7 +767,7 @@
|
||||
<number>99999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>3000</number>
|
||||
<number>1000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -783,7 +798,7 @@
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.800000000000000</double>
|
||||
<double>0.750000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -944,6 +959,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>amount to match the frequency</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
@ -1001,6 +1019,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>mix in the normalised blocks</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
@ -1061,6 +1082,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>mix in the original blocks</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
@ -1236,7 +1260,7 @@
|
||||
<number>99999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>3000</number>
|
||||
<number>1000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1267,7 +1291,7 @@
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
<double>0.750000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1562,6 +1586,33 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Comic Sans MS</family>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../app/samplebrain.qrc">
|
||||
<normaloff>:/images/images/settings.png</normaloff>:/images/images/settings.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
@ -1593,8 +1644,6 @@
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../app/samplebrain.qrc"/>
|
||||
<include location="../app/samplebrain.qrc"/>
|
||||
<include location="../app/samplebrain.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
@ -1604,8 +1653,8 @@
|
||||
<slot>play_slot()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>64</x>
|
||||
<y>62</y>
|
||||
<x>78</x>
|
||||
<y>830</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@ -1620,8 +1669,8 @@
|
||||
<slot>stop_slot()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>155</x>
|
||||
<y>62</y>
|
||||
<x>180</x>
|
||||
<y>830</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@ -1636,8 +1685,8 @@
|
||||
<slot>volume_slot(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>189</x>
|
||||
<y>480</y>
|
||||
<x>465</x>
|
||||
<y>852</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>361</x>
|
||||
@ -1652,8 +1701,8 @@
|
||||
<slot>stop_record()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>328</x>
|
||||
<y>543</y>
|
||||
<x>356</x>
|
||||
<y>840</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>361</x>
|
||||
@ -1668,8 +1717,8 @@
|
||||
<slot>record()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>236</x>
|
||||
<y>543</y>
|
||||
<x>268</x>
|
||||
<y>840</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>361</x>
|
||||
@ -1684,8 +1733,8 @@
|
||||
<slot>fft1_end_slot(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>154</x>
|
||||
<y>310</y>
|
||||
<x>421</x>
|
||||
<y>293</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@ -1700,8 +1749,8 @@
|
||||
<slot>ratio_slot(double)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>109</x>
|
||||
<y>223</y>
|
||||
<x>421</x>
|
||||
<y>185</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@ -1716,12 +1765,12 @@
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>237</x>
|
||||
<y>289</y>
|
||||
<x>319</x>
|
||||
<y>603</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>341</x>
|
||||
<y>289</y>
|
||||
<x>421</x>
|
||||
<y>614</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@ -1732,8 +1781,8 @@
|
||||
<slot>target_mix_slot(double)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>330</x>
|
||||
<y>446</y>
|
||||
<x>720</x>
|
||||
<y>669</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>361</x>
|
||||
@ -1748,8 +1797,8 @@
|
||||
<slot>generate_target_blocks()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>277</x>
|
||||
<y>202</y>
|
||||
<x>670</x>
|
||||
<y>395</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@ -1764,8 +1813,8 @@
|
||||
<slot>target_block_size(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>313</x>
|
||||
<y>136</y>
|
||||
<x>720</x>
|
||||
<y>237</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@ -1780,8 +1829,8 @@
|
||||
<slot>load_target()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>277</x>
|
||||
<y>103</y>
|
||||
<x>670</x>
|
||||
<y>184</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@ -1796,8 +1845,8 @@
|
||||
<slot>fft1_start_slot(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>154</x>
|
||||
<y>277</y>
|
||||
<x>298</x>
|
||||
<y>293</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@ -1812,8 +1861,8 @@
|
||||
<slot>target_block_overlap(double)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>619</x>
|
||||
<y>196</y>
|
||||
<x>720</x>
|
||||
<y>291</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>361</x>
|
||||
@ -1828,12 +1877,12 @@
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>341</x>
|
||||
<y>289</y>
|
||||
<x>421</x>
|
||||
<y>614</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>237</x>
|
||||
<y>289</y>
|
||||
<x>319</x>
|
||||
<y>603</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@ -1844,8 +1893,8 @@
|
||||
<slot>synapses(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>341</x>
|
||||
<y>289</y>
|
||||
<x>421</x>
|
||||
<y>614</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>566</x>
|
||||
@ -1860,8 +1909,8 @@
|
||||
<slot>ratio_slot(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>189</x>
|
||||
<y>141</y>
|
||||
<x>323</x>
|
||||
<y>174</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>361</x>
|
||||
@ -1876,8 +1925,8 @@
|
||||
<slot>n_ratio_slot(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>159</x>
|
||||
<y>211</y>
|
||||
<x>323</x>
|
||||
<y>228</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>361</x>
|
||||
@ -1892,8 +1941,8 @@
|
||||
<slot>n_ratio_slot(double)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>330</x>
|
||||
<y>211</y>
|
||||
<x>421</x>
|
||||
<y>239</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>361</x>
|
||||
@ -1908,8 +1957,8 @@
|
||||
<slot>target_mix_slot(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>159</x>
|
||||
<y>446</y>
|
||||
<x>622</x>
|
||||
<y>658</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>361</x>
|
||||
@ -1924,8 +1973,8 @@
|
||||
<slot>n_mix_slot(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>159</x>
|
||||
<y>386</y>
|
||||
<x>622</x>
|
||||
<y>604</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>361</x>
|
||||
@ -1940,8 +1989,8 @@
|
||||
<slot>n_mix_slot(double)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>330</x>
|
||||
<y>386</y>
|
||||
<x>720</x>
|
||||
<y>615</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>361</x>
|
||||
@ -1956,8 +2005,8 @@
|
||||
<slot>load_brain()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>615</x>
|
||||
<y>357</y>
|
||||
<x>941</x>
|
||||
<y>661</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>566</x>
|
||||
@ -1972,8 +2021,8 @@
|
||||
<slot>boredom_slot(double)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>411</x>
|
||||
<y>253</y>
|
||||
<x>421</x>
|
||||
<y>401</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>321</x>
|
||||
@ -1988,8 +2037,8 @@
|
||||
<slot>novelty_slot(double)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>411</x>
|
||||
<y>217</y>
|
||||
<x>421</x>
|
||||
<y>347</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>321</x>
|
||||
@ -2004,8 +2053,8 @@
|
||||
<slot>novelty_slot(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>291</x>
|
||||
<y>217</y>
|
||||
<x>323</x>
|
||||
<y>336</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>321</x>
|
||||
@ -2020,8 +2069,8 @@
|
||||
<slot>boredom_slot(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>291</x>
|
||||
<y>253</y>
|
||||
<x>323</x>
|
||||
<y>390</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>321</x>
|
||||
@ -2036,8 +2085,8 @@
|
||||
<slot>synapses(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>237</x>
|
||||
<y>289</y>
|
||||
<x>319</x>
|
||||
<y>603</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>566</x>
|
||||
@ -2052,8 +2101,8 @@
|
||||
<slot>block_size(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>728</x>
|
||||
<y>109</y>
|
||||
<x>1157</x>
|
||||
<y>450</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>566</x>
|
||||
@ -2068,8 +2117,8 @@
|
||||
<slot>block_overlap(double)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>728</x>
|
||||
<y>145</y>
|
||||
<x>1157</x>
|
||||
<y>504</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>566</x>
|
||||
@ -2084,8 +2133,8 @@
|
||||
<slot>save_brain()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>728</x>
|
||||
<y>357</y>
|
||||
<x>1157</x>
|
||||
<y>661</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>566</x>
|
||||
@ -2100,8 +2149,8 @@
|
||||
<slot>clear_brain()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>1061</x>
|
||||
<y>550</y>
|
||||
<x>1157</x>
|
||||
<y>396</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>566</x>
|
||||
@ -2116,8 +2165,8 @@
|
||||
<slot>generate()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>671</x>
|
||||
<y>322</y>
|
||||
<x>1158</x>
|
||||
<y>608</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>566</x>
|
||||
@ -2132,8 +2181,8 @@
|
||||
<slot>load_sound()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>841</x>
|
||||
<y>550</y>
|
||||
<x>868</x>
|
||||
<y>396</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>566</x>
|
||||
@ -2148,12 +2197,12 @@
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>241</x>
|
||||
<y>282</y>
|
||||
<x>346</x>
|
||||
<y>498</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>343</x>
|
||||
<y>282</y>
|
||||
<x>421</x>
|
||||
<y>509</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@ -2164,12 +2213,12 @@
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>343</x>
|
||||
<y>282</y>
|
||||
<x>421</x>
|
||||
<y>509</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>241</x>
|
||||
<y>282</y>
|
||||
<x>346</x>
|
||||
<y>498</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@ -2180,8 +2229,8 @@
|
||||
<slot>search_stretch(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>241</x>
|
||||
<y>282</y>
|
||||
<x>346</x>
|
||||
<y>498</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>566</x>
|
||||
@ -2196,12 +2245,12 @@
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>231</x>
|
||||
<y>410</y>
|
||||
<x>305</x>
|
||||
<y>657</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>337</x>
|
||||
<y>410</y>
|
||||
<x>421</x>
|
||||
<y>668</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@ -2212,12 +2261,12 @@
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>337</x>
|
||||
<y>410</y>
|
||||
<x>421</x>
|
||||
<y>668</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>231</x>
|
||||
<y>410</y>
|
||||
<x>305</x>
|
||||
<y>657</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@ -2228,8 +2277,8 @@
|
||||
<slot>slide_error(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>231</x>
|
||||
<y>410</y>
|
||||
<x>305</x>
|
||||
<y>657</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>566</x>
|
||||
@ -2244,8 +2293,8 @@
|
||||
<slot>stickyness_slot(double)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>385</x>
|
||||
<y>296</y>
|
||||
<x>421</x>
|
||||
<y>455</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>609</x>
|
||||
@ -2260,8 +2309,8 @@
|
||||
<slot>stickyness_slot(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>266</x>
|
||||
<y>296</y>
|
||||
<x>323</x>
|
||||
<y>444</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>609</x>
|
||||
@ -2276,8 +2325,8 @@
|
||||
<slot>autotune(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>531</x>
|
||||
<y>477</y>
|
||||
<x>622</x>
|
||||
<y>550</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>454</x>
|
||||
@ -2292,8 +2341,8 @@
|
||||
<slot>autotune(double)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>616</x>
|
||||
<y>477</y>
|
||||
<x>720</x>
|
||||
<y>561</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>454</x>
|
||||
@ -2308,8 +2357,8 @@
|
||||
<slot>load_session()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>535</x>
|
||||
<y>707</y>
|
||||
<x>616</x>
|
||||
<y>799</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>454</x>
|
||||
@ -2324,8 +2373,8 @@
|
||||
<slot>save_session()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>535</x>
|
||||
<y>744</y>
|
||||
<x>616</x>
|
||||
<y>851</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>454</x>
|
||||
@ -2340,8 +2389,8 @@
|
||||
<slot>stereo_mode(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>539</x>
|
||||
<y>594</y>
|
||||
<x>721</x>
|
||||
<y>717</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>454</x>
|
||||
@ -2356,8 +2405,8 @@
|
||||
<slot>algo(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>273</x>
|
||||
<y>395</y>
|
||||
<x>421</x>
|
||||
<y>560</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>454</x>
|
||||
@ -2372,8 +2421,8 @@
|
||||
<slot>target_shape(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>557</x>
|
||||
<y>233</y>
|
||||
<x>720</x>
|
||||
<y>342</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>454</x>
|
||||
@ -2388,8 +2437,8 @@
|
||||
<slot>brain_shape(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>824</x>
|
||||
<y>432</y>
|
||||
<x>1157</x>
|
||||
<y>555</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>454</x>
|
||||
@ -2404,8 +2453,8 @@
|
||||
<slot>load_sounds()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>754</x>
|
||||
<y>321</y>
|
||||
<x>1013</x>
|
||||
<y>396</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>454</x>
|
||||
@ -2420,8 +2469,8 @@
|
||||
<slot>select_all()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>813</x>
|
||||
<y>74</y>
|
||||
<x>1073</x>
|
||||
<y>124</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>454</x>
|
||||
@ -2436,8 +2485,8 @@
|
||||
<slot>select_none()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>862</x>
|
||||
<y>74</y>
|
||||
<x>1157</x>
|
||||
<y>124</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>454</x>
|
||||
@ -2452,8 +2501,8 @@
|
||||
<slot>mic(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>404</x>
|
||||
<y>601</y>
|
||||
<x>721</x>
|
||||
<y>442</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>454</x>
|
||||
@ -2461,6 +2510,22 @@
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>MainWindow</receiver>
|
||||
<slot>settings()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>680</x>
|
||||
<y>809</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>776</x>
|
||||
<y>849</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<slots>
|
||||
<slot>play_slot()</slot>
|
||||
@ -2518,5 +2583,6 @@
|
||||
<slot>select_all()</slot>
|
||||
<slot>select_none()</slot>
|
||||
<slot>mic(bool)</slot>
|
||||
<slot>settings()</slot>
|
||||
</slots>
|
||||
</ui>
|
||||
|
317
gui/settings.ui
Normal file
317
gui/settings.ui
Normal file
@ -0,0 +1,317 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SettingsDialog</class>
|
||||
<widget class="QDialog" name="SettingsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>522</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>settings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Comic Sans MS</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>device</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="deviceComboBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Comic Sans MS</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>sample rate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="samplerateLineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>44100</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Comic Sans MS</family>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>(note: this currently should probably match your sample file's input rate as no conversion is run on them - yet)</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Comic Sans MS</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>buffer size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="buffersizeComboBox">
|
||||
<property name="currentIndex">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>64</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>128</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>256</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>512</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1024</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2048</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>4096</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Comic Sans MS</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>messages</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="messagesLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Comic Sans MS</family>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 1px solid;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="applyPushButton">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Comic Sans MS</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>apply settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Comic Sans MS</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>SettingsDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>231</x>
|
||||
<y>358</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>SettingsDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>299</x>
|
||||
<y>364</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>samplerateLineEdit</sender>
|
||||
<signal>textEdited(QString)</signal>
|
||||
<receiver>SettingsDialog</receiver>
|
||||
<slot>samplerate(QString)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>270</x>
|
||||
<y>71</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>394</x>
|
||||
<y>156</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>applyPushButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>SettingsDialog</receiver>
|
||||
<slot>apply()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>112</x>
|
||||
<y>321</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>4</x>
|
||||
<y>315</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>deviceComboBox</sender>
|
||||
<signal>currentTextChanged(QString)</signal>
|
||||
<receiver>SettingsDialog</receiver>
|
||||
<slot>output_device(QString)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>323</x>
|
||||
<y>45</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>393</x>
|
||||
<y>64</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buffersizeComboBox</sender>
|
||||
<signal>currentTextChanged(QString)</signal>
|
||||
<receiver>SettingsDialog</receiver>
|
||||
<slot>buffersize(QString)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>326</x>
|
||||
<y>131</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>395</x>
|
||||
<y>208</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<slots>
|
||||
<slot>output_device(QString)</slot>
|
||||
<slot>samplerate(QString)</slot>
|
||||
<slot>buffersize(QString)</slot>
|
||||
<slot>apply()</slot>
|
||||
</slots>
|
||||
</ui>
|
@ -10,11 +10,14 @@ INCLUDEPATH += . 2
|
||||
QT += core gui widgets
|
||||
|
||||
# Input
|
||||
HEADERS += app/MainWindow.h
|
||||
HEADERS += app/MainWindow.h \
|
||||
app/SettingsDialog.h
|
||||
|
||||
FORMS += gui/samplebrain.ui
|
||||
FORMS += gui/samplebrain.ui \
|
||||
gui/settings.ui
|
||||
|
||||
SOURCES += app/MainWindow.cpp \
|
||||
app/SettingsDialog.cpp \
|
||||
app/sound_items.cpp \
|
||||
app/audio_thread.cpp \
|
||||
app/process_thread.cpp \
|
||||
|
Reference in New Issue
Block a user