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

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

Music.Score.Meta.Attribution

Contents

Description

 

Synopsis

Attribution type

data Attribution Source

An attributions is a simple map from keys to values used to gather information such as composer, lyricist, orchestrator, performer, etc.

Attribution is a Semigroup, and compose by choosing the leftmost value in each category. For example

 attribution "composer" "H" <> attribution "composer" "S" <> attribution "lyricist" "S"
     ===> attributions [("composer","H"),("lyricist","S")]

Any kind of attribution can be added, and backends may recognize or ignore categories as they see fit. The following categories are normally recognized:

 composer
 lyricist
 arranger
 performer
 dedication
 year
 copyright
 information

attribution :: String -> String -> AttributionSource

Make an Attribution a single key and value.

attributions :: [(String, String)] -> AttributionSource

Make an Attribution from keys and values.

getAttribution :: Attribution -> String -> Maybe StringSource

Extract an the given attributions value. Semantic function.

Adding attribution to scores

attribute :: (HasMeta a, HasPart' a, HasOnset a, HasOffset a) => Attribution -> a -> aSource

Set the given attribution in the given score.

attributeDuring :: (HasMeta a, HasPart' a) => Span -> Attribution -> a -> aSource

Set the given attribution in the given part of a score.

composer :: (HasMeta a, HasPart' a, HasOnset a, HasOffset a) => String -> a -> aSource

Set composer of the given score.

composerDuring :: (HasMeta a, HasPart' a) => Span -> String -> a -> aSource

Set composer of the given part of a score.

lyricist :: (HasMeta a, HasPart' a, HasOnset a, HasOffset a) => String -> a -> aSource

Set lyricist of the given score.

lyricistDuring :: (HasMeta a, HasPart' a) => Span -> String -> a -> aSource

Set lyricist of the given part of a score.

arranger :: (HasMeta a, HasPart' a, HasOnset a, HasOffset a) => String -> a -> aSource

Set arranger of the given score.

arrangerDuring :: (HasMeta a, HasPart' a) => Span -> String -> a -> aSource

Set arranger of the given part of a score.

Extracting attribution

withAttribution :: String -> (String -> Score a -> Score a) -> Score a -> Score aSource

Extract attribution values of the given category from a score.

withAttribution' :: (Attribution -> Score a -> Score a) -> Score a -> Score aSource

Extract all attribution values from a score.