The Bang package

[ Tags: library, mit, sound ] [ Propose Tags ]

This library consists of a DSL for piecing together drum compositions. It uses a MIDI backend and is only currently available for use on Mac OSX. Much of the library was inspired by previous work done by Yale's Euterpea project and Paul Hudak's paper.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.6, 0.1.1.0, 0.1.1.1
Dependencies base (>=4.6 && <5), bifunctors (==4.*), hmidi (>=0.2.1 && <3.0), mtl (>=2.1 && <3), stm (>=2.4 && <5), transformers (==0.3.*) [details]
License MIT
Author Benjamin Kovach
Maintainer bkovach13@gmail.com
Category Sound
Home page https://github.com/5outh/Bang/
Uploaded Sun Jun 8 22:24:47 UTC 2014 by 5outh
Distributions NixOS:0.1.1.1
Downloads 2253 total (66 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for Bang-0.1.0.6

[back to package description]

Bang

An <b>E</b>mbedded <b>D</b>omain <b>S</b>pecific <b>L</b>anguage for writing drum machine patterns in Haskell.

Bang interfaces with your system MIDI device in order to play drum compositions, directly written in and interpreted by the Haskell programming language.

Example:

-- | The first few measures of 'Toxicity' by System of a Down.
toxicityIntro =
  let sh = sn >< hc -- snare and closed hi-hat combo
      bc = bd >< hc -- bass and closed hi-hat combo
      cd = bd >< cc -- bass and crash cymbal combo
  in bang $ 
     double $ -- play at double tempo
       bd <>
       ( double $ 
         mconcat [ -- concatenate into a single sequential composition
           mconcat [sh, bd, qr, bd, sh, qr, bd, qr, sh, qr]
         , mconcat [ 
             (2 #>) >>~ [sn, t1, t2] -- play each element of the list twice
           , double $ 4 #> sn
           , (2 #>) >>~ [sn, t1, t2] 
           , m4 cd qr hc sn -- groups of measures with 4 beats  
           , m4 hc bd sh qr
           , m4 hc sn bc qr
           , m4 bc qr hc sh
           , m4 hc bd sh qr
           , m4 bd qr sh qr 
           ] 
         ] )