temporal-music-notation-0.1.3: music notation

Temporal.Music.Notation.Score

Contents

Description

Functions for score composition.

Synopsis

Types

type Time = DoubleSource

time

type Dur = DoubleSource

duration

type Score a = Media Dur aSource

In Score a values of type a can be wrapped in time events as if they present or abscent for some time Dur and combined together in parrallel or sequent ways.

Score is instance of

Functor instance means that you can map over score values with some function (a -> b), rests are mapped to rests and values transformed with given function.

Constructors

rest :: Dur -> Score aSource

pause for some Dur time

note :: Dur -> a -> Score aSource

Constructor of score. Constructs note out of given value that lasts for some time.

Duration querry

dur :: Score a -> DurSource

querry score's duration

Composition

(+:+) :: Score a -> Score a -> Score aSource

binary sequential composition, a +:+ b means play a and then play b.

(=:=) :: Score a -> Score a -> Score aSource

binary parallel composition, a =:= b means play a and b simultoneously.

(=:/) :: Score a -> Score a -> Score aSource

turncating parallel composition

for a =:/ b composes two scores together and turncates biggest one by duration of smallest one.

line :: [Score a] -> Score aSource

sequential composition for list of scores

chord :: [Score a] -> Score aSource

parallel composition for list of scores

chordT :: [Score a] -> Score aSource

turncating parallel composition for lists of scores

loop :: Int -> Score a -> Score aSource

Arranges n copies of score in line.

trill :: Int -> Score a -> Score a -> Score aSource

loop for two groups of notes. Repeats n times line of two scores.

Transformers

In time domain

delay :: Dur -> Score a -> Score aSource

Delay scores by given duration.

stretch :: Dur -> Score a -> Score aSource

stretch in time domain. Duration of every note segemnt is multiplied by given factor.

bpm :: Double -> Score a -> Score aSource

set tempo in beats per minute, if 1 Dur is equal to 1 second before transformation.

dot :: Score a -> Score aSource

stretch with 1.5

ddot :: Score a -> Score aSource

double dot, stretch with 1.75

tri :: Score a -> Score aSource

stretch with 2/3

slice :: Dur -> Dur -> Score a -> Score aSource

extracting score parts in some time interval. it reverses output if t1 < t0.

takeS :: Dur -> Score a -> Score aSource

take sub-score from begining

dropS :: Dur -> Score a -> Score aSource

drop sub-score

reverseS :: Score a -> Score aSource

reverse score

pedal :: Dur -> Score a -> Score aSource

adds sustain, but total duration of score elements remains unchaged

notes are sustained within total duration interval. adds given amount of time to all notes.

pedalBy :: (Time -> Dur -> a -> (Dur, b)) -> Score a -> Score bSource

general "pedal"

Total duration of score element remains unchanged. notes are sustained within total duration interval

sustain :: Dur -> Score a -> Score aSource

adds given amount of duration to all notes

sustainBy :: (Time -> Dur -> a -> (Dur, b)) -> Score a -> Score bSource

general sustain

Mappings

tmap :: (Time -> a -> b) -> Score a -> Score bSource

temporal functor tmap method for scores

map with time

dmap :: (Dur -> a -> b) -> Score a -> Score bSource

temporal functor dmap method for scores

map with duration

tdmap :: (Time -> Dur -> a -> b) -> Score a -> Score bSource

temporal functor tdmap method for scores

map with time and duration

Rendering

data Event t a

Constant time events. Value a starts at some time and lasts for some time.

Constructors

Event 

Fields

eventStart :: t
 
eventDur :: t
 
eventContent :: a
 

Instances

Functor (Event t) 
(Eq t, Eq a) => Eq (Event t a) 
(Show t, Show a) => Show (Event t a) 

data EventList t a

List of Event s. First argument stands for total duration of EventList.

Constructors

EventList t [Event t a] 

Instances

Functor (EventList t) 
(Eq t, Eq a) => Eq (EventList t a) 
(Show t, Show a) => Show (EventList t a) 

Miscellaneous

tmapRel :: (Time -> a -> b) -> Score a -> Score bSource

relative tmap

map with time normalized by total duration value

dmapRel :: (Dur -> a -> b) -> Score a -> Score bSource

relative dmap

map with duration normalized by total duration value

tdmapRel :: (Time -> Dur -> a -> b) -> Score a -> Score bSource

relative tdmap

map with time and duration normalized by total duration value

linseg :: (Ord t, Fractional t) => [t] -> t -> t

Linear interpolation. Can be useful with eventMap for envelope changes.

linseg [a, da, b, db, c, ... ]

a, b, c ... - values

da, db, ... - duration of segments