GithubHelp home page GithubHelp logo

danfrz / plebtracker Goto Github PK

View Code? Open in Web Editor NEW
132.0 7.0 5.0 43 MB

Ncurses based audio tracker program inspired by goattracker and milkytracker

License: MIT License

C++ 94.12% C 1.64% Makefile 0.42% Shell 0.78% Roff 3.03%
tracker audio synthesizer chiptune music composition terminal-based linux

plebtracker's Introduction

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.

plebtracker's People

Contributors

danfrz avatar konsumer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

plebtracker's Issues

New Logo

Hello sir.
You have a great app, unfortunately this app does not have a logo yet, may I donate a logo for your app?

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:

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

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?

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.

Update documentation

Write documentation for pulse table,
Remove documentation for functions moved from wave table

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.

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.

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.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.