The djembe package

[Tags:library, mit, test]

A simple DSL for composing drum beats in haskell. Djembe uses the system MIDI device to play these beats.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.1.0, 0.1.1.1, 0.1.1.2
Dependencies base (>=4.6 && <4.9), hmidi (>=0.2.1 && <3.0), hspec (>=2.1 && <2.3), lens (>=4.7 && <4.14), mtl, QuickCheck (>=2.7 && <2.9), random (>=1.0 && <1.2) [details]
License MIT
Copyright 2015 Reed Rosenbluth
Author Reed Rosenbluth & Jonathan Dubin
Maintainer Reed.Rosenbluth@gmail.com
Category Sound
Home page https://github.com/reedrosenbluth/Djembe
Uploaded Wed Jan 20 17:11:37 UTC 2016 by ReedRosenbluth
Distributions NixOS:0.1.1.2
Downloads 187 total (6 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2016-01-20 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for djembe

Readme for djembe-0.1.1.2

Djembe

Djembe is a Haskell embedded domain-specific language for composing drum beats.

Example

Let's define a few quarter note length drum hits

bass  = n4 $ hsong (Hit BassDrum1 0 100)
snare = n4 $ hsong (Hit SnareDrum2 0 100)
hihat = n4 $ hsong (Hit ClosedHihat 0 100)

Now let's create a simple composition

beat = bass <> snare <> bass <> hihat

Finally we can play it at a specific tempo

> play beat 200

We can also compose beats using dseq notation

funky = dseq OpenHihat   8 ".... ...7 .... .7.."
     <> dseq ClosedHihat 8 "7777 777. 7777 7.77"
     <> dseq SnareDrum1  8 ".... 7..7 .7.7 7..7"
     <> dseq BassDrum1   8 "7.7. ..7. ..7. .7.."

Inspiration