CreatingRhythms-1.8.0.7
Copyright(c) Eric Bailey 2025
LicenseMIT
Maintainereric@ericb.me
Stabilitystable
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Rhythm.Binary.BDF

Description

Binary rhythm definitions, including conversion to ABC notation.

Synopsis

Types

newtype BinaryRhythmDefinition (m :: Nat) (n :: Nat) Source #

A binary rhythm definition consists of a tempo and m binary rhythms consisting of n notes each.

Instances

Instances details
Generic (BinaryRhythmDefinition m n) Source # 
Instance details

Defined in Data.Rhythm.Binary.BDF

Associated Types

type Rep (BinaryRhythmDefinition m n) :: Type -> Type #

(KnownNat m, KnownNat n) => Show (BinaryRhythmDefinition m n) Source # 
Instance details

Defined in Data.Rhythm.Binary.BDF

Eq (BinaryRhythmDefinition m n) Source # 
Instance details

Defined in Data.Rhythm.Binary.BDF

type Rep (BinaryRhythmDefinition m n) Source # 
Instance details

Defined in Data.Rhythm.Binary.BDF

type Rep (BinaryRhythmDefinition m n) = D1 ('MetaData "BinaryRhythmDefinition" "Data.Rhythm.Binary.BDF" "CreatingRhythms-1.8.0.7-DGB2JNDHfptLnJAgYi7IVp" 'True) (C1 ('MetaCons "BinaryRhythmDefinition" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Int, Vector m (BinaryRhythm n)))))

newtype BinaryRhythm (n :: Nat) Source #

A binary rhythm consists of a MIDI instrument number and a binary words of length n, where a 1 represents an onset.

Constructors

BinaryRhythm 

Instances

Instances details
Generic (BinaryRhythm n) Source # 
Instance details

Defined in Data.Rhythm.Binary.BDF

Associated Types

type Rep (BinaryRhythm n) :: Type -> Type #

Methods

from :: BinaryRhythm n -> Rep (BinaryRhythm n) x #

to :: Rep (BinaryRhythm n) x -> BinaryRhythm n #

Show (BinaryRhythm n) Source # 
Instance details

Defined in Data.Rhythm.Binary.BDF

Eq (BinaryRhythm n) Source # 
Instance details

Defined in Data.Rhythm.Binary.BDF

type Rep (BinaryRhythm n) Source # 
Instance details

Defined in Data.Rhythm.Binary.BDF

type Rep (BinaryRhythm n) = D1 ('MetaData "BinaryRhythm" "Data.Rhythm.Binary.BDF" "CreatingRhythms-1.8.0.7-DGB2JNDHfptLnJAgYi7IVp" 'True) (C1 ('MetaCons "BinaryRhythm" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBinaryRhythm") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MIDIInstrument, Vector n (Finite 2)))))

type MIDIInstrument = Closed 1 128 Source #

The General MIDI Level 1 sound set consists of instruments numbered 1 through 128.

Parsing

binaryRhythm :: forall n. KnownNat n => Parser (BinaryRhythm n) Source #

Parse a BinaryRhythm of known length.

Rendering

toAbcString :: forall m n. (KnownNat m, KnownNat n) => String -> Int -> BinaryRhythmDefinition m n -> String Source #

Given a title and a number of repeats, represent a binary rhythm definition using ABC notation.