Copyright | (c) Eric Bailey 2025 |
---|---|
License | MIT |
Maintainer | eric@ericb.me |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Data.Rhythm.BDF
Description
Binary rhythm definitions, including conversion to ABC notation.
Synopsis
- data BinaryRhythmDefinition = BinaryRhythmDefinition {
- tempo :: !Int
- noteCount :: !Int
- rhythmCount :: !Int
- rhythms :: ![BinaryRhythm]
- data BinaryRhythm = BinaryRhythm {
- instrumentNumber :: !Int
- notes :: ![Finite 2]
- binaryRhythmDefinition :: Parser BinaryRhythmDefinition
- toAbcString :: String -> Int -> BinaryRhythmDefinition -> String
Documentation
data BinaryRhythmDefinition Source #
A binary rhythm definition consists of a tempo, a note count \(n\), a rhythm count \(m\), and a list of \(m\) binary rhythms consisting of \(n\) notes.
Constructors
BinaryRhythmDefinition | |
Fields
|
Instances
Show BinaryRhythmDefinition Source # | |
Defined in Data.Rhythm.BDF Methods showsPrec :: Int -> BinaryRhythmDefinition -> ShowS # show :: BinaryRhythmDefinition -> String # showList :: [BinaryRhythmDefinition] -> ShowS # | |
Eq BinaryRhythmDefinition Source # | |
Defined in Data.Rhythm.BDF Methods (==) :: BinaryRhythmDefinition -> BinaryRhythmDefinition -> Bool # (/=) :: BinaryRhythmDefinition -> BinaryRhythmDefinition -> Bool # |
data BinaryRhythm Source #
A binary rhythm consists of a MIDI instrument number and a list of binary
words where a 1
represents an onset.
Constructors
BinaryRhythm | |
Fields
|
Instances
Show BinaryRhythm Source # | |
Defined in Data.Rhythm.BDF Methods showsPrec :: Int -> BinaryRhythm -> ShowS # show :: BinaryRhythm -> String # showList :: [BinaryRhythm] -> ShowS # | |
Eq BinaryRhythm Source # | |
Defined in Data.Rhythm.BDF |
binaryRhythmDefinition :: Parser BinaryRhythmDefinition Source #
Parse a binary rhythm definition.
toAbcString :: String -> Int -> BinaryRhythmDefinition -> String Source #
Given a title and a number of repeats, represent a binary rhythm definition using ABC notation.