Giter VIP home page Giter VIP logo

dirt's Introduction

An unimpressive thingie for playing bits of samples with some level of accuracy.

(c) Alex McLean and contributors, 2016 Released under the GNU Public Licence version 3

Linux installation

Here's how to install dirt under Debian, Ubuntu or a similar distribution:

sudo apt-get install build-essential libsndfile1-dev libsamplerate0-dev \
                     liblo-dev libjack-jackd2-dev qjackctl jackd git
git clone --recursive https://github.com/tidalcycles/Dirt.git
cd Dirt
make clean; make

Starting Dirt under Linux

First of all, start the "jack" audio layer. The easier way to do this is with the "qjackctl" app, which you should find in your program menus under "Sound & Video" or similar. If you have trouble with qjackctl, you can also try starting jack directly from the commandline:

jackd -d alsa &

If that doesn't work, you might well have something called "pulseaudio" in control of your sound. In that case, this should work:

/usr/bin/pasuspender -- jackd -d alsa &

And finally you should be able to start dirt with this:

cd ~/Dirt
./dirt &

If you have problems with jack, try enabling realtime audio, and adjusting the settings by installing and using the "qjackctl" software. Some more info can be found in the Ubuntu Community page for JACK configuration

MacOS installation

Installing Dirt's dependencies on Mac OS X can be done via homebrew or MacPorts, but choose only one to avoid conflicts with duplicate system libraries.

Unless otherwise specified, the below commands should be typed or pasted into a terminal window.

Installing dependencies via Homebrew

Homebrew is a package manager for OS X. It lives side by side with the native libraries and tools that ship with the operating system.

To install homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Initialise homebrew:

brew doctor

Install Dirt, a synth (well, more of a sampler) made to work with Tidal. A homebrew 'recipe' for dirt does exist, but that doesn't come with any sounds to play with, so for now it's probably easiest just download it all from github and compile it as follows.

Install some libraries which the Dirt synth needs to compile:

brew install liblo libsndfile libsamplerate

Install the 'jack audio connection kit' which Dirt also needs:

brew install jack

If Homebrew's installation of Jack fails with a make error, you can use the JackOSX Installer instead. This will, however, add an additional step when installing Dirt (see below).

Alternative: Installing dependencies via Mac Ports

MacPorts is another package manager for OS X.

If you already installed dependencies via homebrew, skip ahead to build Dirt.
Otherwise if you happen to already use MacPorts, here's a list of steps in order to get all dependencies:

sudo port install liblo libsndfile libsamplerate

Download and install jack2 Jack Download Page. Jack 2 has better OS X integration Jack Comparison.

Building Dirt from source

Get the source code for the Dirt synth:

cd ~
git clone --recursive https://github.com/tidalcycles/Dirt.git

Compile dirt:

cd ~/Dirt
make clean; make

If Dirt fails to compile after using the JackOSX installer as above, you may need to add flags to the Makefile to specify the appropriate paths:

CFLAGS += -g -I/usr/local/include -Wall -O3 -std=gnu99 -DCHANNELS=2
LDFLAGS += -lm -L/usr/local/lib -llo -lsndfile -lsamplerate -ljack

Homebrew users

As MacPorts installs all libs on /opt/local/ edit the Makefile to point the right direction of libsndfile and libsamplerate

CFLAGS += -g -I/opt/local/include -Wall -O3 -std=gnu99
LDFLAGS += -lm -L/opt/local/lib  -llo -lsndfile -lsamplerate

Starting Dirt under MacOS

To start Dirt, back in a terminal window, first start jack:

jackd -d coreaudio &

Or, if you downloaded Jack 2, then start the JackPilot at: /Applications/Jack/JackPilot.app

Click start button.

Then start dirt:

cd ~/Dirt
./dirt &

Windows installation

Cygwin

First, install Cygwin. In Cygwin, make sure the following packages are installed:

git
gcc-core
make
gcc-g++
libsndfile
libsndfile-devel
libsamplerate
libsamplerate-devel

Portaudio

Download Portaudio from http://www.portaudio.com. In Cygwin, Unpack the download with tar fxvz. After unpacking, from Cygwin, go to the directory where you unpacked Portaudio and then run:

./configure && make && make install

Liblo

Download Liblo. In Cygwin, unpack Liblo with tar fxvz, then in Cygwin go to the directory where you unpacked Liblo and then run:

./configure && make && make install

Dirt

In Cygwin:

git clone --recursive http://github.com/tidalcycles/Dirt.git

Then:

cd Dirt
make dirt-pa

Then you get a dirt-pa.exe that works. Maybe this even works on any windows system without having to compile. You'd need cygwin1.dll at least though.

dirt's People

Contributors

beatrichartz avatar bwagner avatar dktr0 avatar lennart avatar munshkr avatar rumblesan avatar trofi avatar yaxu 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

Watchers

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

dirt's Issues

server.c:5:19: fatal error: lo/lo.h: No such file or directory

$ make clean; make                                               
rm -f *.o *~ dirt dirt-analyse
gcc -g -I/usr/local/include -Wall -O3 -std=gnu99 -DJACK   -c -o dirt.o dirt.c
gcc -g -I/usr/local/include -Wall -O3 -std=gnu99 -DJACK   -c -o common.o common.c
gcc -g -I/usr/local/include -Wall -O3 -std=gnu99 -DJACK   -c -o jack.o jack.c
gcc -g -I/usr/local/include -Wall -O3 -std=gnu99 -DJACK   -c -o audio.o audio.c
gcc -g -I/usr/local/include -Wall -O3 -std=gnu99 -DJACK   -c -o file.o file.c
gcc -g -I/usr/local/include -Wall -O3 -std=gnu99 -DJACK   -c -o server.o server.c
server.c:5:19: fatal error: lo/lo.h: No such file or directory
 #include <lo/lo.h>
                   ^
compilation terminated.
make: *** [server.o] Error 1

Build dirt binary for windows

Either using visual studio or something like that, or with cygwin and distributing with the cygwin dll.

Both 32 bit and 64 bit would be ideal.

add dirt/samples directory to path

I got some errors about dirt not being able to find samples/bd and samples/sn.
Now I'm starting it like this:

pushd ~/dirt; ./dirt&
popd

It would be nice if dirt could find its own samples directory regardless from where it was started.

Tagged releases?

I just added Dirt to OS X package manager homebrew (pull request here: Homebrew/legacy-homebrew#24707), in order to make for easier installation along with jack, liblo, libsndfile, libsamplerate etc.

Although technically a brew formula can link to a specific commit (as in the PR linked above), a tagged version is much preferred. Would it be possible for you to tag releases in this repo every now and then?

Safety limit for gain

gain should now be limited to < 2 in the synth, and then added to overgain for full control.

incompatible function pointer types build failure

Seeing some build failures with clang 15

clang -O3 -g -I/usr/local/include -I/opt/local/include -Wall -std=gnu99 -DDEBUG -DHACK -DJACK -DSCALEPAN   -c -o dirt.o dirt.c
clang -O3 -g -I/usr/local/include -I/opt/local/include -Wall -std=gnu99 -DDEBUG -DHACK -DJACK -DSCALEPAN   -c -o common.o common.c
clang -O3 -g -I/usr/local/include -I/opt/local/include -Wall -std=gnu99 -DDEBUG -DHACK -DJACK -DSCALEPAN   -c -o audio.o audio.c
clang -O3 -g -I/usr/local/include -I/opt/local/include -Wall -std=gnu99 -DDEBUG -DHACK -DJACK -DSCALEPAN   -c -o file.o file.c
clang -O3 -g -I/usr/local/include -I/opt/local/include -Wall -std=gnu99 -DDEBUG -DHACK -DJACK -DSCALEPAN   -c -o server.o server.c
clang -O3 -g -I/usr/local/include -I/opt/local/include -Wall -std=gnu99 -DDEBUG -DHACK -DJACK -DSCALEPAN   -c -o jobqueue.o jobqueue.c
clang -O3 -g -I/usr/local/include -I/opt/local/include -Wall -std=gnu99 -DDEBUG -DHACK -DJACK -DSCALEPAN   -c -o thpool.o thpool.c
clang -O3 -g -I/usr/local/include -I/opt/local/include -Wall -std=gnu99 -DDEBUG -DHACK -DJACK -DSCALEPAN   -c -o jack.o jack.c
server.c:244:50: error: incompatible function pointer types passing 'int (const char *, const char *, lo_arg **, int, void *, void *)' to parameter of type 'lo_method_handler' (aka 'int (*)(const char *, const char *, lo_arg **, int, struct lo_message_ *, void *)') [-Wincompatible-function-pointer-types]
  lo_server_thread_add_method(st, "/play", NULL, play_handler, NULL);
                                                 ^~~~~~~~~~~~
/opt/homebrew/include/lo/lo_serverthread.h:151:72: note: passing argument to parameter 'h' here
                               const char *typespec, lo_method_handler h,
                                                                       ^
server.c:246:47: error: incompatible function pointer types passing 'int (const char *, const char *, lo_arg **, int, void *, void *)' to parameter of type 'lo_method_handler' (aka 'int (*)(const char *, const char *, lo_arg **, int, struct lo_message_ *, void *)') [-Wincompatible-function-pointer-types]
  lo_server_thread_add_method(st, NULL, NULL, generic_handler, NULL);
                                              ^~~~~~~~~~~~~~~
/opt/homebrew/include/lo/lo_serverthread.h:151:72: note: passing argument to parameter 'h' here
                               const char *typespec, lo_method_handler h,
                                                                       ^
2 errors generated.

include samples via submodule to cut down on initial repo download

The initial repo download is pretty big for a git project. Including the samples separately would help keep things organized and provide an optional way to not have to download them if a user BYOS's and doesn't need them.

You could do the following.

  1. Create a new repo on github called Dirt-samples.
  2. Place the sample library in the repo and push them up to Github.
  3. git rm -rf samples/ to remove them from the main repo.
  4. Link the new sample repo inside the main Dirt repo by using a git submodule by running...
    git submodule add https://github.com/yaxu/Dirt-samples.git samples
  5. Suggest to new users that they optionally download these by running...
    git clone --recursive https://github.com/yaxu/Dirt.git
  6. echo "samples/ >> .gitignore so that it stays clear of the main repo in the future.
  7. If the same samples/ directory is used, current users won't be affected.

Hope that gives you an option if you want to. Awesome project!

Configure samples folder

Hi

I'm using Dirt for Tidal and would like to configure Dirt to point to different file locations for samples. Is there a way of doing this? By default it points to ~/tidal/Dirt/samples

I don't need to change folders mid session. It would just be handy to keep discrete sample sets away from the main samples folder.

ld: warning: directory not found for option '-L/opt/local/lib'

Hi everyone, just wanted to know if anyone is getting the same warning at make dirt ?

☁  Dirt [master] make dirt
gcc -g -I/usr/local/include -I/opt/local/include -Wall -O3 -std=gnu99 -DJACK -DSCALEPAN   -c -o dirt.o dirt.c
gcc -g -I/usr/local/include -I/opt/local/include -Wall -O3 -std=gnu99 -DJACK -DSCALEPAN   -c -o common.o common.c
gcc -g -I/usr/local/include -I/opt/local/include -Wall -O3 -std=gnu99 -DJACK -DSCALEPAN   -c -o audio.o audio.c
gcc -g -I/usr/local/include -I/opt/local/include -Wall -O3 -std=gnu99 -DJACK -DSCALEPAN   -c -o file.o file.c
gcc -g -I/usr/local/include -I/opt/local/include -Wall -O3 -std=gnu99 -DJACK -DSCALEPAN   -c -o server.o server.c
gcc -g -I/usr/local/include -I/opt/local/include -Wall -O3 -std=gnu99 -DJACK -DSCALEPAN   -c -o jobqueue.o jobqueue.c
gcc -g -I/usr/local/include -I/opt/local/include -Wall -O3 -std=gnu99 -DJACK -DSCALEPAN   -c -o thpool.o thpool.c
gcc -g -I/usr/local/include -I/opt/local/include -Wall -O3 -std=gnu99 -DJACK -DSCALEPAN   -c -o jack.o jack.c
gcc dirt.o common.o audio.o file.o server.o jobqueue.o thpool.o jack.o -g -I/usr/local/include -I/opt/local/include -Wall -O3 -std=gnu99 -DJACK -DSCALEPAN -lm -L/usr/local/lib -L/opt/local/lib -llo -lsndfile -lsamplerate -lpthread -ljack -o dirt
ld: warning: directory not found for option '-L/opt/local/lib'
☁  Dirt [master]

I'd be happy to post my entire output from these instructions:

cabal update
cabal install tidal
cd ~/Dirt
(or wherever your Dirt folder is)
git pull
make clean
make dirt

everything seemed fine until the last command.

Don't have time at the moment to check if tidal runs regardless of the warning. But will update here when I do.

cheers,
-Robbie

Specify sample name

In order to better maintain performer work i suggest to add a simple, optional notation when loading samples:

the current one:

d1 $ sound "bd:1"

the new one:

d1 $ sound "bd>filename.wav"

Those methods can coexist but this way when we add a new sample no revision of the .tidal file is needed in order to use the previous sounds

Another solution could be specify the root directory for the samples so it can be shifted on the fly to another soundbank

Thanks

Question: Was there a retag of the 1.0 release over the past year or so?

Dirt is packaged by Homebrew, with its package definition (what we call a "formula") last updated last October, recording a SHA-256 checksum of c7c51ea3f279c048e84d988978455f075fd8ae063b2ad7378fc9b8369218f8fb for the tarball https://github.com/yaxu/Dirt/archive/1.0.tar.gz. However, we just noticed (Homebrew/homebrew-core#2552) that the tarball now reports a different SHA-256 checksum of 4a79a3c8650e8852907beb2d40af0f9bc2824adcffc91041fe62edd55c23ecdc. I wonder if there was a retag since last October, and if so, why. Thanks for your time.

P.S. For packaging's sake, the project could also use a new release, if that's feasible for you.

add support for "cutting" a sample from Tidal (or other sources)

Mainly thinking of the Tidal use-case here, but Dirt will require changes as per Alex's input.

In Tidal, we'd like to be able to "cut" a long sample so that it is not played on top of itself if triggered a 2nd time:

d1 $ sound "[longsample longsample]"
|+| cut "[1 1]"

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.