hmt-0.15: Haskell Music Theory

Safe Haskell | Safe
Language | Haskell98

Music.Theory.Duration.RQ.Tied

Description

`RQ` values with tie right qualifier.

Synopsis

- type Tied_Right = Bool
- type RQ_T = (RQ, Tied_Right)
- rqt :: Tied_Right -> RQ -> RQ_T
- rqt_rq :: RQ_T -> RQ
- rqt_tied :: RQ_T -> Tied_Right
- is_tied_right :: RQ_T -> Bool
- rqt_un_tuplet :: (Integer, Integer) -> RQ_T -> RQ_T
- rq_rqt :: RQ -> RQ_T
- rq_tie_last :: [RQ] -> [RQ_T]
- rqt_to_duration_a :: Bool -> [RQ_T] -> [Duration_A]
- rqt_can_notate :: [RQ_T] -> Bool
- rqt_to_cmn :: RQ_T -> Maybe (RQ_T, RQ_T)
- rqt_to_cmn_l :: RQ_T -> [RQ_T]
- rqt_set_to_cmn :: [RQ_T] -> [RQ_T]

# Documentation

type Tied_Right = Bool Source #

Boolean.

type RQ_T = (RQ, Tied_Right) Source #

`RQ` with tie right.

rqt :: Tied_Right -> RQ -> RQ_T Source #

Construct `RQ_T`.

rqt_rq :: RQ_T -> RQ Source #

`RQ` field of `RQ_T`.

rqt_tied :: RQ_T -> Tied_Right Source #

`Tied` field of `RQ_T`.

is_tied_right :: RQ_T -> Bool Source #

Is `RQ_T` tied right.

rqt_un_tuplet :: (Integer, Integer) -> RQ_T -> RQ_T Source #

`RQ_T` variant of `rq_un_tuplet`.

    rqt_un_tuplet (3,2) (1,T) == (3/2,T)

    let f = rqt_un_tuplet (7,4)
    in map f [(2/7,F),(4/7,T),(1/7,F)] == [(1/2,F),(1,T),(1/4,F)]

rq_rqt :: RQ -> RQ_T Source #

Transform `RQ` to untied `RQ_T`.

    rq_rqt 3 == (3,F)

rq_tie_last :: [RQ] -> [RQ_T] Source #

Tie last element only of list of `RQ`.

    rq_tie_last [1,2,3] == [(1,F),(2,F),(3,T)]

rqt_to_duration_a :: Bool -> [RQ_T] -> [Duration_A] Source #

Transform a list of `RQ_T` to a list of `Duration_A`. The flag indicates if the initial value is tied left.

    rqt_to_duration_a False [(1,T),(1/4,T),(3/4,F)]

rqt_can_notate :: [RQ_T] -> Bool Source #

`RQ_T` variant of `rq_can_notate`.

rqt_to_cmn :: RQ_T -> Maybe (RQ_T, RQ_T) Source #

`RQ_T` variant of `rq_to_cmn`.

    rqt_to_cmn (5,T) == Just ((4,T),(1,T))
    rqt_to_cmn (5/4,T) == Just ((1,T),(1/4,T))
    rqt_to_cmn (5/7,F) == Just ((4/7,T),(1/7,F))

rqt_to_cmn_l :: RQ_T -> [RQ_T] Source #

List variant of `rqt_to_cmn`.

    rqt_to_cmn_l (5,T) == [(4,T),(1,T)]

rqt_set_to_cmn :: [RQ_T] -> [RQ_T] Source #

`concatMap` `rqt_to_cmn_l`.

    rqt_set_to_cmn [(1,T),(5/4,F)] == [(1,T),(1,T),(1/4,F)]

    rqt_set_to_cmn [(1/5,True),(1/20,False),(1/2,False),(1/4,True)]