Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- is_music_c :: Music_C -> Music -> Bool
- is_note :: Music -> Bool
- is_chord :: Music -> Bool
- is_rest :: Music -> Bool
- is_skip :: Music -> Bool
- is_mm_rest :: Music -> Bool
- is_grace :: Music -> Bool
- is_after_grace :: Music -> Bool
- is_grace_skip :: Music -> Bool
- is_clef :: Music -> Bool
- is_time :: Music -> Bool
- is_tempo :: Music -> Bool
- is_command :: Music -> Bool
- is_barlinecheck :: Music -> Bool
- is_tied :: Music -> Bool
- is_tuplet :: Music -> Bool
- music_immediate_duration :: Music -> Maybe Duration
- clr_acc :: Music -> Music
- octpc_to_note :: (Octave, PitchClass) -> Music
- rest :: Duration -> Music
- spacer_rest :: Duration -> Music
- mm_rest :: Time_Signature -> Music
- skip :: Duration -> Music
- empty_measure :: Integer -> Integer -> Music
- null_measure :: Integer -> Integer -> Music
- measure_rest :: Integer -> Integer -> Music
- measure_null :: Integer -> Integer -> Music
- edit_dur :: (Duration -> Duration) -> Music -> Music
- tuplet :: Tuplet_T -> [Music] -> Music
- tuplet_above :: Tuplet_T -> [Music] -> Music
- tuplet_below :: Tuplet_T -> [Music] -> Music
- scale_durations :: Tuplet_T -> [Music] -> Music
- time_signature :: Time_Signature -> Music
- with_time_signature :: Time_Signature -> [Music] -> Music
- ts_use_fractions :: Music
- ts_set_fraction :: Integer -> Integer -> Music
- numeric_time_signature :: Music
- ts_parentheses :: Music
- ts_stencil :: Bool -> Music
- mm_stencil :: Bool -> Music
- ts_transparent :: Bool -> Music
- ts_all_invisible :: Music
- key :: Key -> Music
- std_repeat :: Integer -> [Music] -> Music
- note_edit_octave :: (Octave -> Octave) -> Music -> Music
- note_shift_octave :: Octave -> Music -> Music
- tie_r_ann :: [D_Annotation] -> [Annotation]
- clear_l_ann :: [D_Annotation] -> [Annotation] -> [Annotation]
- da_rest :: Duration_A -> Music
- (##@) :: Pitch -> Duration_A -> Music
- (##) :: Pitch -> Duration -> Music
- (#@) :: Music -> Duration_A -> Music
- (#) :: Music -> Duration -> Music
- chd_p_ann :: [Pitch] -> [[Annotation]] -> Duration -> Music
- chd_p :: [Pitch] -> Duration -> Music
- chd :: [Music] -> Duration -> Music
- bar_number_check :: Integer -> Music
- bar_numbering :: Bool -> Music
- change :: String -> Music
- partial :: Duration -> Music
- hairpin_circled_tip :: Bool -> Music
- hairpin_to_barline :: Bool -> Music
- hairpin_minimum_length :: Maybe Int -> Music
- set_8va_notation :: Music
- name_to_id :: Staff_Name -> Staff_ID
- staff_line_count :: Int -> Music
- staff' :: Staff_T -> Staff_Name -> [Music] -> Staff
- staff :: Staff_Name -> [Music] -> Staff
- rhythmic_staff :: Staff_Name -> [Music] -> Staff
- text_staff :: Staff_Name -> String -> [Music] -> Staff
- piano_staff :: Staff_Name -> [[Music]] -> Staff
- grand_staff :: Staff_Name -> [[Music]] -> Staff
- staff_group :: Staff_Name -> [[Music]] -> Staff
- rhythmic_grand_staff :: Staff_Name -> [[Music]] -> Staff
- staff_set :: (Staff_Set_T, Staff_T) -> Staff_Name -> [Staff_Name] -> [[Music]] -> Staff
- grand_staff' :: Staff_Name -> [Staff_Name] -> [[Music]] -> Staff
- staff_group' :: Staff_Name -> [Staff_Name] -> [[Music]] -> Staff
- two_part_staff :: Staff_Name -> ([Music], [Music]) -> Staff
- instr_name :: Staff_Name -> Staff -> Staff
- resize_staff :: Int -> Staff -> Staff
- score :: [Staff] -> Score
- polyphony :: Music -> Music -> Music
- polyphony' :: [Music] -> [Music] -> Music
- join_rests :: [Music] -> [Music]
- type DA_F x = (Duration_A, x) -> Music
- da_to_music :: DA_F t -> [(Duration_A, t)] -> [Music]
- da_to_measures :: DA_F x -> Maybe [Time_Signature] -> [[(Duration_A, x)]] -> [Measure]
- rq_to_measures :: Show x => Int -> DA_F x -> [Simplify_T] -> [Time_Signature] -> Maybe [[RQ]] -> [RQ] -> [x] -> [Measure]
- mk_fragment :: (Double, Double) -> [[Music]] -> Fragment
- mk_fragment_mm :: (Double, Double) -> [[Measure]] -> Fragment
- stem_transparent :: Bool -> Music
- text_length_on :: Music
- text_length_off :: Music
- text_outside_staff_priority :: Maybe Double -> Music
- text_extra_spacing_width :: (Double, Double) -> Music
- mm_delete_redundant_ts :: [Measure] -> [Measure]
- mm_measures_per_system :: [Int] -> [Measure] -> [Measure]
- mm_measures_per_system_eq :: Int -> [Measure] -> [Measure]
- default_rehearsal_mark :: Music
Music category predicates
is_mm_rest :: Music -> Bool Source #
is_after_grace :: Music -> Bool Source #
is_grace_skip :: Music -> Bool Source #
These are required to avoid issues in lilypond (see manual)
is_command :: Music -> Bool Source #
is_barlinecheck :: Music -> Bool Source #
Duration
Pitch
octpc_to_note :: (Octave, PitchClass) -> Music Source #
Rests
spacer_rest :: Duration -> Music Source #
Construct spacer rest.
empty_measure :: Integer -> Integer -> Music Source #
Create an empty measure for the specified time signature.
null_measure :: Integer -> Integer -> Music Source #
Like empty_measure
, but with an invisible rest.
measure_rest :: Integer -> Integer -> Music Source #
Like empty_measure
but write time signature.
measure_null :: Integer -> Integer -> Music Source #
Like measure_rest
but write time signature.
Tuplets
edit_dur :: (Duration -> Duration) -> Music -> Music Source #
Apply a Duration
function to a Music
node, if it has a duration.
tuplet_above :: Tuplet_T -> [Music] -> Music Source #
Tuplet variants that set location, and then restore to neutral.
tuplet_below :: Tuplet_T -> [Music] -> Music Source #
Tuplet variants that set location, and then restore to neutral.
scale_durations :: Tuplet_T -> [Music] -> Music Source #
Like tuplet but does not annotate music, see also
ts_set_fraction
.
Time signatures
time_signature :: Time_Signature -> Music Source #
Construct time signature.
with_time_signature :: Time_Signature -> [Music] -> Music Source #
Allow proper auto-indenting of multiple measures with the same time signature.
ts_use_fractions :: Music Source #
Command to request that 4/4
and 2/2
etc. are typeset as
fractions.
ts_transparent :: Bool -> Music Source #
Key signatures
Repetition
Octave
note_edit_octave :: (Octave -> Octave) -> Music -> Music Source #
Shift the octave of a note element, else identity.
note_shift_octave :: Octave -> Music -> Music Source #
Shift the octave of a note element, else identity.
Duration
tie_r_ann :: [D_Annotation] -> [Annotation] Source #
clear_l_ann :: [D_Annotation] -> [Annotation] -> [Annotation] Source #
If there is a Tie_Left
, then clear the appropriate annotations.
(Actually just all...)
da_rest :: Duration_A -> Music Source #
Rest of Duration_A
.
(#@) :: Music -> Duration_A -> Music Source #
Add Duration_A
to either a Note
, Chord
or Rest
Music
element.
(#) :: Music -> Duration -> Music Source #
Add Duration
to either a Note
or Chord
or Rest
Music
element.
Chords
chd_p_ann :: [Pitch] -> [[Annotation]] -> Duration -> Music Source #
Construct chord from Pitch
elements.
Commands
bar_number_check :: Integer -> Music Source #
Construct bar number check command.
bar_numbering :: Bool -> Music Source #
Switch bar numbering visibility.
hairpin_circled_tip :: Bool -> Music Source #
Set or unset the circled-tip
hairpin attribute.
hairpin_to_barline :: Bool -> Music Source #
Set or unset the to-barline
hairpin attribute.
hairpin_minimum_length :: Maybe Int -> Music Source #
Set or unset the minimum-length
hairpin attribute.
Staff and Parts
name_to_id :: Staff_Name -> Staff_ID Source #
staff_line_count :: Int -> Music Source #
rhythmic_staff :: Staff_Name -> [Music] -> Staff Source #
Construct rhythmic staff.
text_staff :: Staff_Name -> String -> [Music] -> Staff Source #
Construct staff with text underlay.
piano_staff :: Staff_Name -> [[Music]] -> Staff Source #
Construct piano staff. For two staff piano music the staffs have identifiers rh and lh.
grand_staff :: Staff_Name -> [[Music]] -> Staff Source #
staff_group :: Staff_Name -> [[Music]] -> Staff Source #
rhythmic_grand_staff :: Staff_Name -> [[Music]] -> Staff Source #
staff_set :: (Staff_Set_T, Staff_T) -> Staff_Name -> [Staff_Name] -> [[Music]] -> Staff Source #
Variant with names for each staff.
grand_staff' :: Staff_Name -> [Staff_Name] -> [[Music]] -> Staff Source #
staff_group' :: Staff_Name -> [Staff_Name] -> [[Music]] -> Staff Source #
two_part_staff :: Staff_Name -> ([Music], [Music]) -> Staff Source #
instr_name :: Staff_Name -> Staff -> Staff Source #
polyphony :: Music -> Music -> Music Source #
Interior polyphony. For two part music on one staff see
two_part_staff
.
Rests
join_rests :: [Music] -> [Music] Source #
Joins directly adjacent rest elements. Type is adopted from the right when joining.
Duration_A
functions
da_to_music :: DA_F t -> [(Duration_A, t)] -> [Music] Source #
Given DA_F
transform, transform set of ascribed Duration_A
values to Music
.
import Music.Theory.Duration.Sequence.Notate as T import Music.Theory.Duration.RQ.Tied as T import Music.Theory.Pitch.Name as T import Music.LilyPond.Light.Output.LilyPond as L
let {Right d = T.m_notate True [[(2/3,_f),(1/3,_t)],[(1,_t)],[(1,_f)]] ;jn (i,j) = j ##@ i ;n = T.ascribe d [c4,d4] ;r = "\\times 2/3 { c' 4 d' 8 ~ } d' 4 ~ d' 4"} in L.ly_music_elem (Join (da_to_music jn n)) == r
da_to_measures :: DA_F x -> Maybe [Time_Signature] -> [[(Duration_A, x)]] -> [Measure] Source #
Variant of da_to_music
that operates on sets of measures.
rq_to_measures :: Show x => Int -> DA_F x -> [Simplify_T] -> [Time_Signature] -> Maybe [[RQ]] -> [RQ] -> [x] -> [Measure] Source #
da_to_measures
of notate_mm_ascribe
.
import Music.Theory.Pitch.Name as T import Music.LilyPond.Light.Output.LilyPond as L
let {jn (i,j) = j ##@ i ;[Measure _ m] = rq_to_measures 4 jn [] [(3,4)] Nothing [2/3,1/3 + 2] [c4,d4] ;r = "\\times 2/3 { c' 4 d' 8 ~ } d' 2"} in L.ly_music_elem (Join m) == r
Fragment
mk_fragment :: (Double, Double) -> [[Music]] -> Fragment Source #
Make a fragment (possibly multiple staffs) from Music
elements.
Width and height are in millimeters.
mk_fragment_mm :: (Double, Double) -> [[Measure]] -> Fragment Source #
Measure
variant of mk_fragment
.
Stem
stem_transparent :: Bool -> Music Source #
Text
text_length_on :: Music Source #
Make text annotations respace music to avoid vertical displacement.
text_length_off :: Music Source #
Make text annotations respace music to avoid vertical displacement.
Measure operations
mm_delete_redundant_ts :: [Measure] -> [Measure] Source #
Delete (remove) redundant (repeated, duplicated) time signatures.
let mm = [Measure [Time (3,4)] [],Measure [Time (3,4)] []] in mm_delete_redundant_ts mm == [Measure [Time (3,4)] [],Measure [] []]
mm_measures_per_system_eq :: Int -> [Measure] -> [Measure] Source #
Prepend system_break
at every nth measure.