Compare commits
11 Commits
e901c04e75
...
845748157f
| Author | SHA1 | Date |
|---|---|---|
|
|
845748157f | |
|
|
2a9073daa0 | |
|
|
4f6178db71 | |
|
|
ba5989539d | |
|
|
2b39aef393 | |
|
|
3234bd1557 | |
|
|
2ce3fed1e1 | |
|
|
5453d8694d | |
|
|
24088c4904 | |
|
|
c188cb744c | |
|
|
d5f608ffaf |
|
|
@ -1,3 +1 @@
|
||||||
*.*~
|
build
|
||||||
*.o
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
project(samplebrain VERSION 1.0 LANGUAGES C CXX)
|
||||||
|
|
||||||
|
include(Dependencies.cmake)
|
||||||
|
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
|
# Set up AUTOMOC and some sensible defaults for runtime execution
|
||||||
|
# When using Qt 6.3, you can replace the code block below with
|
||||||
|
# qt_standard_project_setup()
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
|
||||||
|
find_package(QT NAMES Qt5 Qt6 REQUIRED COMPONENTS Core)
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui Widgets)
|
||||||
|
|
||||||
|
qt_add_executable(samplebrain WIN32 MACOSX_BUNDLE
|
||||||
|
app/MainWindow.cpp app/MainWindow.h
|
||||||
|
app/audio_thread.cpp
|
||||||
|
app/feedback.cpp
|
||||||
|
app/process_thread.cpp
|
||||||
|
app/qtmain.cpp
|
||||||
|
app/sound_items.cpp
|
||||||
|
brain/src/aquila/filter/MelFilter.cpp
|
||||||
|
brain/src/aquila/filter/MelFilterBank.cpp
|
||||||
|
brain/src/aquila/transform/Dct.cpp
|
||||||
|
brain/src/block.cpp
|
||||||
|
brain/src/block_stream.cpp
|
||||||
|
brain/src/brain.cpp
|
||||||
|
brain/src/fft.cpp
|
||||||
|
brain/src/mfcc.cpp
|
||||||
|
brain/src/renderer.cpp
|
||||||
|
brain/src/search_params.cpp
|
||||||
|
brain/src/spiralcore/OSC_server.cpp
|
||||||
|
brain/src/spiralcore/allocator.cpp
|
||||||
|
brain/src/spiralcore/audio.cpp
|
||||||
|
brain/src/spiralcore/command_ring_buffer.cpp
|
||||||
|
brain/src/spiralcore/portaudio_client.cpp
|
||||||
|
brain/src/spiralcore/ring_buffer.cpp
|
||||||
|
brain/src/spiralcore/sample.cpp
|
||||||
|
brain/src/spiralcore/stream.cpp
|
||||||
|
brain/src/status.cpp
|
||||||
|
brain/src/window.cpp
|
||||||
|
gui/samplebrain.ui
|
||||||
|
)
|
||||||
|
target_include_directories(samplebrain PRIVATE
|
||||||
|
.
|
||||||
|
/opt/homebrew/include
|
||||||
|
/usr/local/include
|
||||||
|
2
|
||||||
|
brain/src
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(samplebrain PRIVATE
|
||||||
|
# Remove: L..
|
||||||
|
# Remove: L/opt/homebrew/lib
|
||||||
|
# Remove: L/usr/local/lib
|
||||||
|
Qt::Core
|
||||||
|
Qt::Gui
|
||||||
|
Qt::Widgets
|
||||||
|
dl
|
||||||
|
fftw3
|
||||||
|
lo_shared
|
||||||
|
m
|
||||||
|
portaudio
|
||||||
|
pthread
|
||||||
|
sndfile
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_options(samplebrain PUBLIC
|
||||||
|
-O3
|
||||||
|
-Wall
|
||||||
|
-Wno-unused
|
||||||
|
-std=c++11
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Resources:
|
||||||
|
set(samplebrain_resource_files
|
||||||
|
"app/images/at.png"
|
||||||
|
"app/images/pause.png"
|
||||||
|
"app/images/play.png"
|
||||||
|
"app/images/record.png"
|
||||||
|
"app/images/stop.png"
|
||||||
|
)
|
||||||
|
|
||||||
|
qt_add_resources(samplebrain "samplebrain"
|
||||||
|
PREFIX
|
||||||
|
"/images"
|
||||||
|
BASE
|
||||||
|
"app"
|
||||||
|
FILES
|
||||||
|
${samplebrain_resource_files}
|
||||||
|
)
|
||||||
|
|
||||||
|
install(TARGETS samplebrain
|
||||||
|
BUNDLE DESTINATION .
|
||||||
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Consider using qt_generate_deploy_app_script() for app deployment if
|
||||||
|
# the project can use Qt 6.3. In that case rerun qmake2cmake with
|
||||||
|
# --min-qt-version=6.3.
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
################################################################################
|
||||||
|
# FetchContent
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
include(FetchContent)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# fftw3
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
FetchContent_Declare(
|
||||||
|
fftw3
|
||||||
|
URL http://fftw.org/fftw-3.3.10.tar.gz
|
||||||
|
URL_HASH MD5=8ccbf6a5ea78a16dbc3e1306e234cc5c)
|
||||||
|
FetchContent_MakeAvailable(fftw3)
|
||||||
|
|
||||||
|
include_directories(${fftw3_SOURCE_DIR}/api)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# liblo
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
FetchContent_Declare(
|
||||||
|
liblo
|
||||||
|
URL http://downloads.sourceforge.net/liblo/liblo-0.31.tar.gz
|
||||||
|
URL_HASH MD5=14378c1e74c58e777fbb4fcf33ac5315)
|
||||||
|
FetchContent_MakeAvailable(liblo)
|
||||||
|
|
||||||
|
add_subdirectory(${liblo_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# PortAudio
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
FetchContent_Declare(
|
||||||
|
portaudio
|
||||||
|
URL http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz
|
||||||
|
URL_HASH MD5=ad319249932c6794b551d954b8844402)
|
||||||
|
FetchContent_MakeAvailable(portaudio)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# libsndfile
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
FetchContent_Declare(
|
||||||
|
libsndfile
|
||||||
|
GIT_REPOSITORY https://github.com/libsndfile/libsndfile
|
||||||
|
GIT_TAG 1.1.0)
|
||||||
|
FetchContent_MakeAvailable(libsndfile)
|
||||||
12
README.md
12
README.md
|
|
@ -83,9 +83,9 @@ If you'd like the right font, optionally:
|
||||||
|
|
||||||
# Building from source
|
# Building from source
|
||||||
## Linux (Ubuntu)
|
## Linux (Ubuntu)
|
||||||
Install libraries for the sample engine (use brew on mac, MinGW on win):
|
Install cmake:
|
||||||
|
|
||||||
$ sudo apt install libsndfile1-dev portaudio19-dev liblo-dev libfftw3-dev
|
$ sudo apt install cmake
|
||||||
|
|
||||||
Install dependencies for the interface:
|
Install dependencies for the interface:
|
||||||
|
|
||||||
|
|
@ -101,9 +101,9 @@ Build & run it:
|
||||||
$ samplebrain
|
$ samplebrain
|
||||||
|
|
||||||
## Mac
|
## Mac
|
||||||
Install libraries for sample engine:
|
Install cmake:
|
||||||
|
|
||||||
$ brew install fftw portaudio liblo libsndfile
|
$ brew install cmake
|
||||||
|
|
||||||
Install dependencies for the interface:
|
Install dependencies for the interface:
|
||||||
|
|
||||||
|
|
@ -114,8 +114,8 @@ Build & run it:
|
||||||
|
|
||||||
$ mkdir build
|
$ mkdir build
|
||||||
$ cd build
|
$ cd build
|
||||||
$ qmake ..
|
$ cmake ..
|
||||||
$ make
|
$ cmake --build .
|
||||||
|
|
||||||
`samplebrain.app` should then be in the app folder for you to run.
|
`samplebrain.app` should then be in the app folder for you to run.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include "ui_samplebrain.h"
|
#include "../gui/ui_samplebrain.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <lo/lo.h>
|
#include <lo/lo.h>
|
||||||
|
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
######################################################################
|
|
||||||
# Automatically generated by qmake (2.01a) Sun Jul 5 17:49:45 2015
|
|
||||||
######################################################################
|
|
||||||
|
|
||||||
TEMPLATE = app
|
|
||||||
TARGET = samplebrain
|
|
||||||
DEPENDPATH += . 2
|
|
||||||
INCLUDEPATH += . 2
|
|
||||||
|
|
||||||
QT += core gui widgets
|
|
||||||
|
|
||||||
# Input
|
|
||||||
HEADERS += app/MainWindow.h
|
|
||||||
|
|
||||||
FORMS += gui/samplebrain.ui
|
|
||||||
|
|
||||||
SOURCES += app/MainWindow.cpp \
|
|
||||||
app/sound_items.cpp \
|
|
||||||
app/audio_thread.cpp \
|
|
||||||
app/process_thread.cpp \
|
|
||||||
app/feedback.cpp \
|
|
||||||
app/qtmain.cpp \
|
|
||||||
brain/src/block.cpp \
|
|
||||||
brain/src/brain.cpp \
|
|
||||||
brain/src/fft.cpp \
|
|
||||||
brain/src/mfcc.cpp \
|
|
||||||
brain/src/renderer.cpp \
|
|
||||||
brain/src/search_params.cpp \
|
|
||||||
brain/src/status.cpp \
|
|
||||||
brain/src/window.cpp \
|
|
||||||
brain/src/block_stream.cpp \
|
|
||||||
brain/src/aquila/filter/MelFilterBank.cpp \
|
|
||||||
brain/src/aquila/filter/MelFilter.cpp \
|
|
||||||
brain/src/aquila/transform/Dct.cpp \
|
|
||||||
brain/src/spiralcore/sample.cpp \
|
|
||||||
brain/src/spiralcore/ring_buffer.cpp \
|
|
||||||
brain/src/spiralcore/command_ring_buffer.cpp \
|
|
||||||
brain/src/spiralcore/portaudio_client.cpp \
|
|
||||||
brain/src/spiralcore/audio.cpp \
|
|
||||||
brain/src/spiralcore/OSC_server.cpp \
|
|
||||||
brain/src/spiralcore/allocator.cpp \
|
|
||||||
brain/src/spiralcore/stream.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
|
|
||||||
|
|
||||||
QMAKE_CXXFLAGS += -O3 -Wall -Wno-unused -std=c++11
|
|
||||||
|
|
||||||
# assets
|
|
||||||
RESOURCES = app/samplebrain.qrc
|
|
||||||
ICON = desktop/samplebrain.icns
|
|
||||||
|
|
||||||
PREFIX = $$(PREFIX)
|
|
||||||
isEmpty(PREFIX) {
|
|
||||||
PREFIX = /usr
|
|
||||||
}
|
|
||||||
|
|
||||||
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 metainfofile
|
|
||||||
Loading…
Reference in New Issue