Compare commits
10 Commits
2cb064696d
...
e98980d06d
| Author | SHA1 | Date |
|---|---|---|
|
|
e98980d06d | |
|
|
ac83efce3b | |
|
|
7b41c94610 | |
|
|
07ea3e63ef | |
|
|
182baa59c3 | |
|
|
ed0cf2eaac | |
|
|
a9755b3f72 | |
|
|
a30779b759 | |
|
|
1c912d3977 | |
|
|
8aa0dee3d1 |
129
README.md
129
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,23 +23,17 @@ 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
|
||||
|
|
@ -47,19 +41,24 @@ 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.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)
|
||||
* **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)
|
||||
|
||||
(New 0.18.3 release fixes loading samples from paths longer than 255 characters)
|
||||
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)
|
||||
|
||||
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".
|
||||
|
||||
Thank you to [Nik Gaffney](http://fo.am) for help with the Apple builds
|
||||
Thank you to [Nik Gaffney](http://fo.am) for help with the Apple
|
||||
builds.
|
||||
|
||||
### Linux
|
||||
# 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
|
||||
|
|
@ -71,98 +70,12 @@ If you'd like the right font, optionally:
|
|||
|
||||
$ sudo apt install ttf-mscorefonts-installer
|
||||
|
||||
# Old/broken/spurious binaries
|
||||
|
||||
* **Windows**: [samplebrain_0.18.2_win.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18.2_win.zip)
|
||||
* **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/m1)**: [samplebrain_0.18.1_macintel.zip](https://static.thentrythis.org/samplebrain/samplebrain_0.18.1_macintel.app.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
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <sndfile.h>
|
||||
#include <float.h>
|
||||
#include <spiralcore/audio.h>
|
||||
|
|
@ -242,10 +243,12 @@ void brain::build_synapses_thresh(search_params ¶ms, double thresh) {
|
|||
m_average_error = calc_average_diff(params)*thresh;
|
||||
double err = m_average_error*thresh;
|
||||
u32 brain_size = m_blocks.size();
|
||||
u32 outer_index = 0;
|
||||
for (auto &i : m_blocks) {
|
||||
std::atomic<u32> progress{0};
|
||||
#pragma omp parallel for
|
||||
for (u32 outer_index = 0; outer_index < brain_size; ++outer_index) {
|
||||
auto &i = m_blocks[outer_index];
|
||||
u32 index = 0;
|
||||
status::update("building synapses %d%%",(int)(outer_index/(float)brain_size*100));
|
||||
status::update("building synapses %d%%",(int)(progress/(float)brain_size*100));
|
||||
for (auto &j : m_blocks) {
|
||||
if (index!=outer_index) {
|
||||
// collect connections that are under threshold in closeness
|
||||
|
|
@ -256,30 +259,32 @@ void brain::build_synapses_thresh(search_params ¶ms, double thresh) {
|
|||
}
|
||||
++index;
|
||||
}
|
||||
++outer_index;
|
||||
++progress;
|
||||
}
|
||||
}
|
||||
|
||||
void brain::build_synapses_fixed(search_params ¶ms) {
|
||||
//m_average_error = calc_average_diff(params)*thresh;
|
||||
u32 brain_size = m_blocks.size();
|
||||
u32 outer_index = 0;
|
||||
u32 num_synapses = NUM_FIXED_SYNAPSES;
|
||||
if (num_synapses>=m_blocks.size()) num_synapses=m_blocks.size()-1;
|
||||
|
||||
// need to stop the progress updates flooding osc
|
||||
u32 update_period = 100;
|
||||
u32 update_tick = 0;
|
||||
|
||||
for (auto &i:m_blocks) {
|
||||
std::atomic<u32> update_tick{0};
|
||||
std::atomic<u32> progress{0};
|
||||
#pragma omp parallel for
|
||||
for (u32 outer_index = 0; outer_index < brain_size; ++outer_index) {
|
||||
auto &i = m_blocks[outer_index];
|
||||
if (update_tick>update_period) {
|
||||
status::update("building synapses %d%%",(int)(outer_index/(float)brain_size*100));
|
||||
status::update("building synapses %d%%",(int)(progress/(float)brain_size*100));
|
||||
update_tick=0;
|
||||
}
|
||||
update_tick++;
|
||||
|
||||
u32 index = 0;
|
||||
vector<pair<u32,double>> collect;
|
||||
collect.reserve(brain_size);
|
||||
|
||||
// collect comparisons to all other blocks
|
||||
for (auto &j:m_blocks) {
|
||||
|
|
@ -304,7 +309,7 @@ void brain::build_synapses_fixed(search_params ¶ms) {
|
|||
i.get_synapse().push_back(collect[n].first);
|
||||
}
|
||||
|
||||
++outer_index;
|
||||
++progress;
|
||||
}
|
||||
status::update("Done: %d synapses grown for %d blocks",num_synapses*brain_size,brain_size);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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)
|
||||
|
|
@ -47,9 +47,9 @@ SOURCES += app/MainWindow.cpp \
|
|||
INCLUDEPATH += brain/src
|
||||
INCLUDEPATH += /usr/local/include
|
||||
INCLUDEPATH += /opt/homebrew/include
|
||||
LIBS += -L.. -L/usr/local/lib -L/opt/homebrew/lib -lportaudio -lfftw3 -lsndfile -llo -ldl -lpthread -lm
|
||||
LIBS += -L.. -L/usr/local/lib -L/opt/homebrew/lib -lportaudio -lfftw3 -lsndfile -llo -ldl -lpthread -lm -fopenmp
|
||||
|
||||
QMAKE_CXXFLAGS += -O3 -Wall -Wno-unused -std=c++11
|
||||
QMAKE_CXXFLAGS += -O3 -fopenmp -Wall -Wno-unused -std=c++11
|
||||
|
||||
# assets
|
||||
RESOURCES = app/samplebrain.qrc
|
||||
|
|
|
|||
Loading…
Reference in New Issue