music-score-1.6: Musical score and part representation.

Portabilitynon-portable (TF,GNTD)
Stabilityexperimental
Maintainerhans@hanshoglund.se
Safe HaskellNone

Music.Time.Juxtapose

Contents

Description

 

Synopsis

Prerequisites

type Transformable a = (Stretchable a, Delayable a)Source

This pseudo-class gathers the restrictions needed to implement position a value at any point and duration in time.

Juxtaposing values

following :: (HasOffset a, Delayable b, HasOnset b) => a -> b -> bSource

a `following` b moves score b so that its onset is at the offset of score a and returns the moved score.

preceding :: (Delayable a, HasOffset a, HasOnset b) => a -> b -> aSource

a `preceding` b moves score a so that its offset is at the onset of score b and returns the moved score.

during :: (Delayable a, Stretchable a, HasOnset a, HasDuration a, HasOnset b, HasDuration b) => a -> b -> aSource

a `during` b places a at the same era as b and returns the moved score.

Composing values

(|>) :: (Semigroup a, HasOnset a, HasOffset a, Delayable a) => a -> a -> aSource

Compose in sequence.

a |> b moves score b as per following and then composes the resulting scores with <>.

 Score a -> Score a -> Score a

(>|) :: (Semigroup a, HasOnset a, HasOffset a, Delayable a) => a -> a -> aSource

Compose in sequence.

a >| b moves score a as per preceding and then composes the resulting scores with <>.

 Score a -> Score a -> Score a

(<|) :: (Semigroup a, HasOnset a, HasOffset a, Delayable a) => a -> a -> aSource

Compose in reverse sequence.

To compose in parallel, use <>.

 Score a -> Score a -> Score a

scat :: (Monoid' a, HasOnset a, HasOffset a, Delayable a) => [a] -> aSource

Sequential catenation.

 [Score a] -> Score a

pcat :: Monoid' a => [a] -> aSource

Parallel catenation.

 [Score a] -> Score a

Special composition

sustain :: (Semigroup a, Stretchable a, HasDuration a, Fractional d, d ~ Duration) => a -> a -> aSource

Like <>, but scaling the second agument to the duration of the first.

 Score a -> Score a -> Score a

anticipate :: (Semigroup a, Transformable a, HasOnset a, HasOffset a, Ord d, d ~ Duration) => d -> a -> a -> aSource

Like |> but with a negative delay on the second element.

 Duration -> Score a -> Score a -> Score a

Repetition

times :: (Monoid' a, Transformable a, HasOnset a, HasOffset a) => Int -> a -> aSource

Repeat exact amount of times.

 Duration -> Score Note -> Score Note

repeated :: (Monoid' b, Transformable b, HasOnset b, HasOffset b) => [a] -> (a -> b) -> bSource

Repeat once for each element in the list.

Example:

 repeated [1,2,1] (c^*)

Simple type:

 [a] -> (a -> Score Note) -> Score Note

group :: (Monoid' a, Transformable a, Fractional d, d ~ Duration, HasOnset a, HasOffset a) => Int -> a -> aSource

Repeat a number of times and scale down by the same amount.

 Duration -> Score a -> Score a