djembe: Hit drums with haskell

[ library, mit, sound ] [ Propose Tags ] [ Report a vulnerability ]

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


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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 by ReedRosenbluth at 2016-01-20T17:11:37Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2491 total (15 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-01-20 [all 1 reports]

Readme for djembe-0.1.1.2

[back to package description]

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