• Stars
    star
    139
  • Rank 262,954 (Top 6 %)
  • Language
    Python
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Griode + Novation Launchpad + Raspberry Pi = a music instrument!

Griode

Griode lets you play music using a LaunchPad or a similar controller.

For short demos and tutorials, check this YouTube playlist.

I gave a few talks about Griode:

  • Berlin Hack&Tell at C-Base (May 2018) ๐Ÿ”—
  • Linux Technologies Berlin (July 2018) ๐Ÿ”—
  • Python Users Berlin (April 2019) ๐Ÿ”—

Here are the slides that I use when presenting Griode.

This poster explains how to switch instruments and modes. The original version of the poster was made by Jรฉrรดme Petazzoni to present at PyCon in 2019; and it was then much improved by Elodie Trinh (thanks Elodie!โ™ฅ).

There is also a basic (and incomplete) user manual that you may (or not) find helpful.

Quick start

Here are some quick instructions to get you started, assuming that you have a LaunchPad connected to an Debian/Ubuntu system.

git clone git://github.com/jpetazzo/griode
cd griode
sudo apt-get install python3-pip python3-dev libasound2-dev libjack-dev fluidsynth
pip3 install --user -r requirements.txt
( cd soundfonts; ./download-soundfonts.sh; )
./griode.py

Your LaunchPad should light up with a red and white pattern, and pressing pads should make piano sounds.

Installing on a Raspberry Pi

If you want to setup Griode on a Raspberry Pi, you can use the instructions above, but make sure that you run them as the pi user.

You can use the "lite" (text only) or the "desktop" version, it doesn't matter for Griode.

If you want Griode to start automatically when the Pi is powered on, see this paragraph.

Detailed setup instructions

You need:

  • Python 3
  • FluidSynth (to generate sounds)
  • at least one SoundFont (instrument bank used by FluidSynth)
  • a LaunchPad or similar MIDI controller

Installing Python dependencies

On Debian/Ubuntu systems, you will need the following system packages, so that the python-rtmidi Python package can be installed correctly:

apt-get install python3-dev libasound2-dev libjack-dev

You can then install Griode's requirements with pip:

pip install --user -r requirements.txt

Of course, you are welcome to use virtualenv or anything like that if you want.

If you get compilation errors, you might need extra packages (libraries or headers).

Note: if you have problems related to the installation of python-rtmidi, you might be tempted to try to install rtmidi instead. DO NOT! The two packages are slightly incompatible; so after installing rtmidi, perhaps Griode will start, but you will get another bizarre error at a later point.

Installing FluidSynth

Fluidsynth is a software synthesizer. On Debian/Ubuntu systems, you can install it with:

apt-get install fluidsynth

Installing SoundFonts

Griode requires at least one "SoundFont" so that FluidSynth can make sounds. The easiest way to get started is to go to the soundfonts/ subdirectory, and run the script download-soundfonts.sh.

Griode will load SoundFonts called ?.sf2 in alphabetical order. The download-soundfonts.sh script will create a symlink 0.sf2 pointing to the "GeneralUser GS" SoundFont, which contains the 128 instruments of the General MIDI standard, as well as a few variations, and a few drum kits.

You are welcome to download your own soundfonts, place them in the soundfonts/ subdirectory, and create symlinks to these files: they will be loaded when you start Griode.

What are soundfonts?

SoundFonts are instrument banks used by some audio hardware and by FluidSynth to generate notes of music. The typical extension for SoundFont files is .sf2.

There are many SoundFonts available out there. Some of them are tiny: the Sound Blaster AWE32 (a sound card from the mid-90s) had 512 KB of RAM to load SoundFonts, and there are SoundFonts of that size that offer the 100+ instruments of the General Midi standard! And some SoundFonts are huge: I saw some 1 GB SoundFonts out there with just a couple of piano instruments in them, but in very high quality (i.e. using different samples for each note and for different velocity levels.)

Here are a few links to some SF2 files:

LaunchPad

Griode currently supports the Launchpad Pro, the Launchpad MK2 (aka "RGB"), and has partial support for the Launchpad S. You can plug multiple controllers and use them simultaneously.

Griode relies on the name of the MIDI port reported by the mido library to detect your Launchpad(s). This has been tested on Linux, but the port names might be different on macOS or Windows.

Debugging

You can set the LOG_LEVEL environment variable to any valid logging level, e.g. DEBUG or INFO:

export LOG_LEVEL=DEBUG
./griode.py

Note:

  • DEBUG level is (and will always be) very verbose.
  • You can put the log level in lowercase if you want.
  • The default log level is INFO.

Persistence

Griode saves all persistent information to the state/ subdirectory. If you want to reset Griode (or some of its subsystems) to factory defaults, you can wipe out this directory (or some of the files therein).

Starting automatically on boot

If you are using a Raspberry Pi running the Raspbian distribution, and want to automatically start Griode on boot, you can use the provided systemd unit (griode.service).

After checking out the code in /home/pi/griode, and confirming that it runs correctly, just run:

sudo systemctl enable /home/pi/griode/griode.service
sudo systemctl start griode

Griode will start, and it will be automatically restarted when the Pi reboots.

If it doesn't start, or if you want to see what's going on:

sudo systemctl status griode
sudo journalctl -u griode

Bugs

  • If you keep a note pressed while switching to another gridget, the note will continue to play. This is almost by design.
  • If you keep a note pressed while stopping recording, it might record a zero-length notes.
  • If a sync is triggered while notes are pressed, it might result in zero-length notes.

More Repositories

1

pipework

Software-Defined Networking tools for LXC (LinuX Containers)
Shell
4,139
star
2

container.training

Slides and code samples for training, tutorials, and workshops about Docker, containers, and Kubernetes.
Shell
3,587
star
3

nsenter

Shell
2,582
star
4

ampernetacle

HCL
2,519
star
5

dind

Docker in Docker
Shell
2,474
star
6

dockvpn

Recipe to build an OpenVPN image for Docker
Shell
833
star
7

squid-in-a-can

Python
357
star
8

pxe

Dockerfile to build a PXE server in a Docker container
Shell
250
star
9

minimage

Minimal Docker images: a collection of Dockerfiles illustrating how to reduce container image size.
Shell
206
star
10

registrish

Dirty hack to run a read-only, public Docker registry on almost any static file hosting service (e.g. NGINX, Netlify, S3...)
Shell
136
star
11

shpod

Container image to get a consistent training environment to work on Kubernetes.
Dockerfile
134
star
12

critmux

Docker + CRIU + tmux = magic!
Dockerfile
117
star
13

dockercoins

Python
98
star
14

docker-busybox

Busybox for Stackbrew
Shell
94
star
15

sekexe

Separate Kernel Execution: execute a process within user-mode-linux and retrieve its output and status code
Shell
79
star
16

dessine-moi-un-cluster

Instructions to build a Kubernetes control plane one piece at a time, for learning purposes.
Shell
78
star
17

gunsub

Get your github notifications under control!
Python
74
star
18

syslogdocker

70
star
19

stevedore

Containerize your development environments
Shell
68
star
20

hamba

Shell
67
star
21

obs-docker

OBS-Studio (and a few extra tools) in containers
Python
62
star
22

docker2docker

Shell
26
star
23

wordsmith

Java
23
star
24

intro-to-docker

CSS
23
star
25

jpetazzo.github.io

HTML
22
star
26

go-docker-

20
star
27

trainingwheels

HTML
18
star
28

snakedeck

Elgato StreamDeck controller for Linux, in Python.
Python
17
star
29

nsplease

Tiny Kubernetes operator to create Namespaces on demand (for CI/CD, for instance)
Shell
16
star
30

django

Django on DotCloud tutorial
Python
16
star
31

whisperfiles

A bunch of Dockerfiles for OpenAI Whisper, to illustrate various image optimization techniques
Shell
15
star
32

foundation-example

Shell
14
star
33

httpenv

Tiny HTTP server showing the environment variables
Go
14
star
34

dctrl

Shell
13
star
35

buildkit-demos

Dockerfile
13
star
36

orchestration-workshop

We have moved! We are now at โ†’ https://github.com/jpetazzo/container.training
HTML
12
star
37

decoup

Python
11
star
38

layeremove

Surgically remove layers from a Docker image (with a chainsaw)
Python
11
star
39

znc-on-dotcloud

Shell
11
star
40

tilestream-on-dotcloud

Python
10
star
41

littleboxes

Just for fun scripts to manage local cloud-like VMs with KVM
Shell
10
star
42

django-and-mongodb-on-dotcloud

Django on DotCloud tutorial, using MongoDB to store objects!
Python
10
star
43

kubercoins

8
star
44

sstk

Shell
8
star
45

geodjango-on-dotcloud

Python
7
star
46

meteor-on-dotcloud

7
star
47

solr-on-dotcloud

JavaScript
7
star
48

seleterm

Selenium for terminal applications
Python
6
star
49

snap-on-dotcloud

Shell
6
star
50

httplat

Minimalist Prometheus exporter to collect the latency of an HTTP target
Go
6
star
51

boggle

Solver for the Boggle Word Game
Python
6
star
52

mume

Python
6
star
53

gitorial

(Ab)use git history to write tutorials!
Python
6
star
54

postgresql-on-dotcloud

Python
5
star
55

django-on-gpaas

Django on GANDI PAAS
Python
5
star
56

scangraph

Retrieve point coordinates from a raster plot
JavaScript
5
star
57

hano

Online IDE for Node.js on dotCloud
Shell
5
star
58

pyramid-on-dotcloud

Python
5
star
59

traefik-compose

Quick demo showing how to run web sites (like Wordpress) on Docker with Traefik
4
star
60

plumber

Shell
4
star
61

consul

jpetazzo's Consul image
Shell
4
star
62

zwave-exporter

Prometheus exporter for Z-Wave sensors
JavaScript
4
star
63

jenkins-on-dotcloud

Shell
4
star
64

color

Go
4
star
65

busyhttp

A trivial HTTP server that eats CPU cycles at each request.
Python
4
star
66

tinydocgen

Tiny document generator using Jinja2, Markdown, and WeasyPrint.
Makefile
3
star
67

ngrok

3
star
68

charliebot

Python
3
star
69

prettypictures

3
star
70

usb-webcam-analyzer

Python
3
star
71

rickroll-in-docker

HTML
3
star
72

dnc

Domain Name Command-line tool
Python
3
star
73

python-simple-logging

Python
3
star
74

replay.container.training

Shell
3
star
75

riak-on-dotcloud-ALPHA

Shell
3
star
76

ucengine-on-dotcloud-ALPHA

Shell
3
star
77

django-r2d2

R2D2 (RRDDashboard) is a Django application to draw graphs from metrics coming from e.g. collectd.
Python
3
star
78

pieuvre

Distributed HTTP proxy in Node.js
JavaScript
2
star
79

tmp-sealedsecret-juin-2022

2
star
80

couchdb-on-dotcloud-ALPHA

Shell
2
star
81

escapehash

Python
2
star
82

dockerhubratelimit

Shell
2
star
83

python-worker-on-dotcloud

Shell
2
star
84

tcl-on-dotcloud-ALPHA

Shell
2
star
85

elastic-gke

HCL
2
star
86

dampmam

Docker-Apache-MySQL-PHP but without Apache and MySQL
JavaScript
2
star
87

watchdns

Shell
2
star
88

workflows

2
star
89

highfive

Dockerfile
2
star
90

memcached-on-dotcloud

2
star
91

pawd

PulseAudio Web Daemon
2
star
92

pingr

HTTP server to ping other servers and report their status
Go
2
star
93

dotfiles-old

Config files for various environments
Shell
2
star
94

pgpool-II-on-dotcloud

2
star
95

ls

An ls image for the Docker Fundamentals training
Shell
2
star
96

jetty-on-dotcloud

Reimplementation of dotCloud java service using the custom build API
Shell
2
star
97

dockage

Shell
2
star
98

tornado-on-dotcloud

Python
2
star
99

aiguillage

Nginx
2
star
100

aurevoir

Web directory allowing non-zeroconf clients to browse zeroconf services
Python
2
star