Ncurses based audio tracker program inspired by goattracker and milkytracker

PLEBTracker

PLEBTracker is a linux console based audio tracker program inspired by goattracker and milkytracker. ScreenShot

Pattern editor, main song editor window

On the right are the Wave, Pulse, and Filter tables. (described in docs/manual.txt). The sound an instrument makes is determined by the indicies it points to in these tables.

  • The WAVE table determines the waveform used for the instrument.
  • The PULSE table determines pulse width modulation (described in docs/wavetable.pdf and docs/manual.txt) of waveforms that use pulse width modulation.
  • The FILTER table allows tracks to filter out certain frequencies (described in docs/manual.txt) .

ScreenShot

Instrument Editor, with volume envelope visualization. The Volume table on the left determines the shape of the envelope

PLEBTracker is something I wrote because I wanted to have some experience with audio, and wanted to implement what I've been learning by using other trackers and studying music theory with the help of my piano teacher.

With this program, like other trackers, you can compose music (.plb modules) and listen to them. All of the sounds produced in this tracker are synthesized, meaning there are no samples.

If anyone is having trouble installing or compiling I'd be happy to hear about it! Make an issue or email me.

Requirements

In order to run and build PLEBTracker the following programs and libraries are required. program/library... (package... )

On Arch and Debian (at least) these packages are sufficient to get it working

  • ncurses (ncurses)
  • fftw3 (fftw)
  • aplay (alsa-utils)
  • inotifywait (inotify-tools)
  • sudo (sudo)

Some distributions may not have these exact package names but these names should work for at least Archlinux and Debian.

Right now, to get this working on ubuntu 16.04 (and probably variants?) you need

  • inotifywait (inotify-tools)
  • ncurses (libncursesw5 and libncursesw5-dev)
  • fftw3 (libfftw3 and libfftw3-dev)

(sudo and aplay are already installed, or were when I tested them)

Unfortunately, when libncursesw5 is installed on ubuntu, the headers are placed within /usr/include/ncursesw/, therefore each of the header files within Tracker/include/ and Tracker/src/main.cpp need to be modified so that

#include <ncurses.h>

becomes

#include <ncursesw/ncurses.h>

and in the Tracker/src/Makefile change the LIBS line so that

LIBS=-lncurses

becomes

LIBS=-lncursesw

Sorry about this badness, hopefully in a future (or current?) version of Ubuntu get_wch will be included within regular (ncurses.h)

Installation

Clone this project from git

git clone https://github.com/danfrz/PLEBTracker

cd to ./Tracker/src then as your user (not root) run

make ; ./INSTALL.sh;

cd to ./Interpreter/src

make ; ./INSTALL.sh;

Usage

To open a song within the tracker, the easiest way is from the commandline:

   plebtrk song.plb

To simply play a song without openning the tracker run:

   plebplay song.plb [OPTIONS...]

To render a song directly to flac run:

   plebrender song.plb [OPTIONS...]

And probably not a very popular option but to have the raw byte data go directly to stdout instead of aplay run:

   plebitp song.plb [OPTIONS...] 2>/dev/null

Example songs can be found in ./examples and their respective flac renderings in ./examples/render.

All of the programs that are installed have manual pages with important information on using the tracker. Most importantly, see the plebtrk manual page.

The most efficient and effective way to perform actions in the tracker's interface is by using the vim-like command bar, which is shown by pressing ':'. Those commands and other binds can be reviewed on the plebtrk man page.

If you're interested, look through the docs folder, the manual provides a good introduction to the tracker (I hope) and wavetable.pdf details what synths/wave generators have been implemented so far. patternedtr.pdf has information on the effects that are available in the pattern editor as well as going over some of its' quirks.

Custom Chromatic Scales

It is now possible to compile PLEBTracker to use arbitrary chromatic scales with the change of just two preprocessor directives! (so long as the notes you want in the scale are exponentially interpolated between octaves, not arbitrary.) The notes in the chromatic scale is 12 by default (C C# D D# E F F# G G# A A# B) this can be changed in Common/include/pattern.h Only values between 0 and 16 will work due to space restrictions of the module file. Change CHROMATIC_NOTES to 0 to 16, change NOTEMULT to the CHROMATIC_NOTES root of 2, e.g. if CHROMATIC_NOTES is 12, NOTEMULT = the twelvth root of two. The interface will automatically bind your new scale to the keys on your keyboard. Chromatic scales that aren't 12 or 16 are assigned letters starting from A and on, but placing C as the lowest in the octave regardless of scale.

Comments
  • Verify that hybrid pulse and pulse2 waveforms do what they should

    Verify that hybrid pulse and pulse2 waveforms do what they should

    When I wrote some of them I wasn't really focussed on making them work perfectly, I was mostly focussing on perfecting Pulse1. Pulse2 and Hybrid were afterthoughts so their output should be verified.

    Confirmed not working:

    • [x] 08 - Pulse Saw (only has down-trough). Fixed
    • [x] 0C / 0D Not really implemented, substitute with something else later
    • [x] ~~0E~~ 06 - Square Pulse ~~2~~ (REALLY Broken). Fixed
    • [x] 0F - Square Pulse Hybrid (Doesn't work because 0E doesn't). Fixed
    • [x] 14 - ~~Triangle Pulse 2~~ (doesn't work as intended; is identical to 07). Removed
    • [x] 15 - ~~Triangle Pulse Hybrid~~ (Doesn't work because 14 doesn't). Removed
    • [x] 16 - Sine Pulse 2 (doesn't work as intended; is identical to 09). Fixed
    • [x] 17 - Sine Pulse Hybrid (Doesn't work because 16 doesn't). Fixed
    • [x] 18 - Half-Sine (broken, keeps resetting phase mid-waveform). Fixed
    • [x] 1A - N Sine W (broken, keeps resetting phase mid-waveform Only when wave param > 1). Fixed
    • [x] 1C N Sine Pulse 2 (doesn't work as intended; is identical to 1B). Fixed
    • [x] 1D N Sine Pulse Hybrid (Doesn't work because 1C doesn't). Fixed
    • [x] 1E N Half-Sine (broken, keeps resetting phase mid-waveform)
  • Sometimes pulse effects aren't applied [plebitp]

    Sometimes pulse effects aren't applied [plebitp]

    There's a bug with plebitp where pulse effects will not work properly sometimes. I've noticed it only happens in certain instruments and when it does happen, it happens 50% of the times you play the same segment of the song, which strongly suggests some sort of uninitialized malarkey. This was happening even before the pulse table was introduced.

  • Click on beginning playback

    Click on beginning playback

    There is a short click sound on the beginning of song playback, after the pulse table was implemented. The click isn't present for the duration of a whole row segment so it's an artifact, doesn't seem to change when pulse parameters change so may not be directly related.

  • Docker

    Docker

    Basic docker support.

    This could probly be lightened up quite a bit (I am no arch expert, so not sure how to delete all the package caches and stuff.)

    Still needs to be published to make it super-easy, but you can test with this:

    docker build -t plebtracker .
    docker run -it plebtracker
    
  • Revise audio filtering: Use window functions

    Revise audio filtering: Use window functions

    Use a window function before filtering, that should make filtering actually sound reasonable I hope.

    Also, this turns out to be the proper solution to the problem, not adding more song data to the buffer of the filter operating. As a side note, keep the buffer larger than input data and power of 2n, but instead of copying song data in there, have zeroes. Apparently that can make filtering sound better.

    This makes the fourier_buffer_size byte within songs unnecessary. Also, may end up making window_type option for tracks, set by a function within the filter table.

  • Refactor how patterns are rendered to enable track-based filtering

    Refactor how patterns are rendered to enable track-based filtering

    renderPattern should use different buffers for each renderTick call. Then filters can be performed within those renderTick call. Finally renderPattern would mix all of the filtered buffers together.

  • Panning

    Panning

    When I started the project I underestimated the value of stereo in music. When I get to live interpretation in the tracker (using OpenAL?) I should also add panning. These both will involve a number of infrastructural changes.

    Goattrk uses a table for panning, and I think you can do some pretty cool stuff with that.

    However there are so many tables visible all the time that you can barely see your composition within 80 character lines, and that's a use case I'd like to support.

    Proposal: have filter and pan tables always hidden and provide a modifier key that when pressed displays pan and filter tables in place of the wave and pulse tables.

  • cmdbar.cpp:150:16: error: 'get_wch' was not declared in this scope

    cmdbar.cpp:150:16: error: 'get_wch' was not declared in this scope

    I am trying to add a Dockerfile to this project, to ease installation (you can try it out by just installing docker)

    I am having trouble getting it to run with this Dockerfile:

    FROM alpine:3.7
    
    COPY . /usr/local/plebtrk
    WORKDIR /usr/local/plebtrk
    
    RUN apk add --no-cache alpine-sdk ncurses-dev fftw-dev alsa-utils inotify-tools
    RUN cd ./Tracker/src && make && ./INSTALL.sh && cd ../../Interpreter/src && make && ./INSTALL.sh
    
    ENTRYPOINT ["plebtrk"]
    
    docker build .
    
    Sending build context to Docker daemon  58.77MB
    Step 1/6 : FROM alpine:3.7
     ---> 3fd9065eaf02
    Step 2/6 : COPY . /usr/local/plebtrk
     ---> Using cache
     ---> e456797f511b
    Step 3/6 : WORKDIR /usr/local/plebtrk
     ---> Using cache
     ---> bf0c1788b56e
    Step 4/6 : RUN apk add --no-cache alpine-sdk ncurses-dev fftw-dev alsa-utils inotify-tools
     ---> Using cache
     ---> e9ba090f6443
    Step 5/6 : RUN cd ./Tracker/src && make && ./INSTALL.sh && cd ../../Interpreter/src && make && ./INSTALL.sh
     ---> Running in d5036bb0b085
    g++ -c -o ../obj/cmdbar.o cmdbar.cpp -std=c++11 -I../include
    cmdbar.cpp: In function 'bool editor::getCommand(const char*)':
    cmdbar.cpp:150:16: error: 'get_wch' was not declared in this scope
         get_wch(&in);
                    ^
    make: *** [Makefile:23: ../obj/cmdbar.o] Error 1
    The command '/bin/sh -c cd ./Tracker/src && make && ./INSTALL.sh && cd ../../Interpreter/src && make && ./INSTALL.sh' returned a non-zero code: 2
    

    do I need to install ncurses differently in alpine, maybe?

  • Refactor

    Refactor "BYT/SEG"

    Bytes Per Row is exactly what the number is, "bytes" is vague.

    Hold on. It's only bytes per row for 8 bit implementation. Shouldn't it be samples per row?

    Regardless. Refactor this.

PortAudio is a portable audio I/O library designed for cross-platform support of audio

PortAudio is a cross-platform, open-source C language library for real-time audio input and output.

Sep 27, 2022
The latest and greatest version of my Gameboy Audio Player program!

GBAudioPlayerV3 Version 3.0 of the incredible Gameboy Audio Player, rebuilt from the ground up in C as a command line program, along with heavily impr

Jul 30, 2022
A command line and keyboard based strategy-game written in c++, where audio-input determines the AI-strategy and lays the seed for the map-generation.
A command line and keyboard based strategy-game written in c++, where audio-input determines the AI-strategy and lays the seed for the map-generation.

Table of contents Dissonance Premise Installation Requirements Installation Quick-guide Detailed installation guide Usage Logfiles Tests Uninstall Kno

Sep 19, 2022
A simple and easy-to-use audio library based on miniaudio

raudio A simple and easy-to-use audio library based on miniaudio raudio forks from raylib.audio module to become an standalone library. Actually, it w

Sep 29, 2022
Open source digital sound effects based on JACK audio connection kit.

Noiseworks Digital Audio Effects Repository Open source digital sound effects based on JACK audio connection kit. This repository is intended to provi

Jul 29, 2022
Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. 🎤

Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. ??

Sep 28, 2022
Twist A node-based audio synthesizer written in C++
Twist A node-based audio synthesizer written in C++

Not maintained anymore! Twist A node-based audio synthesizer written in C++ Twist is the unexpected result of me trying to experiment with audio progr

Aug 29, 2022
LabSound is a C++ graph-based audio engine
LabSound is a C++ graph-based audio engine

LabSound is a C++ graph-based audio engine. LabSound originated as a fork of WebKit's WebAudio implementation, as used in Google's Chrome and Apple's Safari.

Sep 26, 2022
Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems
Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems

Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. Audacity is open source software licensed under GPL, version 2 or later.

Sep 26, 2022
Sneedacity (formerly Audacity) is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems.
Sneedacity (formerly Audacity) is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems.

Sneedacity (formerly Audacity) is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. Sneedacity is open source software licensed under GPL, version 2 or later.

Sep 25, 2022
C++ library for audio and music analysis, description and synthesis, including Python bindings

Essentia Essentia is an open-source C++ library for audio analysis and audio-based music information retrieval released under the Affero GPL license.

Sep 29, 2022
JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins.
JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins.

JUCE is an open-source cross-platform C++ application framework for creating high quality desktop and mobile applications, including VST, VST3, AU, AU

Sep 28, 2022
A simple C++ library for reading and writing audio files.

AudioFile A simple header-only C++ library for reading and writing audio files. Current supported formats: WAV AIFF Author AudioFile is written and ma

Sep 30, 2022
A C library for reading and writing sound files containing sampled audio data.

libsndfile libsndfile is a C library for reading and writing files containing sampled audio data. Authors The libsndfile project was originally develo

Sep 28, 2022
C library for cross-platform real-time audio input and output

libsoundio C library providing cross-platform audio input and output. The API is suitable for real-time software such as digital audio workstations as

Oct 3, 2022
C++ Audio and Music DSP Library

_____ _____ ___ __ _ _____ __ __ __ ____ ____ / \\_ \\ \/ / |/ \| | | | \_ \/ \ | Y Y \/ /_ \> <| | Y Y \ | |_|

Sep 24, 2022
Single file audio playback and capture library written in C.
Single file audio playback and capture library written in C.

A single file library for audio playback and capture. Example - Documentation - Supported Platforms - Backends - Major Features - Building - Unofficia

Oct 2, 2022
Easy and efficient audio synthesis in C++

Tonic Fast and easy audio synthesis in C++. Prefer coding to patching? Love clean syntax? Care about performance? That's how we feel too, and why we m

Sep 8, 2022
simple audio mixer for native and web

?? auph ?? Trivial audio mixer API for native and web targets. Online Demo ⚠️ Work in progress! API is constantly changing. The native playback at the

Jul 1, 2022