Music.Theory.Dynamic_Mark

Description

Common music notation dynamic marks.

Synopsis

# Documentation

Enumeration of dynamic mark symbols.

Constructors

 Niente PPPPP PPPP PPP PP P MP MF F FF FFF FFFF FFFFF FP SF SFP SFPP SFZ SFFZ

dynamic_mark_midi :: (Num n, Enum n) => Dynamic_Mark_T -> Maybe nSource

Lookup MIDI velocity for `Dynamic_Mark_T`. The range is linear in `0-127`.

``` let r = [0,6,17,28,39,50,61,72,83,94,105,116,127]
in mapMaybe dynamic_mark_midi [Niente .. FFFFF] == r
```

dynamic_mark_db :: Fractional n => n -> Dynamic_Mark_T -> Maybe nSource

Translate fixed `Dynamic_Mark_T`s to db amplitude over given range.

``` mapMaybe (dynamic_mark_db 120) [Niente,P,F,FFFFF] == [-120,-70,-40,0]
mapMaybe (dynamic_mark_db 60) [Niente,P,F,FFFFF] == [-60,-35,-20,0]
```

data Hairpin_T Source

Enumeration of hairpin indicators.

Constructors

 Crescendo Diminuendo End_Hairpin

Instances

 Bounded Hairpin_T Enum Hairpin_T Eq Hairpin_T Ord Hairpin_T Show Hairpin_T

The `Hairpin_T` implied by a ordered pair of `Dynamic_Mark_T`s.

``` map (implied_hairpin MF) [MP,F] == [Just Diminuendo,Just Crescendo]
```

A node in a dynamic sequence.

The empty `Dynamic_Node`.

Calculate a `Dynamic_Node` sequence from a sequence of `Dynamic_Mark_T`s.

``` dynamic_sequence [PP,MP,MP,PP] == [(Just PP,Just Crescendo)
,(Just MP,Just End_Hairpin)
,(Nothing,Just Diminuendo)
,(Just PP,Just End_Hairpin)]
```

Delete redundant (unaltered) dynamic marks.

``` let s = [Just P,Nothing,Just P,Just P,Just F]
in delete_redundant_marks s == [Just P,Nothing,Nothing,Nothing,Just F]
```

Variant of `dynamic_sequence` for sequences of `Dynamic_Mark_T` with holes (ie. rests). Runs `delete_redundant_marks`.

``` let r = [Just (Just P,Just Crescendo),Just (Just F,Just End_Hairpin)
,Nothing,Just (Just P,Nothing)]
in dynamic_sequence_sets [Just P,Just F,Nothing,Just P] == r
```
``` let s = [Just P,Nothing,Just P]
in dynamic_sequence_sets s = [Just (Just P,Nothing),Nothing,Nothing]
```

apply_dynamic_node :: (a -> Dynamic_Mark_T -> a) -> (a -> Hairpin_T -> a) -> Dynamic_Node -> a -> aSource

Apply `Hairpin_T` and `Dynamic_Mark_T` functions in that order as required by `Dynamic_Node`.

``` let f _ x = show x
in apply_dynamic_node f f (Nothing,Just Crescendo) undefined
```