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

Copyright(c) Hans Hoglund 2012-2014
LicenseBSD-style
Maintainerhans@hanshoglund.se
Stabilityexperimental
Portabilitynon-portable (TF,GNTD)
Safe HaskellNone
LanguageHaskell2010

Music.Score.Meta.Attribution

Contents

Description

Provides meta-data attribution for composer, lyricist etc.

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 -> Attribution Source

Make an Attribution a single key and value.

attributions :: [(String, String)] -> Attribution Source

Make an Attribution from keys and values.

getAttribution :: Attribution -> String -> Maybe String Source

Extract an the given attributions value. Semantic function.

Adding attribution to scores

attribute :: (HasMeta a, HasPosition a) => Attribution -> a -> a Source

Set the given attribution in the given score.

attributeDuring :: HasMeta a => Span -> Attribution -> a -> a Source

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

composer :: (HasMeta a, HasPosition a) => String -> a -> a Source

Set composer of the given score.

composerDuring :: HasMeta a => Span -> String -> a -> a Source

Set composer of the given part of a score.

lyricist :: (HasMeta a, HasPosition a) => String -> a -> a Source

Set lyricist of the given score.

lyricistDuring :: HasMeta a => Span -> String -> a -> a Source

Set lyricist of the given part of a score.

arranger :: (HasMeta a, HasPosition a) => String -> a -> a Source

Set arranger of the given score.

arrangerDuring :: HasMeta a => Span -> String -> a -> a Source

Set arranger of the given part of a score.

Extracting attribution

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

Extract attribution values of the given category from a score.

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

Extract all attribution values from a score.