Compare commits
10 Commits
d9ea969af2
...
58f9f49c10
| Author | SHA1 | Date |
|---|---|---|
|
|
58f9f49c10 | |
|
|
e3619746a4 | |
|
|
74eb5b0b9b | |
|
|
287ba85c14 | |
|
|
a7b866b4fc | |
|
|
7bda8195c9 | |
|
|
dc0c047ad6 | |
|
|
672fb1868f | |
|
|
30d93be49c | |
|
|
8aa0dee3d1 |
|
|
@ -157,3 +157,6 @@ 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.
|
||||
|
|
|
|||
|
|
@ -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,42 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>org.thentrythis.Samplebrain</id>
|
||||
|
||||
<name>Samplebrain</name>
|
||||
<summary>A custom sample mashing app designed by Aphex Twin</summary>
|
||||
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-2.0-only</project_license>
|
||||
|
||||
<description>
|
||||
<p>
|
||||
Samplebrain chops samples up into a 'brain' of interconnected small sections called blocks which are connected into a network by similarity. It processes a target sample, chopping it up into blocks in the same way, and tries to match each block with one in it's brain to play in realtime.
|
||||
</p>
|
||||
<p>
|
||||
This allows you to interpret a sound with a different one. As we worked on it (during 2015 and 2016) we gradually added more and more tweakable parameters until it became slightly out of control.
|
||||
</p>
|
||||
</description>
|
||||
|
||||
<launchable type="desktop-id">samplebrain.desktop</launchable>
|
||||
|
||||
<categories>
|
||||
<category>AudioVideo</category>
|
||||
<category>Music</category>
|
||||
</categories>
|
||||
|
||||
<content_rating type="oars-1.0"></content_rating>
|
||||
|
||||
<url type="homepage">https://thentrythis.org/projects/samplebrain/</url>
|
||||
<url type="bugtracker">https://gitlab.com/then-try-this/samplebrain/-/issues</url>
|
||||
<url type="vcs-browser">https://gitlab.com/then-try-this/samplebrain</url>
|
||||
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image type="source" width="1280" height="720">https://gitlab.com/then-try-this/samplebrain/-/raw/main/desktop/screenshots/01-main-with-project.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
|
||||
<releases>
|
||||
<release version="0.18" date="2022-09-22"/>
|
||||
</releases>
|
||||
</component>
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Application
|
||||
Name=Samplebrain
|
||||
Comment=A sample masher designed by Aphex Twin
|
||||
Exec=samplebrain
|
||||
Comment=A custom sample mashing app designed by Aphex Twin
|
||||
Icon=samplebrain
|
||||
Terminal=false
|
||||
Categories=GNOME;Application;
|
||||
StartupNotify=true
|
||||
Exec=samplebrain
|
||||
Categories=AudioVideo;Music
|
||||
StartupNotify=true
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Version=1.0
|
||||
Name=Samplebrain
|
||||
GenericName="Samplebrain"
|
||||
Exec=samplebrain
|
||||
Icon=samplebrain
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 113 KiB |
|
|
@ -44,9 +44,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
|
||||
|
|
@ -61,6 +61,8 @@ unix:desktopfile.path = $$PREFIX/share/applications/
|
|||
unix:desktopfile.files = desktop/samplebrain.desktop
|
||||
unix:iconfile.path = $$PREFIX/share/icons/hicolor/scalable/apps
|
||||
unix:iconfile.files = desktop/samplebrain.svg
|
||||
unix:metainfofile.path = $$PREFIX/share/metainfo
|
||||
unix:metainfofile.files = desktop/org.thentrythis.Samplebrain.metainfo.xml
|
||||
|
||||
target.path = $$PREFIX/bin
|
||||
INSTALLS += target desktopfile iconfile
|
||||
INSTALLS += target desktopfile iconfile metainfofile
|
||||
|
|
|
|||
Loading…
Reference in New Issue