Skip to content

Latest commit

 

History

History
132 lines (100 loc) · 4.43 KB

readme.md

File metadata and controls

132 lines (100 loc) · 4.43 KB

CTAG-TBD Simulator

Useful for plugin development without the need to use hardware module.

Usage

After ./tbd-sim command is executed, a local web server is running on port 8080. Simply open a browser and enter [http://localhost:8080]. You will land on exactly the same web UI used by the hardware module. CV, Pot and Trig simulation is possible by adjusting settings on the URL [http://localhost:8080/ctrl]. You can use a .wav file (stereo float32) using the -w option if you want to simulate the audio input instead of using the real-time data of the sound card. You can use the -s option to specify your own sample-rom file (e.g. exported through the module's web ui). The simulator uses 99% the same code as the hardware unit. Only difference is the plugin manager and the web server part. You can start developing your plugins just like you do for the hardware module, same directory and file structures. You can run your plugin prior to flashing it to the hardware on your local host. Once the plugin is stable, you build and flash your project for the real hardware. The simulator greatly speeds up plugin development.

Command line options

-h [ --help ] this help message
-s [ --srom ] file for sample rom emulation, default ../../sample_rom/sample-rom.tbd
-l [ --list ] list sound cards
-d [ --device ] sound card device id, default 0
-o [ --output ] use output only (if no duplex device available)
-w [ --wav ] read audio in from wav file (arg), must be 2 channel stereo float32 data, will be cycled through indefinitely

Requirements

Full duplex sound card running at 44100Hz sampling rate and 32-bit float sampling. Adaptations can be made in the code, RTAudio will open the first available device with such capabilities.

Cloud build

You can use a Github action to build binaries for windows + mac. For this make sure GitHub Actions are activated for your fork by going to the corresponding tab at your fork and clicking on the green button. You can customize the actions in the .github/workflows folder to suit your needs.

Local build

Dependencies

  • Boost Asio, FileSystem, Thread, ProgramOptions
  • RTAudio
  • Simple-Web-Server (by C. Eidheim)
  • CMake Version 3.16 or higher

Installation instructions for the dependencies needed to compile the simulator on a selection of platforms can be seen below.

Debian based distributions

sudo apt-get install libboost-filesystem-dev libboost-thread-dev libboost-program-options-dev libasound2-dev

Arch Linux based distributions

sudo pacman -S boost

MacOS

brew install boost

Windows

Approach 1 (64bit)

Install msys2.org and launch the MinGW 64-bit shell from the Start menu, not the default MSYS shell. Update the package manager itself:

pacman -Syu

Then restart the shell and install packages:

pacman -Su git mingw-w64-x86_64-make mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libtool mingw-w64-x86_64-jq mingw-w64-x86_64-boost

When running cmake use:

cmake -G "MinGW Makefiles" ..

instead of just using "cmake .." as written below.

To make run:

mingw32-make

Approach 2 (32bit)

Clone with complete CTAG-TBD source repository

git clone https://github.com/ctag-fh-kiel/ctag-tbd.git
cd ctag-tbd
git submodule update --init --recursive

Compile and run

Compile with a C++17 compliant compiler:

cd simulator (from ctag-tbd folder)
mkdir build
cd build
cmake ..
make
./tbd-sim

Limitations

  • General module configuration not supported

Credits