• Stars
    star
    615
  • Rank 71,283 (Top 2 %)
  • Language
    Clojure
  • License
    Other
  • Created over 8 years ago
  • Updated over 4 years ago

Reviews

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

Repository Details

A musical scratchpad.

Klangmeister

A musical scratchpad. See it in action.

Build Status

Clojurescript

Klangmeister uses bootstrapped Clojurescript compiled in the browser, so any valid Clojurescript is usable in defining music. One exception to this is importing namespaces. Because everything is evaluated in the browser, only namespaces that Klangmeister exposes can be used - you can't use your own.

Bear in mind that the synthesis functions aren't actually side effecting - they just return a synthesiser definition, so if you create two synthesisers in the body of a function, only the one you return will do anything. Same goes for the music - it just returns a note data structure.

Overtone

Klangmeister is not built on Overtone, though it is heavily influenced by it.

Overtone is a Clojure API for the Supercollider synthesis server. Klangmeister uses the Web Audio API provided by browsers. This has different trade-offs. A good thing is that you can use ordinary Clojurescript at runtime, whereas Overtone can't as it needs to define its synthdefs in advance. A bad thing is that the browser isn't as tuned for high performance synthesis as Supercollider is, so Klangmeister may not be able to match the industrial strength synthesis that Overtone can.

Leipzig

Leipzig is a music theory library that I wrote to make it easier to compose melodies and use keys/chords etc. Klangmeister uses Leipzig for all of its music composition.

Anything that Leipzig offers can be used in Klangmeister, with the exception of Leipzig's live namespace, which provides features like jam that are built on top of Overtone.

Documentation for Leipzig is also available. The only difference with how Leipzig works in Klangmeister is that notes have an :instrument key, rather than relying on the play-note multimethod as with Overtone Leipzig examples.

CLJS Bach

CLJS Bach provides the synthesis capability for Klangmeister. It was originally just a namespace within Klangmeister, but has since been extracted.

Building

Figwheel

Run lein figwheel for a hot-reloading development mode.

Then browse to Figwheel's local server.

Currently there is an error which appears only with Figwheel - Namespace "cljs_bach.synthesis" already declared. Make any change in the code window to trigger a new compilation and it will vanish.

Production build

This is the method used to build files for pushing to Github pages:

./build
cd resources/public/
python -m SimpleHTTPServer 8000

Then browse to SimpleHTTPServer's local server.

Tests

To run the unit tests, run ./test.sh.

Goals

My aims for Klangmeister are:

  • Zero-install live-coding
  • Accessible synth design
  • Music education
  • Performance-readiness

There are many other excellent live-coding platforms, like Sonic Pi, Overtone and Extempore. The main thing that differentiates Klangmeister is that as it's in-browser, it's really easy to get going quickly.

References

Klangmeister is based on a talk called Functional Composition.

It is built with Clojurescript, the Web Audio API, the React web framework Reagent and the music theory library Leipzig.

More Repositories

1

leipzig

A music composition library for Clojure and Clojurescript.
Clojure
451
star
2

functional-composition

A live-coding presentation on music theory and Bach's "Canone alla Quarta".
Clojure
164
star
3

traversy

Multilenses for Clojure
Clojure
145
star
4

goldberg

The Goldberg Variations in Overtone
Clojure
99
star
5

cljs-bach

A Clojurescript wrapper for the Web Audio API.
Clojure
97
star
6

kolmogorov-music

CSS
60
star
7

vim-fireplace-easy

A simple setup for getting started with Clojure and Vim.
Vim Script
56
star
8

whelmed

Clojure
56
star
9

african-polyphony-and-polyrhythm

Ethnomusicologists face a dilemma: either shoehorn African music into European notation, or create custom DSLs that can only be understood by a select band of European ethnomusicologists.
CSS
29
star
10

flying-spaghetti-monster

An Idris type provider for communicating type-checkable protocols.
Idris
26
star
11

leipzig-from-scratch

I show you how to make a simple track using Leipzig, Overtone and Clojure, from "lein new" onwards.
Clojure
21
star
12

Idris-Elba-Dev

A Whitespace-Based Dependently Typed Functional Programming Language
Haskell
16
star
13

birdsong-as-code

Exploring the music theory of birdsong
Clojure
14
star
14

kraftwerk

Covers of Kraftwerk tracks.
Clojure
13
star
15

journey-through-the-looking-glass

Talk at the Skillsmatter Clojure Exchange, 2014
Clojure
13
star
16

overtunes

Experiments with overtone.
Clojure
10
star
17

poker

A macro-based refactoring library for Clojure.
Clojure
6
star
18

dueling-keyboards

What did happen on the Cahulawassee River?
Clojure
6
star
19

leipzig-template

A simple template for new Leipzig tracks.
Clojure
6
star
20

cooking-with-clojure

Clojure
4
star
21

V

A Clojure validation library.
Clojure
4
star
22

klang

A Clojurescript wrapper for the Web Audio API.
Clojure
4
star
23

pea-brain

Neural nets from scratch
Clojure
3
star
24

leipzig-live

A musical scratchpad.
Clojure
3
star
25

analysis-by-compression

CSS
3
star
26

centurion

A hundred line Lisp.
Clojure
3
star
27

cadiz

Clojure
2
star
28

multibooks

Drupal module that allows nodes to live in more than one book. Not yet ready for use.
PHP
2
star
29

oncall-charter

A social contract for humane out-of-hours support.
2
star
30

rubyfridays

The material covered at Ruby Fridays for Girl Geek Kampala.
Ruby
1
star
31

strictly

Less tolerant versions of Clojure core features.
Clojure
1
star
32

vim

Personal vim setup.
Vim Script
1
star
33

all-i-wanted

Leipzig/Overtone tune
Clojure
1
star
34

elba

An Idris type provider for type-checked protocols.
Idris
1
star
35

in-the-mood

Clojure
1
star
36

sweet-shooting

Song
Clojure
1
star
37

it-aint-necessarily-so

Music, statistical learning and types.
CSS
1
star
38

dhis2-dev

A vagrant setup to install DHIS2 for development purposes. Not for production use.
Puppet
1
star
39

lambda-jam

Exercises for Lambda Jam workshop
Clojure
1
star
40

whiteboard

A Clojure Scribble client
Clojure
1
star
41

tin-ear

10th anniversary of joining ThoughtWorks performance
Clojure
1
star