h&4.6      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvw x y z { | } ~                                                                                                                                                                                                               !!!!!!!!!!!!!!! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! " " " " " " " " " " " " " " " " " " " " " " " " " " " " # # # # # # # # # # # # # # # $ $ $ $ $ $ $ $ $ $ $ % % % % % % % % % % % % % % & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ( ( ( ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) * * * * * + + + + + , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 0 0 0 0 1 1 1 1 1 1 1 1111111111111111111111111111111222222222223333333444444444444444444444555555556666666666666666666666666666666666666666666666666666666777777777777777777777777777777777777777777777777888888888888888888888888888888888888888889999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999:::::::::::::::::;;;;;;;;;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<===================================================>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>????@@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBCCCDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFGGGGGGGGGGGGGGGHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJKKKKKKKKKKKKKKKKKLLLLLLLLLLLLMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOPQQQQQQQRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVVVVVVVVVVVVVVWWWWWWWWWXXXXXXXXXXXXXXXXYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZ[[\\\]]]]]]]]]]]]]]]]]^^^^^^^^^^^^^^^^^^^^^^^^___________```````````aaaaaaaaabbbbbbbbbbbccddddddddddddddddddddeeeeeeeeeeeeffgggggggghhhhiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkklllllllllllllllllllllllllllllllmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnnnnnnnnnnnoppppqrssssssssssssssssssssssssssssssssssttttttttttttttttttuuuuuuuuuuuuuuuuuuuuuuuuuuuvvvwwxxxxxxxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyzzzz{{{{{{{{{{{{{{{{{{{{{{{{{{||||||||||||||||||||||||||||||||||||||||||||||||}}}}}}}}}}}}}}}}}}}}}}}}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Safe-InferredQhmt(column,row), rows descend', ie. down is positive, up is negative.hmt (column,row)hmtSegment  into a sequence of unit steps. let r = [[(0,0)],[(0,1)],[(0,1),(-1,0)],[(0,1),(0,1),(0,1),(-1,0),(-1,0)]] in map segment_vec [(0,0),(0,1),(-1,1),(-2,3)] == r hmt-Directions are D=down, L=left, R=right, U=up. hmtReads either S|D W|L E|R N|U, reverse lookup gives SWEN. A period indicates (0,0). S=south, W=west, E=east, N=north.hmt&Direction sequence to cell references.    Safe-Inferred^ hmtBjorklund statehmtBjorklund left processhmtBjorklund right processhmt9Bjorklund process, left & recur or right & recur or halt.hmt8Bjorklund's algorithm to construct a binary sequence of n bits with k ones such that the k7 ones are distributed as evenly as possible among the (n - k ) zeroes. bjorklund (5,9) == [True,False,True,False,True,False,True,False,True] map xdot_ascii (bjorklund (5,9)) == "x.x.x.x.x" let es = [(2,[3,5]),(3,[4,5,8]),(4,[7,9,12,15]),(5,[6,7,8,9,11,12,13,16]),(6,[7,13]),(7,[8,9,10,12,15,16,17,18]),(8,[17,19]),(9,[14,16,22,23]),(11,[12,24]),(13,[24]),(15,[34])] let es' = concatMap (\(i,j) -> map ((,) i) j) es mapM_ (putStrLn . euler_pp_unicode) es'  > E(2,3) [] (12) > E(2,5) [] (23) > E(3,4) [] (112) > E(3,5) [] (221) > E(3,8) [] (332) > E(4,7) [] (2221) > E(4,9) [] (2223) > E(4,12) [] (3333) > E(4,15) [] (4443) > E(5,6) [] (11112) > E(5,7) [] (21211) > E(5,8) [] (21212) > E(5,9) [] (22221) > E(5,11) [] (22223) > E(5,12) [] (32322) > E(5,13) [] (32323) > E(5,16) [] (33334) > E(6,7) [] (111112) > E(6,13) [] (222223) > E(7,8) [] (1111112) > E(7,9) [] (2112111) > E(7,10) [] (2121211) > E(7,12) [] (2122122) > E(7,15) [] (2222223) > E(7,16) [] (3223222) > E(7,17) [] (3232322) > E(7,18) [] (3232323) > E(8,17) [] (22222223) > E(8,19) [] (32232232) > E(9,14) [] (212121212) > E(9,16) [] (212221222) > E(9,22) [] (323232322) > E(9,23) [] (323232323) > E(11,12) [] (11111111112) > E(11,24) [] (32222322222) > E(13,24) [] (2122222122222) > E(15,34) [] (322232223222322)hmt of . =map xdot_unicode (bjorklund_r 2 (5,16)) == ""hmtPretty printer, generalise.hmtUnicode form, ie. . =euler_pp_unicode (7,12) == "E(7,12) [] (2122122)"hmtASCII form, ie. x.. ;euler_pp_ascii (7,12) == "E(7,12) [x.xx.x.xx.x.] (2122122)"hmtxdot notation for pattern. /map xdot_ascii (bjorklund (5,9)) == "x.x.x.x.x"hmtUnicode variant. map xdot_unicode (bjorklund (5,12)) == "" map xdot_unicode (bjorklund (5,16)) == ""hmtThe & of a pattern is the distance between  values. %iseq (bjorklund (5,9)) == [2,2,2,2,1]hmt of pattern as compact string. 'iseq_str (bjorklund (5,9)) == "(22221)"   Safe-Inferred^  !"#$%&'()  !"#$%&'() Safe-Inferredj*hmtBraille coding data. Elements are: (ASCII HEX,ASCII CHAR,DOT LIST,UNICODE CHAR,MEANING). The dot numbers are in column order.+hmtASCII  of *.,hmtUnicode  of *.-hmt Dot list of *..hmtASCII Braille table. all id (map (\(x,c,_,_,_) -> x == fromEnum c) braille_table) == True/hmtLookup * value for unicode character. ?braille_lookup_unicode 'P' == Just (0x4E,'N',[1,3,4,5],'P',"n")0hmtLookup *, value for ascii character (case invariant). =braille_lookup_ascii 'N' == Just (0x4E,'N',[1,3,4,5],'P',"n")1hmt+The arrangement of the 6-dot patterns into decades, sequences of (1,10,3) cells. The cell to the left of the decade is the empty cell, the two cells to the right are the first two cells of the decade shifted right.For each decade there are two extra cells that shift the first two cells of the decade right one place. Subsequent decades are derived by simple transformation of the first. The second is the first with the addition of dot 3, the third adds dots 3 and 6, the fourth adds dot 6. and the fifth shifts the first down one row.The first decade has the 13 of the 16 4-dot patterns, the remaining 3 are in the fifth decade, that is they are the three 4-dot patterns that are down shifts of a 4-dot pattern. let trimap f (p,q,r) = (f p,f q,f r) let f = map (fromJust . decode) in map (trimap f) braille_642hmt$Transcribe ASCII to unicode braille. transcribe_unicode "BRAILLE ASCII CHAR GRID" == "PPPPPPPPPPPPPPPPPPPPPPP" transcribe_unicode "BRAILLE HTML TABLE GRID" == "PPPPPPPPPPPPPPPPPPPPPPP"3hmtGenerate a character grid using inidicated values for filled and empty cells. let ch = (' ','.') putStrLn$ transcribe_char_grid ch "BRAILLE ASCII CHAR GRID" let ch = (white_circle,black_circle) putStrLn$ string_html_table $ transcribe_char_grid ch "BRAILLE HTML TABLE GRID"4hmt/Generate 6-dot grid given (white,black) values. 0dots_grid (0,1) [1,2,3,5] == [[1,0],[1,1],[1,0]]5hmt as rows and  as cells in HTML table.6hmt Decoding. let t0 = ["PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP" ,"PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP" ,"PPPPPPPPPPPPPPPPPPPPPP"] .concatMap (fromMaybe "#" . decode) (concat t0)7hmtStart and end unicode indices.8hmtAll characters, in sequence. .length braille_seq == 256 putStrLn braille_seq9hmtThe nth character, zero indexed.:hmt,Two element index, 255 * 255 = 65025 places. map braille_ix [100,300];hmt)HTML character encoding (as hex integer). &unwords $ map unicode_html braille_seq<hmtWhite (empty) circle.=hmtBlack (filled) circle.>hmtShaded (hatched) circle.?hmt!Table of one letter contractions.*+,-./0123456789:;<=>?*+,-./0123456789:;<=>? Safe-InferrednHhmtThe sequence of keys at F.Ihmt if D is present in Entity.Jhmt of H.KhmtDuplicate keys predicate.LhmtRemove all associations for key using given equality function.ThmtS of .UhmtPreserves order of occurence.\hmt=Collate adjacent entries of existing sequence with equal key.@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]GFEDCBA@HIJKLMNOPQRSTUVWXYZ[\] Safe-Inferredn^hmtLoad DB from .^_^_ Safe-Inferrednehmt$(Record-, Field-, Entry-) separators`abcdefghijklmnopedcba`fghijklmnop Safe-InferredoEqrstuvqrstuv  Safe-Inferred{5whmt&Common music notation durational modelyhmtdivision of whole notezhmtnumber of dots{hmttuplet modifier~hmtAre multipliers equal?hmt Is multiplier the identity (ie. 1)?hmt)Compare durations with equal multipliers.hmtErroring variant of .hmt#True if neither duration is dotted.hmt7Sum undotted divisions, input is required to be sorted.hmt5Sum dotted divisions, input is required to be sorted. sum_dur_dotted 1 (4,1,4,1) == Just (Duration 2 1 1) sum_dur_dotted 1 (4,0,2,1) == Just (Duration 1 0 1) sum_dur_dotted 1 (8,1,4,0) == Just (Duration 4 2 1) sum_dur_dotted 1 (16,0,4,2) == Just (Duration 2 0 1)hmtSum durations. Not all durations can be summed, and the present algorithm is not exhaustive. import Music.Theory.Duration import Music.Theory.Duration.Name sum_dur quarter_note eighth_note == Just dotted_quarter_note sum_dur dotted_quarter_note eighth_note == Just half_note sum_dur quarter_note dotted_eighth_note == Just double_dotted_quarter_notehmtErroring variant of .hmtStandard divisions (from 1 to 256). MusicXml allows 0 for breve and -1 for long. Negative divisors can represent any number of longer durations, -2 be a breve, -4 a long, -8 a maximus, &etc.hmtDurations set derived from  with up to k dots. Multiplier of 1.hmt-Table of number of beams at notated division.hmtLookup . .whole_note_division_to_beam_count 32 == Just 3hmtCalculate number of beams at w. map duration_beam_count [Duration 2 0 1,Duration 16 0 1] == [0,2]hmt*Table giving MusicXml types for divisions.hmtLookup . map whole_note_division_to_musicxml_type [2,4] == ["half","quarter"]hmt Variant of  extracting y from w, dots & multipler are ignored. 7duration_to_musicxml_type (Duration 4 0 1) == "quarter"hmt Table giving Unicode symbols for divisions.hmtLookup . =map whole_note_division_to_unicode_symbol [1,2,4,8] == "ݢޢߢ"hmtGive Unicode string for w. The duration multiplier is not written. map duration_to_unicode [Duration 1 2 1,Duration 4 1 1] == ["ݢ","ߢ"]hmtGive Lilypond notation for w(. Note that the duration multiplier is not written. map duration_to_lilypond_type [Duration 2 0 1,Duration 4 1 1] == ["2","4."]hmt Duration to **recip notation. 9http://humdrum.org/Humdrum/representations/recip.rep.html let d = map (\z -> Duration z 0 1) [0,1,2,4,8,16,32] map duration_recip_pp d == ["0","1","2","4","8","16","32"] let d = [Duration 1 1 (1/3),Duration 4 1 1,Duration 4 1 (2/3)] map duration_recip_pp d == ["3.","4.","6."]hmtNames for note divisions. Starting from 1/32 these names haev uniqe initial letters that can be used for concise notation.hmt instance in terms of .#w{zyx|}~#}|w{zyx~  Safe-Inferred{  Safe-Inferred|O!!  Safe-Inferred hmtRational Quarter-NotehmtTable mapping tuple Rq values to Durations. Only has cases where the duration can be expressed without a tie. Currently has entries for 3-,5-,6- and 7-tuplets. all (\(i,j) -> i == duration_to_rq j) rq_tuplet_duration_table == TruehmtLookup rq_tuplet_duration_tbl. 8rq_tuplet_to_duration (1/3) == Just (Duration 8 0 (2/3))hmtMake table of (Rq,Duration) associations. Only lists durations with a multiplier of 1. map (length . rq_plain_duration_tbl) [1,2,3] == [20,30,40] map (multiplier . snd) (rq_plain_duration_tbl 1) == replicate 20 1hmtRational quarter note to duration value. Lookup composite plain (hence dots) and tuplet tables. It is a mistake to hope this could handle tuplets directly in a general sense. For instance, a 3:2 dotted note is the same duration as a plain undotted note. However it does give durations for simple notations of simple tuplet values. rq_to_duration 2 (3/4) == Just (Duration 8 1 1) -- dotted_eighth_note rq_to_duration 2 (1/3) == Just (Duration 8 0 (2/3))hmt Variant of  with error message.hmtIs  a cmn$ duration (ie. rq_plain_to_duration) >map (rq_is_cmn 2) [1/4,1/5,1/8,3/32] == [True,False,True,True]hmt,Convert a whole note division integer to an  value. 6map whole_note_division_to_rq [1,2,4,8] == [4,2,1,1/2]hmtApply dots to an  duration. 6map (rq_apply_dots 1) [1,2] == [1 + 1/2,1 + 1/2 + 1/4]hmtConvert w to  value, see  for partial inverse. let d = [Duration 2 0 1,Duration 4 1 1,Duration 1 1 1] map duration_to_rq d == [2,3/2,6] -- half_note,dotted_quarter_note,dotted_whole_notehmt function for w via . 2half_note `duration_compare_rq` quarter_note == GThmt modulo. -map (rq_mod (5/2)) [3/2,3/4,5/2] == [1,1/4,0]hmtIs p divisible by q , ie. is the  of p/q  1. 5map (rq_divisible_by (3%2)) [1%2,1%3] == [True,False]hmtIs  a whole number (ie. is   1. 1map rq_is_integral [1,3/2,2] == [True,False,True]hmtReturn  of  if   1. 4map rq_integral [1,3/2,2] == [Just 1,Nothing,Just 2]hmt(Derive the tuplet structure of a set of  values. rq_derive_tuplet_plain [1/2] == Nothing rq_derive_tuplet_plain [1/2,1/2] == Nothing rq_derive_tuplet_plain [1/4,1/4] == Nothing rq_derive_tuplet_plain [1/3,2/3] == Just (3,2) rq_derive_tuplet_plain [1/2,1/3,1/6] == Just (6,4) rq_derive_tuplet_plain [1/3,1/6] == Just (6,4) rq_derive_tuplet_plain [2/5,3/5] == Just (5,4) rq_derive_tuplet_plain [1/3,1/6,2/5,1/10] == Just (30,16) map rq_derive_tuplet_plain [[1/3,1/6],[2/5,1/10]] == [Just (6,4) ,Just (10,8)]hmt(Derive the tuplet structure of a set of  values. rq_derive_tuplet [1/4,1/8,1/8] == Nothing rq_derive_tuplet [1/3,2/3] == Just (3,2) rq_derive_tuplet [1/2,1/3,1/6] == Just (3,2) rq_derive_tuplet [2/5,3/5] == Just (5,4) rq_derive_tuplet [1/3,1/6,2/5,1/10] == Just (15,8)hmtRemove tuplet multiplier from value, ie. to give notated duration. This seems odd but is neccessary to avoid ambiguity. Ie. is 1 a quarter note or a 3:2 tuplet dotted-quarter-note etc. ;map (rq_un_tuplet (3,2)) [1,2/3,1/2,1/3] == [3/2,1,3/4,1/2]hmtIf an * duration is un-representable by a single cmn duration, give tied notation. 7catMaybes (map rq_to_cmn [1..9]) == [(4,1),(4,3),(8,1)] 8map rq_to_cmn [5/4,5/8] == [Just (1,1/4),Just (1/2,1/8)]hmtPredicate to determine if a segment can be notated either without a tuplet or with a single tuplet. rq_can_notate 2 [1/2,1/4,1/4] == True rq_can_notate 2 [1/3,1/6] == True rq_can_notate 2 [2/5,1/10] == True rq_can_notate 2 [1/3,1/6,2/5,1/10] == False rq_can_notate 2 [4/7,1/7,6/7,3/7] == True rq_can_notate 2 [4/7,1/7,2/7] == Truehmt#Duration in seconds of Rq given qpm3qpm = pulses-per-minute, rq = rational-quarter-note map (\sd -> rq_to_seconds_qpm (90 * sd) 1) [1,2,4,8,16] == [2/3,1/3,1/6,1/12,1/24] map (rq_to_seconds_qpm 90) [1,2,3,4] == [2/3,1 + 1/3,2,2 + 2/3] map (rq_to_seconds_qpm 90) [0::Rq,1,1 + 1/2,1 + 3/4,1 + 7/8,2] == [0,2/3,1,7/6,5/4,4/3]hmtQpm given that rq has duration x, ie. inverse of  map (rq_to_qpm 1) [0.4,0.5,0.8,1,1.5,2] == [150,120,75,60,40,30] map (\qpm -> rq_to_seconds_qpm qpm 1) [150,120,75,60,40,30] == [0.4,0.5,0.8,1,1.5,2]  Safe-Inferred"hmt Annotated w.hmt4Standard music notation durational model annotationshmtDoes  begin a tuplet?hmtDoes  end a tuplet?hmtIs  tied to the the right?hmtAnnotate a sequence of  as a tuplet. import Music.Theory.Duration.Name da_tuplet (3,2) [(quarter_note,[Tie_Left]),(eighth_note,[Tie_Right])]hmtGroup tuplets into a . Branch nodes have label , leaf nodes label  . .import Music.Theory.Duration.Name.Abbreviation let d = [(q,[]) ,(e,[Begin_Tuplet (3,2,e)]) ,(s,[Begin_Tuplet (3,2,s)]),(s,[]),(s,[End_Tuplet]) ,(e,[End_Tuplet]) ,(q,[])] in catMaybes (flatten (da_group_tuplets d)) == dhmt Variant of  that places separator at left. break_left (== 3) [1..6] == ([1..3],[4..6]) break_left (== 3) [1..3] == ([1..3],[])hmt Variant of & that balances begin & end predicates. break_left (== ')') "test (sep) _) balanced" sep_balanced True (== '(') (== ')') "test (sep) _) balanced" sep_balanced False (== '(') (== ')') "(test (sep) _) balanced"hmtGroup non-nested tuplets, ie. groups nested tuplets at one level.hmtKeep right variant of !, unused rhs values are returned. zip_kr [1..4] ['a'..'f'] == ([(1,'a'),(2,'b'),(3,'c'),(4,'d')],"ef")hmt* variant that adopts the shape of the lhs. let {p = [Left 1,Right [2,3],Left 4] ;q = "abcd"} in nn_reshape (,) p q == [Left (1,'a'),Right [(2,'b'),(3,'c')],Left (4,'d')]hmtDoes a have  and ?hmtDoes d have  and ? Safe-Inferredfhmt with  tie right.hmtBoolean.hmtIf Rq_Tied is not tied, get Rq.hmtErroring variant of rqt_to_rq.hmt Construct .hmt field of .hmtTied field of .hmtIs  tied right.hmt variant of . $rqt_un_tuplet (3,2) (1,T) == (3/2,T) let f = rqt_un_tuplet (7,4) in map f [(2/7,F),(4/7,T),(1/7,F)] == [(1/2,F),(1,T),(1/4,F)]hmt Transform  to untied . rq_rqt 3 == (3,F)hmt!Tie last element only of list of . *rq_tie_last [1,2,3] == [(1,F),(2,F),(3,T)]hmtTransform a list of  to a list of  Duration_A9. The flag indicates if the initial value is tied left. /rqt_to_duration_a False [(1,T),(1/4,T),(3/4,F)]hmt variant of .hmt variant of . rqt_to_cmn (5,T) == Just ((4,T),(1,T)) rqt_to_cmn (5/4,T) == Just ((1,T),(1/4,T)) rqt_to_cmn (5/7,F) == Just ((4/7,T),(1/7,F))hmtList variant of . #rqt_to_cmn_l (5,T) == [(4,T),(1,T)]hmt . rqt_set_to_cmn [(1,T),(5/4,F)] == [(1,T),(1,T),(1/4,F)] rqt_set_to_cmn [(1/5,True),(1/20,False),(1/2,False),(1/4,True)] Safe-InferredhmtA node in a dynamic sequence.hmt"Enumeration of hairpin indicators.hmt$Enumeration of dynamic mark symbols.hmtCase insensitive reader for . /map dynamic_mark_t_parse_ci (words "pP p Mp F")hmtLookup Midi velocity for . The range is linear in 0-127. let r = [0,6,17,28,39,50,61,72,83,94,105,116,127] mapMaybe dynamic_mark_midi [Niente .. Fffff] == r map (L.observeAll . ug_hamiltonian_path_ml_0) (g_partition gr)hmt/Generate a graph given a set of labelled edges.hmtVariant that supplies () as the (constant) edge label. let g = G.mkGraph [(0,'a'),(1,'b'),(2,'c')] [(0,1,()),(1,2,())] in g_from_edges_ul [('a','b'),('b','c')] == ghmt(Label sequence of edges starting at one.hmt5Normalised undirected labeled edge (ie. order nodes).hmt2Collate labels for edges that are otherwise equal.hmt of .hmt.Apply predicate to universe of possible edges.hmt&Consider only edges (p,q) where p < q.hmt(Sequence of connected vertices to edges. 9e_path_to_edges "abcd" == [('a','b'),('b','c'),('c','d')]hmtUndirected edge equality.hmtany of f.hmtIs the sequence of vertices a path at the graph, ie. are all adjacencies in the sequence edges.hmt https://github.com/ivan-m/Graphalyze/blob/master/Data/Graph/Analysis/Algorithms/Common.hs, Graphalyze has pandoc as a dependency...hmtRemove all outgoing edges Safe-Inferredhmt$Graph type, directed or un-directed.hmt/Graph pretty-printer, (v -> [attr],e -> [attr])hmt"type:attr (type = graph|node|edge)hmt (type,[attr])hmtgraph|node|edgehmt Classify s using a first element predicate, a remainder predicate and a unit predicate.hmt Symbol rule. map is_symbol ["sym","Sym2","3sym","1",""] == [True,True,False,False,False]hmt Number rule. map is_number ["123","123.45",".25","1.","1.2.3",""] == [True,True,False,True,False,False]hmtQuote s if  or . map maybe_quote ["abc","a b c","12","12.3"] == ["abc","\"a b c\"","12","12.3"]hmtFormat .hmtFormat sequence of Dot_Attr. 9dot_attr_seq_pp [("layout","neato"),("epsilon","0.0001")]hmtMerge attributes, left-biased.hmtFormat Dot_Attr_Set. a = ("graph",[("layout","neato"),("epsilon","0.0001")]) dot_attr_set_pp a == "graph [layout=neato,epsilon=0.0001]"hmtKeys are given as "type:attr". 0dot_key_sep "graph:layout" == ("graph","layout")hmt.Collate Dot_Key attribute set to Dot_Attr_Set.hmt%Default values for default meta-keys. k = dot_attr_def ("neato","century schoolbook",10,"plaintext") map dot_attr_set_pp (dot_attr_collate k)hmtMake Graph_Pp value given label functions for vertices and edges.hmt Label V & E.hmt Label V only.hmt&br = brace, csl = comma separated listhmt8Generate node position attribute given (x,y) coordinate.hmtarithmetic_mean 2 6 == 4 arithmetic_mean 1 2 == (1+2)/2 -- 3/2hmtab = bc ; b = sqrt ac geometric_mean 1 4 == 2 geometric_mean 1 2 == sqrt (1*2) -- sqrt 2hmta-b  a = b-c  c ; 2ac / a+c harmonic_mean 2 6 == 3 harmonic_mean 1 2 == (2*1*2)/(1+2) -- 4/3hmta-b  c = b-c  a ; a-b  b-c = ca ; aa+cc / a+c cont_harmonic_mean 3 6 == 5 cont_harmonic_mean 1 2 == (1*1+2*2)/(1+2) -- 5/3hmta-b  c = b-c  b ; a-b  b-c = c'b ; c - a + (sqrt (5aa - 2ac + cc)) / 2 cont_geometric_mean 2 5 == 4 cont_geometric_mean 1 2 == (2-1+sqrt(5*1*1-2*1*2+2*2))/2 -- (1+sqrt 5)/2 -- GOLDEN RATIO -- 1.6180hmta-b  c = b-c  b ; a-b  b-c = c'b ; a - c + (sqrt (aa - 2ac + 5cc)) / 2 subcont_geometric_mean 1 6 == 4 subcont_geometric_mean 1 2 == (-1 + sqrt 17) / 2 -- 1.5616 Safe-Inferredhmt Alias for  . 8take 12 primes_list == [2,3,5,7,11,13,17,19,23,29,31,37]hmt;Give zero-index of prime, or Nothing if value is not prime. map prime_k [2,3,5,7,11,13,17,19,23,29,31,37] == map Just [0 .. 11] map prime_k [1,4,6,8,9,10,12,14,15,16,18,20,21,22] == replicate 14 Nothinghmt   of  prime_k_err 13 == 5hmtGenerate list of factors of n from x. factor primes_list 315 == [3,3,5,7] Primes.primeFactors 315 == [3,3,5,7])As a special case 1 gives the empty list. 6factor primes_list 1 == [] Primes.primeFactors 1 == []hmt of . map prime_factors [-1,0,1] == [[],[],[]] map prime_factors [1,4,231,315] == [[],[2,2],[3,7,11],[3,3,5,7]] map Primes.primeFactors [1,4,231,315] == [[],[2,2],[3,7,11],[3,3,5,7]]hmt  of  map prime_limit [243,125] == [3,5] map prime_limit [0,1] == [1,1]hmt>Collect number of occurences of each element of a sorted list. 3multiplicities [1,1,1,2,2,3] == [(1,3),(2,2),(3,1)]hmt-Pretty printer for histogram (multiplicites). 6multiplicities_pp [(3,2),(5,1),(7,1)] == "32 51 71"hmt of  . prime_factors_m 1 == [] prime_factors_m 315 == [(3,2),(5,1),(7,1)]hmt of .hmtPrime factors of n and d.hmt  variant of hmtVariant that writes factors of numerator as positive and factors for denominator as negative. Sorted by absolute value. rat_prime_factors_sgn (3 * 5 * 7 * 11,1) == [3,5,7,11] rat_prime_factors_sgn (3 * 5,7 * 11) == [3,5,-7,-11] rat_prime_factors_sgn (3 * 7,5) == [3,-5,7]hmtRational variant. rational_prime_factors_sgn (2 * 2 * 2 * 1/3 * 1/3 * 1/3 * 1/3 * 5) == [2,2,2,-3,-3,-3,-3,5]hmt The largest prime factor of n/d.hmtThe largest prime factor of n. #rational_prime_limit (243/125) == 5hmtMerge function for hmtCollect the prime factors in a rational number given as a numerator/ denominator pair (n,m). Prime factors are listed in ascending order with their positive or negative multiplicities, depending on whether the prime factor occurs in the numerator or the denominator (after cancelling out common factors). rat_prime_factors_m (1,1) == [] rat_prime_factors_m (16,15) == [(2,4),(3,-1),(5,-1)] rat_prime_factors_m (10,9) == [(2,1),(3,-2),(5,1)] rat_prime_factors_m (81,64) == [(2,-6),(3,4)] rat_prime_factors_m (27,16) == [(2,-4),(3,3)] rat_prime_factors_m (12,7) == [(2,2),(3,1),(7,-1)] rat_prime_factors_m (5,31) == [(5,1),(31,-1)]hmt  variant of hmt Variant of  giving results in a list. rat_prime_factors_l (1,1) == [] rat_prime_factors_l (2^5,9) == [5,-2] rat_prime_factors_l (2*2*3,7) == [2,1,0,-1] rat_prime_factors_l (3*3,11*13) == [0,2,0,0,-1,-1]hmt  variant of  map rational_prime_factors_l [1/31,256/243] == [[0,0,0,0,0,0,0,0,0,0,-1],[8,-5]]hmt Variant of  padding table to k places. It is an error for k, to indicate a prime less than the limit of x. map (rat_prime_factors_t 6) [(5,13),(12,7)] == [[0,0,1,0,0,-1],[2,1,0,-1,0,0]] rat_prime_factors_t 3 (9,7) == undefinedhmt  variant of hmtCondense factors list to include only indicated places. It is an error if a deleted factor has a non-zero entry in the table. rat_prime_factors_l (12,7) == [2,1,0,-1] rat_prime_factors_c [2,3,5,7] (12,7) == [2,1,0,-1] rat_prime_factors_c [2,3,7] (12,7) == [2,1,-1]hmt  variant of  0map (rational_prime_factors_c [3,5,31]) [3,5,31]hmt>Pretty printer for prime factors. sup=superscript ol=overlinehmt>Pretty printer for prime factors. sup=superscript ol=overline prime_factors_pp_sup_ol True [2,2,-3,5] == "235" prime_factors_pp_sup_ol False [-2,-2,-2,3,3,5,5,5,5] == "-235@" Safe-Inferredxhmt http://oeis.org/A000005d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n. (Formerly M0246 N0086) 1, 2, 2, 3, 2, 4, 2, 4, 3, 4, 2, 6, 2, 4, 4, 5, 2, 6, 2, 6, 4, 4, 2, 8, 3, 4, 4, 6, 2, 8, 2, 6, 4, 4, 4, 9, 2, 4, 4, 8, 2, 8, 2, 6, 6, 4, 2, 10, 3, 6, 4, 6, 2, 8, 4, 8, 4, 4, 2, 12, 2, 4, 6, 7, 4, 8, 2, 6, 4, 8, 2, 12, 2, 4, 6, 6, 4, 8, 2, 10, 5, 4, 2, 12, 4, 4, 4, 8, 2, 12, 4, 6, 4, 4, 4, 12, 2, 6, 6, 9, 2, 8, 2, 8  a000005hmt http://oeis.org/A000010Euler totient function phi(n): count numbers <= n and prime to n. [1,1,2,2,4,2,6,4,6,4,10,4,12,6,8,8,16,6,18,8,12,10,22,8,20,12] `isPrefixOf` a000010hmt http://oeis.org/A000012The simplest sequence of positive numbers: the all 1's sequence.hmt https://oeis.org/A000031Number of n-bead necklaces with 2 colors when turning over is not allowed; also number of output sequences from a simple n-stage cycling shift register; also number of binary irreducible polynomials whose degree divides n. [1,2,3,4,6,8,14,20,36,60,108,188,352,632,1182,2192,4116,7712,14602,27596] `isPrefixOf` a000031hmt http://oeis.org/A000032Lucas numbers beginning at 2: L(n) = L(n-1) + L(n-2), L(0) = 2, L(1) = 1. (Formerly M0155) [2,1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778,9349,15127] `isPrefixOf` a000032hmt http://oeis.org/A000040The prime numbers. [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103] `isPrefixOf` a000040hmt http://oeis.org/A000041>a(n) is the number of partitions of n (the partition numbers). 1,1,2,3,5,7,11,15,22,30,42,56,77,101,135,176,231,297,385,490,627,792,1002,1255  a000041hmt http://oeis.org/A000045Fibonacci numbers [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946] `isPrefixOf` a000045hmt http://oeis.org/A000051a(n) = 2^n + 1 [2,3,5,9,17,33,65,129,257,513,1025,2049,4097,8193,16385,32769,65537,131073] `isPrefixOf` a000051hmt http://oeis.org/A000071a(n) = Fibonacci(n) - 1. [0,0,1,2,4,7,12,20,33,54,88,143,232,376,609,986,1596,2583,4180,6764,10945,17710] `isPrefixOf` a000071hmt http://oeis.org/A000073Tribonacci numbers: a(n) = a(n-1) + a(n-2) + a(n-3) for n >= 3 with a(0) = a(1) = 0 and a(2) = 1. [0,0,1,1,2,4,7,13,24,44,81,149,274,504,927,1705,3136,5768,10609,19513,35890] `isPrefixOf` a000073hmt http://oeis.org/A000078Tetranacci numbers: a(n) = a(n-1) + a(n-2) + a(n-3) + a(n-4) with a(0)=a(1)=a(2)=0, a(3)=1. [0,0,0,1,1,2,4,8,15,29,56,108,208,401,773,1490,2872,5536,10671,20569,39648] `isPrefixOf` a000078hmt http://oeis.org/A000079/Powers of 2: a(n) = 2^n. (Formerly M1129 N0432) [1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536] `isPrefixOf` a000079 [1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536] `isPrefixOf` map (2 ^) [0..]hmt http://oeis.org/A000085Number of self-inverse permutations on n letters, also known as involutions; number of standard Young tableaux with n cells. [1,1,2,4,10,26,76,232,764,2620,9496,35696,140152,568504,2390480,10349536] `isPrefixOf` a000085hmt http://oeis.org/A000108&Catalan numbers: C(n) = binomial(2n,n) (n+1) = (2n)! (n!(n+1)!). [1,1,2,5,14,42,132,429,1430,4862,16796,58786,208012,742900,2674440,9694845] `isPrefixOf` a000108hmt http://oeis.org/A0001201's-counting sequence: number of 1's in binary expansion of n (or the binary weight of n). [0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3] `isPrefixOf` a000120hmt http://oeis.org/A000142Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters). [1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600,6227020800] `isPrefixOf` a000142hmt https://oeis.org/A000201Lower Wythoff sequence (a Beatty sequence): a(n) = floor(n*phi), where phi = (1+sqrt(5))/2 = A001622 [1,3,4,6,8,9,11,12,14,16,17,19,21,22,24,25,27,29,30,32,33,35,37,38,40,42] `isPrefixOf` a000201 >import Sound.SC3.Plot plot_p1_imp [take 128 a000201 :: [Int]]hmt https://oeis.org/A000204Lucas numbers (beginning with 1): L(n) = L(n-1) + L(n-2) with L(1) = 1, L(2) = 3 [1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778,9349,15127] `isPrefixOf` a000204hmt http://oeis.org/A000213Tribonacci numbers: a(n) = a(n-1) + a(n-2) + a(n-3) with a(0)=a(1)=a(2)=1. 1,1,1,3,5,9,17,31,57,105,193,355,653,1201,2209,4063,7473,13745,25281,46499  a000213hmt https://oeis.org/A000217Triangular numbers: a(n) = binomial(n+1,2) = n(n+1)/2 = 0 + 1 + 2 + ... + n. [0,1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,153,171,190,210,231,253,276] `isPrefixOf` a000217hmt http://oeis.org/A000225a(n) = 2^n - 1 (Sometimes called Mersenne numbers, although that name is usually reserved for A001348) [0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535] `isPrefixOf` a000225hmt http://oeis.org/000285a(0) = 1, a(1) = 4, and a(n) = a(n-1) + a(n-2) for n >= 2. (Formerly M3246 N1309) [1,4,5,9,14,23,37,60,97,157,254,411,665,1076,1741,2817,4558,7375,11933,19308] `isPrefixOf` a000285hmt http://oeis.org/A000290)The squares of the non-negative integers. 4[0,1,4,9,16,25,36,49,64,81,100] `isPrefixOf` a000290hmt https://oeis.org/A000292Tetrahedral (or triangular pyramidal) numbers: a(n) = C(n+2,3) = n*(n+1)*(n+2)/6. [0,1,4,10,20,35,56,84,120,165,220,286,364,455,560,680,816,969,1140,1330,1540] `isPrefixOf` a000292hmt http://oeis.org/A000384;Hexagonal numbers: a(n) = n*(2*n-1). (Formerly M4108 N1705) [0,1,6,15,28,45,66,91,120,153,190,231,276,325,378,435,496,561,630,703,780,861] `isPrefixOf` a000384hmt http://oeis.org/A000578The cubes: a(n) = n^3. [0,1,8,27,64,125,216,343,512,729,1000,1331,1728,2197,2744,3375,4096,4913,5832] `isPrefixOf` a000578hmt http://oeis.org/A000583Fourth powers: a(n) = n^4. [0,1,16,81,256,625,1296,2401,4096,6561,10000,14641,20736,28561,38416,50625] `isPrefixOf` a000583hmt http://oeis.org/A000670Fubini numbers: number of preferential arrangements of n labeled elements; or number of weak orders on n labeled elements; or number of ordered partitions of [n]. [1,1,3,13,75,541,4683,47293,545835,7087261,102247563,1622632573,28091567595] `isPrefixOf` a000670hmt https://oeis.org/A000796*Decimal expansion of Pi (or digits of Pi). [3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4,6,2,6,4,3,3,8,3,2,7,9,5,0,2,8,8,4,1,9] `isPrefixOf` a000796 8pi :: Data.Number.Fixed.Fixed Data.Number.Fixed.Prec500 hmt https://oeis.org/A000930Narayana's cows sequence. 5[1,1,1,2,3,4,6,9,13,19,28,41,60] `isPrefixOf` a000930hmt https://oeis.org/A000931Padovan sequence (or Padovan numbers): a(n) = a(n-2) + a(n-3) with a(0) = 1, a(1) = a(2) = 0. [1,0,0,1,0,1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151,200,265] `isPrefixOf` a000931hmt https://oeis.org/A0010086Numerators of harmonic numbers H(n) = Sum_{i=1..n} 1/i 1,3,11,25,137,49,363,761,7129,7381,83711,86021,1145993,1171733,1195757,2436559  a001008hmt http://oeis.org/A001037Number of degree-n irreducible polynomials over GF(2); number of n-bead necklaces with beads of 2 colors when turning over is not allowed and with primitive period n; number of binary Lyndon words of length n. [1,2,1,2,3,6,9,18,30,56,99,186,335,630,1161,2182,4080,7710,14532,27594,52377,99858,190557,364722,698870] `isPrefixOf` a001037hmt http://oeis.org/A001113Decimal expansion of e. [2,7,1,8,2,8,1,8,2,8,4,5,9,0,4,5,2,3,5,3,6,0,2,8,7,4,7,1,3,5,2,6,6,2,4,9,7,7,5] `isPrefixOf` a001113 ;exp 1 :: Data.Number.Fixed.Fixed Data.Number.Fixed.Prec500 hmt https://oeis.org/A001147Double factorial of odd numbers: a(n) = (2*n-1)!! = 1*3*5*...*(2*n-1). (Formerly M3002 N1217) [1,1,3,15,105,945,10395,135135,2027025,34459425,654729075,13749310575] `isPrefixOf` a001147hmt https://oeis.org/A001156'Number of partitions of n into squares. [1,1,1,1,2,2,2,2,3,4,4,4,5,6,6,6,8,9,10,10,12,13,14,14,16,19,20,21,23,26,27,28] `isPrefixOf` a001156hmt https://oeis.org/A0013338Numerators of continued fraction convergents to sqrt(2). 1,1,3,7,17,41,99,239,577,1393,3363,8119,19601,47321,114243,275807,665857  a001333hmt http://oeis.org/A001622Decimal expansion of golden ratio phi (or tau) = (1 + sqrt(5))/2. [1,6,1,8,0,3,3,9,8,8,7,4,9,8,9,4,8,4,8,2,0,4,5,8,6,8,3,4,3,6,5,6,3,8,1,1,7,7,2] `isPrefixOf` a001622 ?a001622_k :: Data.Number.Fixed.Fixed Data.Number.Fixed.Prec500 hmt http://oeis.org/A0016448a(n) = a(n-1) + a(n-2) + a(n-3), a(0)=3, a(1)=1, a(2)=3. 3,1,3,7,11,21,39,71,131,241,443,815,1499,2757,5071,9327,17155,31553,58035,106743  a001644hmt https://oeis.org/A001653*Numbers k such that 2*k^2 - 1 is a square. [1, 5, 29, 169, 985, 5741, 33461, 195025, 1136689, 6625109, 38613965, 225058681, 1311738121, 7645370045, 44560482149] `isPrefixOf` a001653hmt http://oeis.org/A001687a(n) = a(n-2) + a(n-5). 0,1,0,1,0,1,1,1,2,1,3,2,4,4,5,7,7,11,11,16,18,23,29,34,45,52,68,81,102,126,154  a001687hmt https://oeis.org/A001950Upper Wythoff sequence (a Beatty sequence): a(n) = floor(n*phi^2), where phi = (1+sqrt(5))/2 [2,5,7,10,13,15,18,20,23,26,28,31,34,36,39,41,44,47,49,52,54,57,60,62,65] `isPrefixOf` a001950hmt http://oeis.org/A002267The 15 supersingular primes.hmt https://oeis.org/A0024872Stern's diatomic series (or Stern-Brocot sequence) [0,1,1,2,1,3,2,3,1,4,3,5,2,5,3,4,1,5,4,7,3,8,5,7,2,7,5,8,3,7,4,5] `isPrefixOf` a002487hmt https://oeis.org/A002858Ulam numbers: a(1) = 1; a(2) = 2; for n>2, a(n) = least number > a(n-1) which is a unique sum of two distinct earlier terms. [1, 2, 3, 4, 6, 8, 11, 13, 16, 18, 26, 28, 36, 38, 47, 48, 53, 57, 62, 69, 72, 77, 82, 87, 97, 99, 102, 106, 114, 126] `isPrefixOf` a002858hmt http://oeis.org/A003108%Number of partitions of n into cubes. [1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,5,5,5,5,5,6,6,6,7,7,7,7] `isPrefixOf` a003108hmt http://oeis.org/A003215Hex (or centered hexagonal) numbers: 3*n*(n+1)+1 (crystal ball sequence for hexagonal lattice). [1,7,19,37,61,91,127,169,217,271,331,397,469,547,631,721,817,919,1027,1141] `isPrefixOf` a003215hmt http://oeis.org/A003269 [0,1,1,1,1,2,3,4,5,7,10,14,19,26,36,50,69,95,131,181,250,345,476,657] `isPrefixOf` a003269hmt http://oeis.org/A003520.a(n) = a(n-1) + a(n-5); a(0) = ... = a(4) = 1. [1,1,1,1,1,2,3,4,5,6,8,11,15,20,26,34,45,60,80,106,140,185,245,325,431] `isPrefixOf` a003520hmt http://oeis.org/A003462$a(n) = (3^n - 1)/2. (Formerly M3463) 0, 1, 4, 13, 40, 121, 364, 1093, 3280, 9841, 29524, 88573, 265720, 797161, 2391484, 7174453  a003462hmt http://oeis.org/A003586<3-smooth numbers: numbers of the form 2^i*3^j with i, j >= 0 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162  a003586hmt https://oeis.org/A003849The infinite Fibonacci word (start with 0, apply 0->01, 1->0, take limit). [0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0] `isPrefixOf` a003849hmt http://oeis.org/A004001Hofstadter-Conway sequence: a(n) = a(a(n-1)) + a(n-a(n-1)) with a(1) = a(2) = 1. [1,1,2,2,3,4,4,4,5,6,7,7,8,8,8,8,9,10,11,12,12,13,14,14,15,15,15,16,16,16,16,16] `isPrefixOf` a004001 plot_p1_ln [take 250 a004001] plot_p1_ln [zipWith (-) a004001 (map (`div` 2) [1 .. 2000])]hmt http://oeis.org/A004718!Per Nrgrd's "infinity sequence" take 32 a004718 == [0,1,-1,2,1,0,-2,3,-1,2,0,1,2,-1,-3,4,1,0,-2,3,0,1,-1,2,-2,3,1,0,3,-2,-4,5] plot_p1_imp [take 1024 a004718] https://www.tandfonline.com/doi/abs/10.1080/17459737.2017.1299807 #https://arxiv.org/pdf/1402.3091.pdfhmt http://oeis.org/A005185Hofstadter Q-sequence: a(1) = a(2) = 1; a(n) = a(n-a(n-1)) + a(n-a(n-2)) for n > 2. [1,1,2,3,3,4,5,5,6,6,6,8,8,8,10,9,10,11,11,12,12,12,12,16,14,14,16,16,16,16,20] `isPrefixOf` a005185hmt https://oeis.org/A0054482Centered triangular numbers: a(n) = 3n(n-1)/2 + 1. [1,4,10,19,31,46,64,85,109,136,166,199,235,274,316,361,409,460,514,571,631,694] `isPrefixOf` a005448 .map a005448_n [1 .. 1000] `isPrefixOf` a005448hmt http://oeis.org/A005728/Number of fractions in Farey series of order n. [1,2,3,5,7,11,13,19,23,29,33,43,47,59,65,73,81,97,103,121,129,141,151] `isPrefixOf` a005728hmt http://oeis.org/A005811Number of runs in binary expansion of n (n>0); number of 1's in Gray code for n take 32 a005811 == [0,1,2,1,2,3,2,1,2,3,4,3,2,3,2,1,2,3,4,3,4,5,4,3,2,3,4,3,2,3,2,1]hmt http://oeis.org/A0059175Rhombic dodecahedral numbers: a(n) = n^4 - (n - 1)^4. [1,15,65,175,369,671,1105,1695,2465,3439,4641,6095,7825,9855,12209,14911,17985] `isPrefixOf` a005917hmt https://oeis.org/A006003a(n) = n*(n^2 + 1)/2. [0,1,5,15,34,65,111,175,260,369,505,671,870,1105,1379,1695,2056,2465,2925,3439] `isPrefixOf` a006003 .map a006003_n [0 .. 1000] `isPrefixOf` a006003hmt http://oeis.org/A006046Total number of odd entries in first n rows of Pascal's triangle: a(0) = 0, a(1) = 1, a(2k) = 3*a(k), a(2k+1) = 2*a(k) + a(k+1). [0,1,3,5,9,11,15,19,27,29,33,37,45,49,57,65,81,83,87,91,99,103,111,119,135,139] `isPrefixOf` a006046 import Sound.SC3.Plot plot_p1_ln [take 250 a006046] let t = log 3 / log 2 plot_p1_ln [zipWith (/) (map fromIntegral a006046) (map (\n -> n ** t) [0.0,1 .. 200])]hmt http://oeis.org/A006052Number of magic squares of order n composed of the numbers from 1 to n^2, counted up to rotations and reflections.  [1,0,1,880,275305224] == a006052hmt http://oeis.org/A006842Triangle read by rows: row n gives numerators of Farey series of order n. [0,1,0,1,1,0,1,1,2,1,0,1,1,1,2,3,1,0,1,1,1,2,1,3,2,3,4,1,0,1,1,1,1,2,1,3] `isPrefixOf` a006842 plot_p1_imp [take 200 (a006842 :: [Int])] plot_p1_pt [take 10000 (a006842 :: [Int])]hmt http://oeis.org/A006843Triangle read by rows: row n gives denominators of Farey series of order n [1,1,1,2,1,1,3,2,3,1,1,4,3,2,3,4,1,1,5,4,3,5,2,5,3,4,5,1,1,6,5,4,3,5,2,5] `isPrefixOf` a006843 plot_p1_imp [take 200 (a006843 :: [Int])] plot_p1_pt [take 10000 (a006843 :: [Int])]hmt https://oeis.org/A007318Pascal's triangle read by rows [16,[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1],[1,5,10,10,5,1]]   a007318_tblhmt https://oeis.org/A008277Triangle of Stirling numbers of the second kind, S2(n,k), n >= 1, 1 <= k <= n. 1,1,1,1,3,1,1,7,6,1,1,15,25,10,1,1,31,90,65,15,1,1,63,301,350,140,21,1  a008277hmt http://oeis.org/A008278Triangle of Stirling numbers of 2nd kind, S(n,n-k+1), n >= 1, 1<=k<=n. 1,1,1,1,3,1,1,6,7,1,1,10,25,15,1,1,15,65,90,31,1,1,21,140,350,301,63,1  a008278hmt http://oeis.org/A008683Mbius (or Moebius) function mu(n). mu(1) = 1; mu(n) = (-1)^k if n is the product of k different primes; otherwise mu(n) = 0. [1,-1,-1,0,-1,1,-1,0,0,1,-1,0,-1,1,1,0,-1,0,-1,0,1,1,-1,0,0,1,0,0,-1,-1,-1,0,1] `isPrefixOf` a008683hmt http://oeis.org/A010049Second-order Fibonacci numbers. [0,1,1,3,5,10,18,33,59,105,185,324,564,977,1685,2895,4957,8462,14406,24465,41455] `isInfixOf` a010049hmt https://oeis.org/A010060Thue-Morse sequence: let A_k denote the first 2^k terms; then A_0 = 0 and for k >= 0, A_{k+1} = A_k B_k, where B_k is obtained from A_k by interchanging 0's and 1's. 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0  a010060hmt https://oeis.org/A014081a(n) is the number of occurrences of '11' in binary expansion of n. [0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 0, 1, 1, 1, 2, 3, 0, 0, 0, 1, 0, 0, 1, 2, 1, 1, 1, 2, 2, 2, 3, 4, 0, 0, 0, 1, 0, 0, 1, 2] `isPrefixOf` a014081hmt https://oeis.org/A014577>The regular paper-folding sequence (or dragon curve sequence). [1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1] `isPrefixOf` a014577hmt http://oeis.org/A016813a(n) = 4*n + 1. [1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61,65,69,73,77,81,85,89,93,97,101] `isPrefixOf` a016813hmt http://oeis.org/A0178178a(n) = a(n-3) + a(n-4), with a(0)=1, a(1)=a(2)=0, a(3)=1 [1,0,0,1,1,0,1,2,1,1,3,3,2,4,6,5,6,10,11,11,16,21,22,27,37,43,49,64,80,92] `isPrefixOf` a017817hmt http://oeis.org/A020695Pisot sequence E(2,3). [2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711] `isPrefixOf` a020695hmt https://oeis.org/A020985The Rudin-Shapiro or Golay-Rudin-Shapiro sequence (coefficients of the Shapiro polynomials). 45 [1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1] `isPrefixOf` a020985hmt http://oeis.org/A022095"Fibonacci sequence beginning 1, 5. [1,5,6,11,17,28,45,73,118,191,309,500,809,1309,2118,3427,5545,8972,14517,23489] `isPrefixOf` a022095hmt http://oeis.org/A022096"Fibonacci sequence beginning 1, 6. [1,6,7,13,20,33,53,86,139,225,364,589,953,1542,2495,4037,6532,10569,17101,27670] `isPrefixOf` a022096hmt https://oeis.org/A027750=Triangle read by rows in which row n lists the divisors of n. [1,1,2,1,3,1,2,4,1,5,1,2,3,6,1,7,1,2,4,8,1,3,9,1,2,5,10,1,11,1,2,3,4,6,12,1,13] `isPrefixOf` a027750hmt http://oeis.org/A027934a(0)=0, a(1)=1, a(2)=2; for n > 2, a(n) = 3*a(n-1) - a(n-2) - 2*a(n-3). [0,1,2,5,11,24,51,107,222,457,935,1904,3863,7815,15774,31781,63939,128488] `isPrefixOf` a027934hmt http://oeis.org/A029635;The (1,2)-Pascal triangle (or Lucas triangle) read by rows. [2,1,2,1,3,2,1,4,5,2,1,5,9,7,2,1,6,14,16,9,2,1,7,20,30,25,11,2,1,8,27,50,55,36] `isPrefixOf` a029635 take 7 a029635_tbl == [[2],[1,2],[1,3,2],[1,4,5,2],[1,5,9,7,2],[1,6,14,16,9,2],[1,7,20,30,25,11,2]]hmt http://oeis.org/A030308Triangle T(n,k): Write n in base 2, reverse order of digits, to get the n-th row take 9 a030308 == [[0],[1],[0,1],[1,1],[0,0,1],[1,0,1],[0,1,1],[1,1,1],[0,0,0,1]]hmt https://oeis.org/A033622Good sequence of increments for Shell sort (best on big values). 1, 5, 19, 41, 109, 209, 505, 929, 2161, 3905, 8929, 16001, 36289, 64769, 146305, 260609, 587521  a033622hmt http://oeis.org/A033812The Loh-Shu 3 X 3 magic square, lexicographically largest variant when read by columns.hmt http://oeis.org/A034968+Minimal number of factorials that add to n. [0,1,1,2,2,3,1,2,2,3,3,4,2,3,3,4,4,5,3,4,4,5,5,6,1,2,2,3,3,4,2,3,3,4,4,5,3,4,4] `isPrefixOf` a034968hmt https://oeis.org/A036562a(n) = 4^(n+1) + 3*2^n + 1 1, 8, 23, 77, 281, 1073, 4193, 16577, 65921, 262913, 1050113, 4197377, 16783361, 67121153  a036562hmt http://oeis.org/A046042-Number of partitions of n into fourth powers. [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3] `isPrefixOf` a046042hmt http://oeis.org/A047999Sierpiski's triangle (or gasket): triangle, read by rows, formed by reading Pascal's triangle mod 2. [1,1,1,1,0,1,1,1,1,1,1,0,0,0,1,1,1,0,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,0,0] `isPrefixOf` a047999hmt https://oeis.org/A048993Triangle of Stirling numbers of 2nd kind, S(n,k), n >= 0, 0 <= k <= n. [1,0,1,0,1,1,0,1,3,1,0,1,7,6,1,0,1,15,25,10,1,0,1,31,90,65,15,1] `isPrefixOf` a048993hmt http://oeis.org/A049455Triangle read by rows, numerator of fractions of a variant of the Farey series. [0,1,0,1,1,0,1,1,2,1,0,1,1,2,1,3,2,3,1,0,1,1,2,1,3,2,3,1,4,3,5,2,5,3,4,1,0] `isPrefixOf` a049455 plot_p1_imp [take 200 (a049455 :: [Int])] plot_p1_pt [take 10000 (a049455 :: [Int])]hmt http://oeis.org/A049456Triangle read by rows, denominator of fractions of a variant of the Farey series. 1,1,1,2,1,1,3,2,3,1,1,4,3,5,2,5,3,4,1,1,5,4,7,3,8,5,7,2,7,5,8,3,7,4,5,1,1,6,5,9  a049456 > plot_p1_imp [take 200 (a049456 :: [Int])] > plot_p1_pt [take 10000 (a049456 :: [Int])]hmt http://oeis.org/A053121)Catalan triangle (with 0's) read by rows. [1,0,1,1,0,1,0,2,0,1,2,0,3,0,1,0,5,0,4,0,1,5,0,9,0,5,0,1,0,14,0,14,0,6,0,1,14,0] `isPrefixOf` a053121 take 7 a053121_tbl == [[1],[0,1],[1,0,1],[0,2,0,1],[2,0,3,0,1],[0,5,0,4,0,1],[5,0,9,0,5,0,1]]hmt http://oeis.org/A058265Decimal expansion of the tribonacci constant t, the real root of x^3 - x^2 - x - 1. [1,8,3,9,2,8,6,7,5,5,2,1,4,1,6,1,1,3,2,5,5,1,8,5,2,5,6,4,6,5,3,2,8,6,6,0,0,4,2] `isPrefixOf` a058265 ?a058265_k :: Data.Number.Fixed.Fixed Data.Number.Fixed.Prec500 hmt A058265 as   calculation, see Data.Number.Fixed.hmt http://oeis.org/A060588If the final two digits of n written in base 3 are the same then this digit, otherwise mod 3-sum of these two digits. [0,2,1,2,1,0,1,0,2,0,2,1,2,1,0,1,0,2,0,2,1,2,1,0,1,0,2,0,2,1,2,1,0,1,0,2,0,2,1] `isPrefixOf` a060588ahmt http://oeis.org/A061654a(n) = (3*16^n + 2)/5 [1,10,154,2458,39322,629146,10066330,161061274,2576980378,41231686042] `isPrefixOf` a061654hmt http://oeis.org/A071996$a(1) = 0, a(2) = 1, a(n) = a(floor(n3)) + a(n - floor(n3)). [0,1,1,1,1,2,2,3,3,3,4,4,4,4,4,5,5,6,6,6,6,6,7,8,8,9,9,9,9,9,9,9,10,11,12,12,12] `isPrefixOf` a071996 plot_p1_ln [take 50 a000201 :: [Int]] plot_p1_imp [map length (take 250 (group a071996))]hmt http://oeis.org/A073334=The "rhythmic infinity system" of Danish composer Per Nrgrd take 24 a073334 == [3,5,8,5,8,13,8,5,8,13,21,13,8,13,8,5,8,13,21,13,21,34,21,13] plot_p1_imp [take 200 (a073334 :: [Int])]hmt https://oeis.org/A080843Tribonacci word: limit S(infinity), where S(0) = 0, S(1) = 0,1, S(2) = 0,1,0,2 and for n >= 0, S(n+3) = S(n+2) S(n+1) S(n). [0,1,0,2,0,1,0,0,1,0,2,0,1,0,1,0,2,0,1,0,0,1,0,2,0,1,0,2,0,1,0,0,1,0,2,0,1,0,1] `isPrefixOf` a080843hmt http://oeis.org/A080992 Entries in Durer's magic square. 3[16,3,2,13,5,10,11,8,9,6,7,12,4,15,14,1] == a080992hmt http://oeis.org/A083866Positions of zeros in Per Nrgrd's infinity sequence (A004718). take 24 a083866 == [0,5,10,17,20,27,34,40,45,54,65,68,75,80,85,90,99,105,108,119,130,136,141,150]hmt http://oeis.org/A095660Pascal (1,3) triangle. [3,1,3,1,4,3,1,5,7,3,1,6,12,10,3,1,7,18,22,13,3,1,8,25,40,35,16,3,1,9,33,65,75] `isPrefixOf` a095660 take 6 a095660_tbl == [[3],[1,3],[1,4,3],[1,5,7,3],[1,6,12,10,3],[1,7,18,22,13,3]]hmt http://oeis.org/A095666Pascal (1,4) triangle. [4,1,4,1,5,4,1,6,9,4,1,7,15,13,4,1,8,22,28,17,4,1,9,30,50,45,21,4,1,10,39,80,95] `isPrefixOf` a095666 take 6 a095666_tbl == [[4],[1,4],[1,5,4],[1,6,9,4],[1,7,15,13,4],[1,8,22,28,17,4]]hmt http://oeis.org/A096940Pascal (1,5) triangle. [5,1,5,1,6,5,1,7,11,5,1,8,18,16,5,1,9,26,34,21,5,1,10,35,60,55,26,5,1,11,45,95] `isPrefixOf` a096940 take 6 a096940_tbl == [[5],[1,5],[1,6,5],[1,7,11,5],[1,8,18,16,5],[1,9,26,34,21,5]]hmt http://oeis.org/A105809A Fibonacci-Pascal matrix. [1,1,1,2,2,1,3,4,3,1,5,7,7,4,1,8,12,14,11,5,1,13,20,26,25,16,6,1,21,33,46,51,41] `isPrefixOf` a105809hmt http://oeis.org/A124010Triangle in which first row is 0, n-th row (n>1) lists the (ordered) prime signature of n, that is, the exponents of distinct prime factors in factorization of n. [0,1,1,2,1,1,1,1,3,2,1,1,1,2,1,1,1,1,1,1,4,1,1,2,1,2,1,1,1,1,1,1,3,1,2,1,1,3,2,1,1,1,1,1,1,5,1] `isPrefixOf` a124010hmt https://oeis.org/A1244726Benjamin Franklin's 16 X 16 magic square read by rows. [200,217,232,249,8,25,40,57,72,89,104,121,136,153,168,185,58,39,26,7,250,231] `isPrefixOf` a124472hmt http://oeis.org/A125519&A 4 x 4 permutation-free magic square.hmt http://oeis.org/A1262752Moment of inertia of all magic squares of order n. [5,60,340,1300,3885,9800,21840,44280,83325,147620,248820,402220,627445,949200] `isPrefixOf` a126275hmt http://oeis.org/A1262760Moment of inertia of all magic cubes of order n. [18,504,5200,31500,136710,471968,1378944,3547800,8258250,17728920,35603568] `isPrefixOf` a126276hmt http://oeis.org/A126651A 7 x 7 magic square.hmt http://oeis.org/A126652A 3 X 3 magic square with magic sum 75: the Loh-Shu square A033812 multiplied by 5. a126652 == map (* 5) a033812hmt http://oeis.org/A126653A 3 X 3 magic square with magic sum 45: the Loh-Shu square A033812 multiplied by 3. a126653 == map (* 3) a033812hmt http://oeis.org/A126654A 3 x 3 magic square.hmt http://oeis.org/A126709*The Loh-Shu 3 x 3 magic square, variant 2.Loh-Shu magic square, attributed to the legendary Fu Xi (Fuh-Hi).hmt http://oeis.org/A126710Jaina inscription of the twelfth or thirteenth century, Khajuraho, India.hmt http://oeis.org/A126976"A 6 x 6 magic square read by rows.!Agrippa (Magic Square of the Sun)hmt https://oeis.org/A212804#Expansion of (1 - x)/(1 - x - x^2). 1,0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946  a212804hmt https://oeis.org/A245553A Rauzy fractal sequence: trajectory of 1 under morphism 1 -> 2,3; 2 -> 3; 3 -> 1. [1,2,3,2,3,3,1,2,3,3,1,3,1,1,2,3,2,3,3,1,3,1,1,2,3,3,1,1,2,3,1,2,3,2,3,3,1,2,3] `isPrefixOf` a245553hmt http://oeis.org/A2557234Another variant of Per Nrgrd's "infinity sequence" take 24 a255723 == [0,-2,-1,2,-2,-4,1,0,-1,-3,0,1,2,0,-3,4,-2,-4,1,0,-4,-6,3,-2] plot_p1_imp [take 400 (a255723 :: [Int])]hmt http://oeis.org/A256184First of two variations by Per Nrgrd of his "infinity sequence" take 24 a256184 == [0,-2,-1,2,-4,-3,1,-3,-2,-2,0,1,4,-6,-5,3,-5,-4,-1,-1,0,3,-5,-4]hmt http://oeis.org/A256185Second of two variations by Per Nrgrd of his "infinity sequence" take 24 a256185 == [0,-3,-2,3,-6,1,2,-5,0,-3,0,-5,6,-9,4,-1,-2,-3,-2,-1,-4,5,-8,3]hmt http://oeis.org/A270876Number of magic tori of order n composed of the numbers from 1 to n^2.  [1,0,1,255,251449712] == a270876hmt http://oeis.org/A320872For all possible 3 X 3 magic squares made of primes, in order of increasing magic sum, list the lexicographically smallest representative of each equivalence class (modulo symmetries of the square), as a row of the 9 elements (3 rows of 3 elements each). Safe-InferredhmtMap from Square_Ix to value.hmt(row,column) index.hmtSquare as row order listhmtSquare as list of lists.hmtSquares are functorshmt of   nhmtf5 pointwise at two squares (of equal size, un-checked)hmt of  hmt of  hmt  of hmtPredicate to determine if  is actually square.hmtGiven degree of square, form  from .hmt'True if list can form a square, ie. if   is a square. %sq_is_linear_square T.a126710 == Truehmt6Calculate degree of linear square, ie. square root of  . sq_linear_degree T.a126710 == 4hmtType specialised  hmt?Full upper-left (ul) to lower-right (lr) diagonals of a square. sq = sq_from_list 4 T.a126710 sq_wr $ sq sq_wr $ sq_diagonals_ul_lr sq sq_wr $ sq_diagonals_ll_ur sq sq_undiagonals_ul_lr (sq_diagonals_ul_lr sq) == sq sq_undiagonals_ll_ur (sq_diagonals_ll_ur sq) == sq sq_diagonal_ul_lr sq == sq_diagonals_ul_lr sq !! 0 sq_diagonal_ll_ur sq == sq_diagonals_ll_ur sq !! 0hmt?Full lower-left (ll) to upper-right (ur) diagonals of a square.hmt Inverse of diagonals_ul_lrhmt Inverse of diagonals_ll_urhmt)Main diagonal (upper-left -> lower-right)hmt)Main diagonal (lower-left -> upper-right)hmt(Horizontal reflection (ie. map reverse). sq = sq_from_list 4 T.a126710 sq_wr $ sq sq_wr $ sq_h_reflection sqhmtAn nn square is normal# if it has the elements (1 .. nn).hmtSums of (rows, columns, left-right-diagonals, right-left-diagonals)hmt to .hmt Alias for  hmt of .hmtMake a  of dimension dm that has elements from m at indicated indices, else .## Safe-InferredWhmt*Type pairing a stratification and a tempo.hmt4A stratification is a tree of integral subdivisions.hmtOne indexed variant of  . 'map (at1 [11..13]) [1..3] == [11,12,13]hmt Variant of 1 with boundary rules and specified error message. map (at1_bnd_err 'x' [11..13]) [0..4] == [1,11,12,13,1] at1_bnd_err 'x' [0] 3 == undefinedhmt Variant of   with input constraints. 7mod_pos_err (-1) 2 == 1 mod_pos_err 1 (-2) == undefinedhmtType-specialised variant of .hmt Variant on   with input constraints.hmt'Indispensibilities from stratification. indispensibilities [3,2,2] == [11,0,6,3,9,1,7,4,10,2,8,5] indispensibilities [2,3,2] == [11,0,6,2,8,4,10,1,7,3,9,5] indispensibilities [2,2,3] == [11,0,4,8,2,6,10,1,5,9,3,7] indispensibilities [3,5] == [14,0,9,3,6,12,1,10,4,7,13,2,11,5,8]hmt!The indispensibility measure (). map (lower_psi [2] 1) [1..2] == [1,0] map (lower_psi [3] 1) [1..3] == [2,0,1] map (lower_psi [2,2] 2) [1..4] == [3,0,2,1] map (lower_psi [5] 1) [1..5] == [4,0,3,1,2] map (lower_psi [3,2] 2) [1..6] == [5,0,3,1,4,2] map (lower_psi [2,3] 2) [1..6] == [5,0,2,4,1,3]hmt The first n primes, reversed. reverse_primes 14 == [43,41,37,31,29,23,19,17,13,11,7,5,3,2] length (reverse_primes 14) == 14hmt"Generate prime stratification for n. map prime_stratification [2,3,5,7,11] == [[2],[3],[5],[7],[11]] map prime_stratification [6,8,9,12] == [[3,2],[2,2,2],[3,3],[3,2,2]] map prime_stratification [22,10,4,1] == [[11,2],[5,2],[2,2],[]] map prime_stratification [18,16,12] == [[3,3,2],[2,2,2,2],[3,2,2]]hmt5Fundamental indispensibilities for prime numbers (). map (upper_psi 2) [1..2] == [1,0] map (upper_psi 3) [1..3] == [2,0,1] map (upper_psi 5) [1..5] == [4,0,3,1,2] map (upper_psi 7) [1..7] == [6,0,4,2,5,1,3] map (upper_psi 11) [1..11] == [10,0,6,4,9,1,7,3,8,2,5] map (upper_psi 13) [1..13] == [12,0,7,4,10,1,8,5,11,2,9,3,6]hmtTable such that each subsequent row deletes the least indispensibile pulse. thinning_table [3,2] == [[True,True,True,True,True,True] ,[True,False,True,True,True,True] ,[True,False,True,False,True,True] ,[True,False,True,False,True,False] ,[True,False,False,False,True,False] ,[True,False,False,False,False,False]]hmtTrivial pretty printer for . putStrLn (thinning_table_pp [3,2]) putStrLn (thinning_table_pp [2,3]) ****** ****** *.**** *.**** *.*.** *.**.* *.*.*. *..*.* *...*. *..*.. *..... *.....hmt.Scale values against length of list minus one. 6relative_to_length [0..5] == [0.0,0.2,0.4,0.6,0.8,1.0]hmt Variant of  that scales value to lie in (0,1).:relative_indispensibilities [3,2] == [1,0,0.6,0.2,0.8,0.4]hmtAlign two meters (given as stratifications) to least common multiple of their degrees. The  function is given as an argument so that it may be relative if required. This generates Table 7 (p.58). let r = [(5,5),(0,0),(2,3),(4,1),(1,4),(3,2)] in align_meters indispensibilities [2,3] [3,2] == r let r = [(1,1),(0,0),(0.4,0.6),(0.8,0.2),(0.2,0.8),(0.6,0.4)] in align_meters relative_indispensibilities [2,3] [3,2] == r align_meters indispensibilities [2,2,3] [3,5] align_meters relative_indispensibilities [2,2,3] [3,5]hmt Variant of   that requires 'mod_pos_err be 0.hmt Variant of   that requires   be 0.hmt&Rule to prolong stratification of two  values such that pulse at the deeper level are aligned. (Paragraph 2, p.58) let x = ([2,2,2],1) in prolong_stratifications x x == (fst x,fst x) let r = ([2,5,3,3,2],[3,2,5,5]) in prolong_stratifications ([2,5],50) ([3,2],60) == r prolong_stratifications ([2,2,3],5) ([3,5],4) == ([2,2,3],[3,5])hmtComposition of  and . 3align_s_mm indispensibilities ([2,2,3],5) ([3,5],4)hmt An attempt at Equation 5 of the CMJ paper. When n is h-1 the output is incorrect (it is the product of the correct values for n at h-1 and h). map (upper_psi' 5) [1..5] /= [4,0,3,1,2] map (upper_psi' 7) [1..7] /= [6,0,4,2,5,1,3] map (upper_psi' 11) [1..11] /= [10,0,6,4,9,1,7,3,8,2,5] map (upper_psi' 13) [1..13] /= [12,0,7,4,10,1,8,5,11,2,9,3,6]hmtThe MPS limit equation given on p.58. mps_limit 3 == 21 + 7/9hmtThe square of the product of the input sequence is summed, then divided by the square of the sequence length. mean_square_product [(0,0),(1,1),(2,2),(3,3)] == 6.125 mean_square_product [(2,3),(4,5)] == (6^2 + 20^2) / 2^2hmtAn incorrect attempt at the description in paragraph two of p.58 of the CMJ paper. let p ~= q = abs (p - q) < 1e-4 metrical_affinity [2,3] 1 [3,2] 1 ~= 0.0324 metrical_affinity [2,2,3] 20 [3,5] 16 ~= 0.0028hmt*An incorrect attempt at Equation 6 of the CMJ paper, see omega_z. let p ~= q = abs (p - q) < 1e-4 metrical_affinity' [2,2,2] 1 [2,2,2] 1 ~= 1.06735 metrical_affinity' [2,2,2] 1 [2,2,3] 1 ~= 0.57185 metrical_affinity' [2,2,2] 1 [2,3,2] 1 ~= 0.48575 metrical_affinity' [2,2,2] 1 [3,2,2] 1 ~= 0.45872 1metrical_affinity' [3,2,2] 3 [2,2,3] 2 ~= 0.10282 Safe-InferredOhmtA  parser.hmtBoolean  for given .hmtParse  . Safe-Inferred%hmtGenerate all permutations. permutations_l [0,3] == [[0,3],[3,0]] length (permutations_l [1..5]) == P.n_permutations 5hmtk"-element permutations of a set of n -elements. >permutations_nk_l 3 2 "abc" == ["ab","ac","ba","bc","ca","cb"]hmt2Generate all distinct permutations of a multi-set. :multiset_permutations [0,1,1] == [[0,1,1],[1,1,0],[1,0,1]]hmt/Calculate number of permutations of a multiset. let r = P.factorial 11 `div` product (map P.factorial [1,4,4,2]) multiset_permutations_n "MISSISSIPPI" == r multiset_permutations_n "MISSISSIPPI" == 34650 length (multiset_permutations "MISSISSIPPI") == 34650 Safe-Inferred hmt Variant of  where n is 1.hmt Divisions of n  into i equal parts grouped as j0. A quarter and eighth note triplet is written (1,1,[2,1],False).hmtLift  to .hmtVerify that grouping j sums to the divisor i.hmtTranslate from  to a sequence of  values. rq_div_to_rq_set_t (1,5,[1,3,1],True) == ([1/5,3/5,1/5],True) rq_div_to_rq_set_t (1/2,6,[3,1,2],False) == ([1/4,1/12,1/6],False)hmtTranslate from result of  to seqeunce of . rq_set_t_to_rqt ([1/5,3/5,1/5],True) == [(1/5,_f),(3/5,_f),(1/5,_t)]hmtTransform sequence of  into sequence of , discarding any final tie. let q = [(1,5,[1,3,1],True),(1/2,6,[3,1,2],True)] in rq_div_seq_rq q == [1/5,3/5,9/20,1/12,1/6]hmtPartitions of an   that sum to n9. This includes the two 'trivial paritions, into a set n 1, and a set of 1 n. 7partitions_sum 4 == [[1,1,1,1],[2,1,1],[2,2],[3,1],[4]] map (length . partitions_sum) [9..15] == [30,42,56,77,101,135,176]hmtThe  of . >map (length . partitions_sum_p) [9..12] == [256,512,1024,2048]hmtThe set of all  that sum to n, a variant on . map (length . rq1_div_univ) [3..5] == [8,16,32] map (length . rq1_div_univ) [9..12] == [512,1024,2048,4096]   Safe-Inferred!hmt;Place notation, sequence of changes with possible lead end.hmtA method is a sequence of changes, if symmetrical only half the changes are given and the lead end.hmtA change either swaps all adjacent bells, or holds a subset of bells.hmtMaximum hold value at hmtComplete list of s at , writing out symmetries.hmtParse a change notation. map parse_change ["-","x","38"] == [Swap_All,Swap_All,Hold [3,8]]hmtSeparate changes. split_changes "-38-14-1258-36-14-58-16-78" split_changes "345.145.5.1.345" == ["345","145","5","1","345"]hmtParse  given PLACE notation.hmtParse string into . :parse_method (parse_place "-38-14-1258-36-14-58-16-78,12")hmtor x? 3map is_swap_all ["-","x","38"] == [True,True,False]hmtFlatten list of pairs. %flatten_pairs [(1,2),(3,4)] == [1..4]hmt Swap all adjacent pairs at list. &swap_all [1 .. 8] == [2,1,4,3,6,5,8,7]hmtParse abbreviated * notation, characters are NOT hexadecimal. .map nchar_to_int "380ETA" == [3,8,10,11,12,13]hmt Inverse of . .map int_to_nchar [3,8,10,11,12,13] == "380ETA"hmtGiven a ' notation, generate permutation cycles. let r = [Right (1,2),Left 3,Right (4,5),Right (6,7),Left 8] gen_swaps 8 [3,8] == r r = [Left 1,Left 2,Right (3,4),Right (5,6),Right (7,8)] gen_swaps 8 [1,2] == rhmt8Given two sequences, derive the one-indexed "hold" list. %derive_holds ("12345","13254") == [1]hmtTwo-tuple to two element list.hmt3Swap notation to plain permutation cycles notation. let n = [Left 1,Left 2,Right (3,4),Right (5,6),Right (7,8)] in swaps_to_cycles n == [[1],[2],[3,4],[5,6],[7,8]]hmt/One-indexed permutation cycles to zero-indexed. let r = [[0],[1],[2,3],[4,5],[6,7]] to_zero_indexed [[1],[2],[3,4],[5,6],[7,8]] == rhmtApply abbreviated  notation, given cardinality. :swap_abbrev 8 [3,8] [2,1,4,3,6,5,8,7] == [1,2,4,6,3,8,5,7]hmtApply a .hmtApply a =, gives next starting sequence and the course of the method. let r = ([1,2,4,5,3] ,[[1,2,3,4,5],[2,1,3,4,5],[2,3,1,4,5],[3,2,4,1,5],[3,4,2,5,1] ,[4,3,2,5,1],[4,2,3,1,5],[2,4,1,3,5],[2,1,4,3,5],[1,2,4,3,5]]) apply_method cambridgeshire_slow_course_doubles [1..5] == rhmtIteratively apply a > until it closes (ie. arrives back at the starting sequence). length (closed_method cambridgeshire_slow_course_doubles [1..5]) == 3hmt  of  with initial sequence appended.hmt of hmt https://rsw.me.uk/blueline/methods/view/Cambridgeshire_Place_Doubles length (closed_place cambridgeshire_place_doubles_pl [1..5]) == 3hmt of hmt https://rsw.me.uk/blueline/methods/view/Double_Cambridge_Cyclic_Bob_Minor length (closed_place double_cambridge_cyclic_bob_minor_pl [1..6]) == 5hmt of hmt ?https://rsw.me.uk/blueline/methods/view/Hammersmith_Bob_Triples >= putStrLn . hexagram_pp hmt  of  . hmtIf   then derive it. h <- four_coin_gen_hexagram putStrLn (hexagram_pp h) maybe (return ()) (putStrLn . hexagram_pp) (hexagram_complement h) hmt4Names of hexagrams, in King Wen order (see also datacsvcombinatorics/yijing.csv) length hexagram_names == 64 hmt/Unicode hexagram characters, in King Wen order. import Data.List.Split {- split -} mapM_ putStrLn (chunksOf 8 hexagram_unicode_sequence) hmtBinary form of  . hmtShow binary form. hmt Inverse of  . hmtRead binary form. let h = hexagram_from_binary_str "100010" putStrLn (hexagram_pp h) hexagram_to_binary_str h == "100010" hmt-Unicode sequence of trigrams (unicode order). import Data.List {- base -} putStrLn (intersperse ' ' trigram_unicode_sequence) hmt(INDEX,UNICODE,BIT-SEQUENCE,NAME,NAME-TRANSLITERATION,NATURE-IMAGE,DIRECTION,ANIMAL) map (T.read_bin_err . T.p8_third) trigram_chart == [7,6,5,4,3,2,1,0]  # Safe-Inferred $ Safe-Inferredړ hmt  then  . set [3,3,3,2,2,1] == [1,2,3] hmt'Size of powerset of set of cardinality n, ie. 2   n. )map n_powerset [6..9] == [64,128,256,512] hmt!Powerset, ie. set of all subsets. sort (powerset [1,2]) == [[],[1],[1,2],[2]] map length (map (\n -> powerset [1..n]) [6..9]) == [64,128,256,512] hmt>Variant where result is sorted and the empty set is not given. powerset_sorted [1,2,3] == [[1],[2],[3],[1,2],[1,3],[2,3],[1,2,3]] hmtTwo element subsets. $pairs [1,2,3] == [(1,2),(1,3),(2,3)] hmtThree element subsets. 3triples [1..4] == [(1,2,3),(1,2,4),(1,3,4),(2,3,4)] import Music.Theory.Combinations let f n = genericLength (triples [1..n]) == nk_combinations n 3 all f [1..15] hmt)Set expansion (ie. to multiset of degree n). 7expand_set 4 [1,2,3] == [[1,1,2,3],[1,2,2,3],[1,2,3,3]] hmt&All distinct multiset partitions, see  . partitions "aab" == [["aab"],["a","ab"],["b","aa"],["b","a","a"]] partitions "abc" == [["abc"],["bc","a"],["b","ac"],["c","ab"],["c","b","a"]] hmtCartesian product of two sets. cartesian_product "abc" [1,2] == [('a',1),('a',2),('b',1),('b',2),('c',1),('c',2)] cartesian_product "abc" "" == [] hmt&List form of n-fold cartesian product. length (nfold_cartesian_product [[1..13],[1..4]]) == 52 length (nfold_cartesian_product ["abc","de","fgh"]) == 3 * 2 * 3 hmtGenerate all distinct cycles, aka necklaces, with elements taken from a multiset. concatMap multiset_cycles [replicate i 0 ++ replicate (6 - i) 1 | i <- [0 .. 6]] % Safe-Inferred hmt:Donald Knuth, Art of Computer Programming, Algorithm H 6http://www-cs-faculty.stanford.edu/~knuth/fasc3b.ps.gz &partm 3 6 == [[1,1,4],[2,1,3],[2,2,2]] hmtGenerates all partitions of n. compUniq 4 == [[1,1,1,1],[1,1,2],[1,3],[2,2],[4]] compUniq 5 == [[1,1,1,1,1],[1,1,1,2],[1,1,3],[2,1,2],[1,4],[2,3],[5]] hmt6Generates all partitions of n with parts in the set e. $parta 8 [2,3] == [[2,2,2,2],[3,2,3]] hmtGenerate all compositions of n. comp 4 == [[1,1,1,1],[1,1,2],[1,2,1],[2,1,1],[1,3],[3,1],[2,2],[4]] length (comp 8) == 128 hmt-Generates all compositions of n into k parts. compm 3 6 == [[1,1,4],[1,4,1],[4,1,1],[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1],[2,2,2]] length (compm 5 16) == 1365 hmtGenerates all compositions of n with parts in the set (p1 p2 ... pk). (compa 8 [3,4,5,6] == [[3,5],[5,3],[4,4]] hmtGenerates all compositions of n with m parts in the set (p1 p2 ... pk). compam 4 16 [3,4,5] hmt-Generates all binary necklaces of length n. http://combos.org/necklace neck 5 == [[1,1,1,1,1],[1,1,1,1,0],[1,1,0,1,0],[1,1,1,0,0],[1,0,1,0,0],[1,1,0,0,0],[1,0,0,0,0],[0,0,0,0,0]] hmt7Generates all binary necklaces of length n with m ones. neckm 8 2 == [[1,0,0,0,1,0,0,0],[1,0,0,1,0,0,0,0],[1,0,1,0,0,0,0,0],[1,1,0,0,0,0,0,0]] hmtPart is the length of a substring 10...0 composing the necklace. For example the necklace 10100 has parts of size 2 and 3. necklaceParts [1,0,1,0,0] == [2,3] necklaceParts [0,0,0,0,0,0,0,0] == [] hmt;Generates all binary necklaces of length n with parts in e. necka 8 [2,3,4] == [[1,0,1,0,1,0,1,0],[1,0,1,0,0,1,0,0],[1,0,1,0,1,0,0,0],[1,0,0,0,1,0,0,0]] hmtGenerates all binary necklaces of length n with m ones and parts in e. hmtGenerates all permutations of the non-negative integers in the set. permi [1,2,3] == [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]  & Safe-Inferred( hmtFunction to test is a partial sequence conforms to the target sequence. hmtFunction to perhaps generate an element and a new state from an initial state. This is the function provided to  . hmt Description notation of contour. hmt!Half matrix notation for contour. hmtA list notation for matrices. hmtConstruct set of n   1$ adjacent indices, left right order. /adjacent_indices 5 == [(0,1),(1,2),(2,3),(3,4)] hmtAll (i,j) indices, in half matrix order. 6all_indices 4 == [(0,1),(0,2),(0,3),(1,2),(1,3),(2,3)] hmtApply f to construct   from sequence. matrix_f (,) [1..3] == [[(1,1),(1,2),(1,3)] ,[(2,1),(2,2),(2,3)] ,[(3,1),(3,2),(3,3)]] hmt Construct   with  (p.263). ;contour_matrix [1..3] == [[EQ,LT,LT],[GT,EQ,LT],[GT,GT,EQ]] hmtHalf  & of contour given comparison function f. half_matrix_f (flip (-)) [2,10,6,7] == [[8,4,5],[-4,-3],[1]] half_matrix_f (flip (-)) [5,0,3,2] == [[-5,-2,-3],[3,2],[-1]] half_matrix_f compare [5,0,3,2] == [[GT,GT,GT],[LT,LT],[GT]] hmt Construct   (p.264) hmt  function for  . hmt Construct   of contour (p.264). let c = [[3,2,4,1],[3,2,1,4]] in map (show.contour_description) c == ["202 02 2","220 20 0"] hmt  function for   (p.264). hmt Convert from   notation to  . hmtOrdering from ith to j$th element of sequence described at d. ?contour_description_ix (contour_description "abdc") (0,3) == LT hmt2 if contour is all descending, equal or ascending. let c = ["abc","bbb","cba"] in map (uniform.contour_description) c == [True,True,True] hmt" if contour does not containt any   elements. let c = ["abc","bbb","cba"] map (no_equalities.contour_description) c == [True,False,True] hmt Set of all contour descriptions. 3map (length.all_contours) [3,4,5] == [27,729,59049] hmtA sequence of orderings (i,j) and (j,k) may imply ordering for (i,k). map implication [(LT,EQ),(EQ,EQ),(EQ,GT)] == [Just LT,Just EQ,Just GT] hmtList of all violations at a   (p.266). hmtIs the number of   zero. hmt!All possible contour descriptions 5map (length.possible_contours) [3,4,5] == [13,75,541] hmt#All impossible contour descriptions :map (length.impossible_contours) [3,4,5] == [14,654,58508] hmt9Calculate number of contours of indicated degree (p.263). 5map contour_description_lm [2..7] == [1,3,6,10,15,21] let r = [3,27,729,59049,14348907] in map (\n -> 3 ^ n) (map contour_description_lm [2..6]) == r hmt Truncate a   to have at most n elements. let c = contour_description [3,2,4,1] in contour_truncate c 3 == contour_description [3,2,4] hmtIs   p a prefix of q. let {c = contour_description [3,2,4,1] ;d = contour_description [3,2,4]} in d `contour_is_prefix_of` c == True hmtAre  s p and q equal at column n. let {c = contour_description [3,2,4,1,5] ;d = contour_description [3,2,4,1]} in map (contour_eq_at c d) [0..4] == [True,True,True,True,False] hmt Derive an  % contour that would be described by  $. Diverges for impossible contours. 6draw_contour (contour_description "abdc") == [0,1,3,2] hmtInvert  . let c = contour_description "abdc" in draw_contour (contour_description_invert c) == [3,2,0,1] hmt Transform a   to produce at most n elements. let f i = Just (i,succ i) in unfoldr (build_f_n f) (5,'a') == "abcde" hmt#Attempt to construct a sequence of n elements given a  # to generate possible elements, a  < that the result sequence must conform to at each step, an   to specify the maximum number of elements to generate when searching for a solution, and an initial state. let {b_f i = Just (i,i+1) ;c_f i x = odd (sum x `div` i)} in build_sequence 6 b_f c_f 20 0 == (Just [1,2,6,11,15,19],20) hmtAttempt to construct a sequence that has a specified contour. The arguments are a  # to generate possible elements, a  / that the result sequence must conform to, an   to specify the maximum number of elements to generate when searching for a solution, and an initial state. import System.Random let {f = Just . randomR ('a','z') ;c = contour_description "atdez" ;st = mkStdGen 2347} in fst (build_contour f c 1024 st) == Just "nvruy" hmt A variant on   that retries a specified number of times using the final state of the failed attempt as the state for the next try. let {f = Just . randomR ('a','z') ;c = contour_description "atdezjh" ;st = mkStdGen 2347} in fst (build_contour_retry f c 64 8 st) == Just "nystzvu" hmt A variant on  4 that returns the set of all sequences constructed. let {f = Just . randomR ('a','z') ;c = contour_description "atdezjh" ;st = mkStdGen 2347} in length (build_contour_set f c 64 64 st) == 60 hmt Variant of   that halts when an generated sequence is a duplicate of an already generated sequence. let {f = randomR ('a','f') ;c = contour_description "cafe" ;st = mkStdGen 2346836 ;r = build_contour_set_nodup f c 64 64 st} in filter ("c" `isPrefixOf`) r == ["cafe","cbed","caed"] hmt+Example from p.262 (quarter-note durations) ex_1 == [2,3/2,1/2,1,2] compare_adjacent ex_1 == [GT,GT,LT,LT] show (contour_half_matrix ex_1) == "2221 220 00 0" draw_contour (contour_description ex_1) == [3,2,0,1,3] let d = contour_description_invert (contour_description ex_1) in (show d,is_possible d) == ("0001 002 22 2",True) hmtExample on p.265 (pitch) 9ex_2 == [0,5,3] show (contour_description ex_2) == "00 2" hmtExample on p.265 (pitch) ex_3 == [12,7,6,7,8,7] show (contour_description ex_3) == "22222 2101 000 01 2" contour_description_ix (contour_description ex_3) (0,5) == GT is_possible (contour_description ex_3) == True hmtExample on p.266 (impossible) show ex_4 == "2221 220 00 1" is_possible ex_4 == False violations ex_4 == [(0,3,4,GT),(1,3,4,GT)]. . ' Safe-Inferred $ hmt  () joins  ( equivalent intervals from morphologies m and n. hmt : () determines an interval given a sequence and an index. hmtDistance function, ordinarily n below is in  ,   or  . hmt   . hmt    . hmt   f. hmtSquare. hmt   f. hmt      f. hmt      f. hmtCity block metric, p.296 (city_block_metric (-) (1,2) (3,5) == 2+3 hmt(Two-dimensional euclidean metric, p.297. 0euclidean_metric_2 (-) (1,2) (3,5) == sqrt (4+9) hmtn-dimensional euclidean metric euclidean_metric_l (-) [1,2] [3,5] == sqrt (4+9) euclidean_metric_l (-) [1,2,3] [2,4,6] == sqrt (1+4+9) hmt Cube root. map cbrt [1,8,27] == [1,2,3] hmtn-th root "map (nthrt 4) [1,16,81] == [1,2,3] hmt'Two-dimensional Minkowski metric, p.297 minkowski_metric_2 (-) 1 (1,2) (3,5) == 5 minkowski_metric_2 (-) 2 (1,2) (3,5) == sqrt (4+9) minkowski_metric_2 (-) 3 (1,2) (3,5) == cbrt (8+27) hmtn-dimensional Minkowski metric minkowski_metric_l (-) 2 [1,2,3] [2,4,6] == sqrt (1+4+9) minkowski_metric_l (-) 3 [1,2,3] [2,4,6] == cbrt (1+8+27) hmt     . d_dx_abs (-) [0,2,4,1,0] == [2,2,3,1] d_dx_abs (-) [2,3,0,4,1] == [1,3,4,3] hmt*Ordered linear magnitude (no delta), p.300 -olm_no_delta' [0,2,4,1,0] [2,3,0,4,1] == 1.25 hmt-Ordered linear magintude (general form) p.302 olm_general (abs_of (-)) [0,2,4,1,0] [2,3,0,4,1] == 1.25 olm_general (abs_of (-)) [1,5,12,2,9,6] [7,6,4,9,8,1] == 4.6 hmtf at indices i and i+1 of x. 5map (ix_dif (-) [0,1,3,6,10]) [0..3] == [-1,-2,-3,-4] hmt    4map (abs_ix_dif (-) [0,2,4,1,0]) [0..3] == [2,2,3,1] hmt    map (sqr_abs_ix_dif (-) [0,2,4,1,0]) [0..3] == [4,4,9,1] map (sqr_abs_ix_dif (-) [2,3,0,4,1]) [0..3] == [1,9,16,9] hmt:Ordered linear magintude (generalised-interval form) p.305 olm (abs_of dif_r) (abs_ix_dif dif_r) (const 1) [1,5,12,2,9,6] [7,6,4,9,8,1] == 4.6 olm (abs_of dif_r) (abs_ix_dif dif_r) maximum [1,5,12,2,9,6] [7,6,4,9,8,1] == 0.46 hmt(Second order binomial coefficient, p.307 map second_order_binonial_coefficient [2..10] == [1,3,6,10,15,21,28,36,45] hmt  of   . direction_interval [5,9,3,2] == [LT,GT,GT] direction_interval [2,5,6,6] == [LT,LT,EQ] hmtHistogram of list of  s. ord_hist [LT,GT,GT] == (1,0,2) hmt Histogram of  directions of adjacent elements, p.312. direction_vector [5,9,3,2] == (1,0,2) direction_vector [2,5,6,6] == (2,1,0) hmt*Unordered linear direction, p.311 (Fig. 5) ?uld [5,9,3,2] [2,5,6,6] == 2/3 uld [5,3,6,1,4] [3,6,1,4,2] == 0 hmtOrdered linear direction, p.312 direction_interval [5,3,6,1,4] == [GT,LT,GT,LT] direction_interval [3,6,1,4,2] == [LT,GT,LT,GT] old [5,3,6,1,4] [3,6,1,4,2] == 1 hmt&Ordered combinatorial direction, p.314 ocd [5,9,3,2] [2,5,6,6] == 5/6 ocd [5,3,6,1,4] [3,6,1,4,2] == 4/5 hmt(Unordered combinatorial direction, p.314 ucd [5,9,3,2] [2,5,6,6] == 5/6 ucd [5,3,6,1,4] [3,6,1,4,2] == 0 ucd [5,3,7,6] [2,1,2,1] == 1/2 ucd [2,1,2,1] [8,3,5,4] == 1/3 ucd [5,3,7,6] [8,3,5,4] == 1/3 hmt , Fig.9, p.318 let r = [[2,3,1,4],[1,3,6],[4,7],[3]] combinatorial_magnitude_matrix (abs_of (-)) [5,3,2,6,9] == r hmt2Unordered linear magnitude (simplified), p.320-321 let r = abs (sum [5,4,3,6] - sum [12,2,11,7]) / 4 ulm_simplified (abs_of (-)) [1,6,2,5,11] [3,15,13,2,9] == r =ulm_simplified (abs_of (-)) [1,5,12,2,9,6] [7,6,4,9,8,1] == 3 hmt,Ordered combinatorial magnitude (OCM), p.323 ocm (abs_of (-)) [1,6,2,5,11] [3,15,13,2,9] == 5.2 ocm (abs_of (-)) [1,5,12,2,9,6] [7,6,4,9,8,1] == 3.6 hmt,Ordered combinatorial magnitude (OCM), p.323 ocm_absolute_scaled (abs_of (-)) [1,6,2,5,11] [3,15,13,2,9] == 0.4 ocm_absolute_scaled (abs_of (-)) [1,5,12,2,9,6] [7,6,4,9,8,1] == 54/(15*11)* * ( Safe-Inferred   ) Safe-Inferred hmt Element of "(sequence,multiplier,displacement). hmtTiling (sequence) hmtVoice. hmt Canon of +(period,sequence,multipliers,displacements). hmt Sequence. hmt Cycle at period. 8take 9 (p_cycle 18 [0,2,5]) == [0,2,5,18,20,23,36,38,41] hmtResolve sequence from  . e_to_seq ([0,2,5],2,1) == [1,5,11] e_to_seq ([0,1],3,4) == [4,7] e_to_seq ([0],1,2) == [2] hmtInfer   from sequence. e_from_seq [1,5,11] == ([0,2,5],2,1) e_from_seq [4,7] == ([0,1],3,4) e_from_seq [2] == ([0],1,2) hmtSet of   from  . hmt of  . hmtRetrograde of   , the result   is sorted. let r = [[0,7,14],[1,5,9],[2,4,6],[3,8,13],[10,11,12]] t_retrograde [[0,7,14],[1,6,11],[2,3,4],[5,9,13],[8,10,12]] == r hmtThe normal form of   is the   of t and it's  . let r = [[0,7,14],[1,5,9],[2,4,6],[3,8,13],[10,11,12]] t_normal [[0,7,14],[1,6,11],[2,3,4],[5,9,13],[8,10,12]] == r hmtDerive set of   from  . let r = [(21,[0,1,2],[10,8,2,4,7,5,1],[0,1,2,3,5,8,14])] let t = [[0,10,20],[1,9,17],[2,4,6],[3,7,11],[5,12,19],[8,13,18],[14,15,16]] r_from_t t == r hmt   . (L.observeAll (fromList [1..7]) == [1..7] hmt Search for perfect tilings of the sequence   using multipliers from m to degree n with k parts. hmt  of  of  . (perfect_tilings [[0,1]] [1..3] 6 3 == [] let r = [[[0,7,14],[1,5,9],[2,4,6],[3,8,13],[10,11,12]]] perfect_tilings [[0,1,2]] [1,2,4,5,7] 15 5 == r 4length (perfect_tilings [[0,1,2]] [1..12] 15 5) == 1 let r = [[[0,1],[2,5],[3,7],[4,6]], [[0,1],[2,6],[3,5],[4,7]] ,[[0,2],[1,4],[3,7],[5,6]]] perfect_tilings [[0,1]] [1..4] 8 4 == r let r = [[[0,1],[2,5],[3,7],[4,9],[6,8]] ,[[0,1],[2,7],[3,5],[4,8],[6,9]] ,[[0,2],[1,4],[3,8],[5,9],[6,7]] ,[[0,2],[1,5],[3,6],[4,9],[7,8]] ,[[0,3],[1,6],[2,4],[5,9],[7,8]]] in perfect_tilings [[0,1]] [1..5] 10 5 == rJohnson 2004, p.2 let r = [[0,6,12],[1,8,15],[2,11,20],[3,5,7],[4,9,14],[10,13,16],[17,18,19]] perfect_tilings [[0,1,2]] [1,2,3,5,6,7,9] 21 7 == [r] let r = [[0,10,20],[1,9,17],[2,4,6],[3,7,11],[5,12,19],[8,13,18],[14,15,16]] perfect_tilings [[0,1,2]] [1,2,4,5,7,8,10] 21 7 == [t_retrograde r] hmt Variant of  4 for ordered sequences, which can therefore return  # when searching infinite sequences. <5 `elemOrd` [0,2..] == False && 10 `elemOrd` [0,2..] == True hmtA .* diagram of n places of  . -v_dot_star 18 [0,2..] == "*.*.*.*.*.*.*.*.*." hmt#A white space and index diagram of n places of  .1mapM_ (putStrLn . v_space_ix 9) [[0,2..],[1,3..]]>> 0 2 4 6 8> 1 3 5 7 hmtInsert | every n places. =with_bars 6 (v_dot_star 18 [0,2..]) == "*.*.*.|*.*.*.|*.*.*." hmtVariant with measure length m and number of measures n. 2v_dot_star_m 6 3 [0,2..] == "*.*.*.|*.*.*.|*.*.*." hmtPrint .* diagram. hmtVariant to print | at measures. hmtVariant that discards first k measures.  * Safe-Inferred  hmt{0,1,2} order 5, p.1v_print 15 (r_voices p1)>> ..***..........> ........*.*.*..> .....*...*...*.> .*....*....*...> *......*......* hmt{0,1,2} order 7, p.2v_print 21 (r_voices p2)>> ..............***....> ..*.*.*..............> ...*...*...*.........> ........*....*....*..> .....*......*......*.> .*.......*.......*...> *.........*.........* hmt{0,1} order 4, p.3v_print 8 (r_voices p3)> > *...*... > .**..... > ...*..*. > .....*.* hmt{0,1} order 5, p.4 mapM_ (v_print 10 . r_voices) p4> > *...*..... > .**....... > ...*....*. > .....*.*.. > ......*..*> > *....*.... > .**....... > ...*..*... > ....*...*. > .......*.*> > *...*..... > .*....*... > ..**...... > .....*..*. > .......*.* hmtOpen {1,2,3} order 5, p.4v_print 18 (r_voices p4_b)>> ...***............> ........*.*.*.....> .........*...*...*> .*....*....*......> *......*......*...  + Safe-Inferred% hmtTilework for Clarinet, p.3v_print 36 (rr_voices p3)>&> *.*..*............*.*..*............&> .*.*..*............*.*..*...........&> ........*.*..*............*.*..*....&> ....*..*.*............*..*.*........&> ...........*..*.*............*..*.*.&> ............*..*.*............*..*.* hmt Tilework for String Quartet, p.5 mapM_ (v_print 24 . r_voices) p5 >> ******......******......> ......******......******>> *.****.*....*.****.*....> ......*.****.*....*.****>> **.***..*...**.***..*...> ......**.***..*...**.***>> *..***.**...*..***.**...> ......*..***.**...*..*** hmtExtra Perfect (p.7)#v_print_m_from 18 6 6 (r_voices p7) >+> **.*..|......|......|......|......|......+> ......|.*.*..|.*....|......|......|......+> ......|......|......|......|.*..*.|....*.+> ......|......|...*..|.*....|...*..|......+> ......|......|....*.|...*..|......|.*....+> ......|*.....|*.....|......|*.....|......+> ....*.|......|......|*.....|......|...*..+> ......|......|......|....*.|......|*..... hmt#Tilework for Log Drums (2005), p.10v_print 18 (r_voices p10)>> *.*.*.............> .*...*...*........> ...*...*...*......> ......*...*...*...> ........*...*...*.> .............*.*.* hmt"Self-Similar Melodies (1996), p.11v_print_m 20 5 (r_voices p11)>> *.....*.....*..*..*.|....*.....*.....*...|..*..*..*.....*.....|*.....*.....*..*..*.|....*.....*.....*...> ....................|*.....*.....*..*..*.|....*.....*.....*...|..*..*..*.....*.....|*.....*.....*..*..*.> ....................|....................|*.....*.....*..*..*.|....*.....*.....*...|..*..*..*.....*.....  , Safe-Inferred9G hmtLinear form of  , an ascending sequence of  . hmt Linear term. hmtLinear state.   is the start time of the term.   is the active tempo & therefore the reciprocal of the duration.   is the part label. hmtVoices are named as a sequence of left and right directions within nested  & structures. l is left and r is right. hmt Time point. hmtRecursive temporal structure. hmt Leaf node hmtIsolate hmtSequence hmtParallel hmtTempo multiplier hmt3Terms are the leaf nodes of the temporal structure. hmt%Tempo is rational. The duration of a   is the reciprocal of the   that is in place at the  . hmt Types of   nodes. hmtThe different  & modes are indicated by bracket types. hmtInverse of par_mode_brackets hmtValue of Term, else Nothing hmtGiven a Par mode, generate either: 1. an Iso, 2. a Par, 3. a series of nested Par. hmtPretty printer for  , given pretty printer for the term type. Note this does not write nested Par nodes in their simplified form. hmt  of . hmt=Analyse a Par node giving (duration,LHS-tempo-*,RHS-tempo-*). par_analyse 1 Par_Left (nseq "cd") (nseq "efg") == (2,1,3/2) par_analyse 1 Par_Right (nseq "cd") (nseq "efg") == (3,2/3,1) par_analyse 1 Par_Min (nseq "cd") (nseq "efg") == (2,1,3/2) par_analyse 1 Par_Max (nseq "cd") (nseq "efg") == (3,2/3,1) par_analyse 1 Par_None (nseq "cd") (nseq "efg") == (3,1,1) hmtDuration element of  . hmt&Calculate final tempo and duration of  . hmt  of  . hmtStart time of  . hmt Duration of   (reciprocal of tempo). hmt End time of  . hmt Voice of  . hmtTerm of L_Term hmtValue of Term of L_Term hmt Linearise   given initial  , ascending by construction. hmtMerge two ascending  . hmtSet of unique   at  . hmt Multiply   by n , and divide   by n. hmtThe multiplier that will normalise an L_Bel value. After normalisation all start times and durations are integral. hmt3Calculate and apply L_Bel normalisation multiplier. hmtAll leftmost voices are re-written to the last non-left turning point. map voice_normalise ["","l","ll","lll"] == replicate 4 "" voice_normalise "lllrlrl" == "rlrl" hmt    hmtUnique  s at  . hmtThe duration of  . hmt Locate an  ! that is active at the indicated   and in the indicated  . hmt#Calculate grid (phase diagram) for  . hmt  of  . hmtBel type phase diagram for   of 0. Optionally print whitespace between columns. hmt  of  . hmtInfix form for  . hmt  of  . lseq [Node Rest] == Node Rest lseq [Node Rest,Node Continue] == Seq (Node Rest) (Node Continue) hmt  of  . hmt  of  hmt Variant of   where _ is read as   and - as  . hmt  of  , this is the default  . hmt  of  . hmt  of   of  . hmt Verify that   of   is  . hmtRun  , and print both   and  . 3bel_ascii_pp "{i{ab,c[d,oh]e,sr{p,qr}},{jk,ghjkj}}" hmtParse    . P.parse p_rest "" "-" hmtParse    . P.parse p_nrests "" "3" hmtParse    . P.parse p_continue "" "_" hmtParse     . P.parse p_char_value "" "a" hmtParse   . &P.parse (P.many1 p_char_term) "" "-_a" hmtParse   . &P.parse (P.many1 p_char_node) "" "-_a" hmtParse non-negative  . %P.parse p_non_negative_integer "" "3" hmtParse non-negative  . P.parse (p_non_negative_rational `P.sepBy` (P.char ',')) "" "3%5,2/3" hmtParse non-negative  . P.parse p_non_negative_double "" "3.5" P.parse (p_non_negative_double `P.sepBy` (P.char ',')) "" "3.5,7.2,1.0" hmtParse non-negative number as  . P.parse (p_non_negative_number `P.sepBy` (P.char ',')) "" "7%2,3.5,3" hmtParse  . #P.parse (P.many1 p_mul) "" "/3*3/2" hmtGiven parser for   a , generate   parser. hmt  of  . P.parse p_char_iso "" "{abcde}" hmtGiven parser for   a , generate   parser. hmt  of  . p = P.parse p_char_par "" p "{ab,{c,de}}" == p "{ab,c,de}" p "{ab,~(c,de)}" hmtParse   . 'P.parse (P.many1 p_char_bel) "" "-_a*3" hmtRun parser for   of . - Safe-InferredB hmt A note with all fields required. hmtA note where all fields are optional. If the note number is absent it indicates a rest. All other fields infer values from the phrase context. hmtA  parser with no user state. hmt:Run parser and return either an error string or an answer. hmtRun parser and report any error. Does not delete leading spaces. hmt$Run p then q, returning result of p. hmtThe octave key can be elided, ordinarily directly after the note name, ie. c2. hmtIf t is set and is at the end time of the previous note print a preceding comma, else print t annotation. c = kk_empty_contextual_note {kk_contextual_note_number = Just 0, kk_contextual_time = Just 96} map (\t -> kk_contextual_note_pp (t, c)) [0, 96] == ["ct96",", c"] hmtIf the note number is given as p60, then derive octave of and set it, ignoring any modifier. Note that in KeyKit c3 is p60 or middle c. hmt0A contextual note and an is_parallel? indicator. hmt Elide octave modifier character. hmt>This should, but does not, append a trailing rest as required. hmtRests are elided, their duration is accounted for in the time of the following notetaken into account. hmtIn addition to contextual note give end time of previous note, to allow for sequence (comma) notation. hmtRead KeyKit phrase constant. let rw = (\p -> (kk_phrase_pp p, kk_phrase_length p)) . kk_phrase_read rw "c" == ("c3v63d96c1t0",96) rw "c, r" == ("c3v63d96c1t0",192) rw "c, r, c3, r, p60" == ("c3v63d96c1t0 c3v63d96c1t192 c3v63d96c1t384",480) rw "c, e, g" == ("c3v63d96c1t0 e3v63d96c1t96 g3v63d96c1t192",288) rw "c2" == rw "co2" hmt"Re-contextualise and print phrase. rw = kk_phrase_print . kk_phrase_read rw_id i = rw i == i rw_id "c" rw_id "c e g" rw_id "c , e , g" rw_id "c e g , c f a , c e g , c e- g" rw_id "c , e , g c4t384" rw "c, r, c3, r, p60" == "c ct192 ct384" rw "c , e , g c4t288" == "c , e , g , c4" rw "c r" == "c" -- ?8 8 . Safe-Inferred hmtContainer to mark the begin and end of a value. hmt Variant of   where nodes have an Intepolation_T value. hmtIterpolation type enumeration. hmtEvent sequence. t is a triple of  start-time, duration and length. length isn't necessarily the time to the next event, though ordinarily it should not be greater than that interval. hmtWindow sequence. t is a duple of  start-time and duration. Holes exist where /start-time(n) + duration(n) < start-time(n + 1)-. Overlaps exist where the same relation is  . hmtTime-point sequence. t3 is the start time of the value. To express holes a must have an empty$ value. Duration can be encoded at a, or if implicit a' must include an end of sequence value. hmt/Pattern sequence. The duration is a triple of logical, sounding and forward durations. These indicate the time the value conceptually takes, the time it actually takes, and the time to the next event. If the sequence does not begin at time zero there must be an empty value for a. hmtInter-offset sequence. t is the interval before( the value. Duration can be encoded at a, or if implicit a' must include an end of sequence value. hmtDuration sequence. t indicates the forward duration of the value, ie. the interval to the next value. If there are other durations they must be encoded at a. If the sequence does not begin at time zero there must be an empty value for a. hmt+Sequence of elements with uniform duration. hmt Construct  . hmt Construct  . hmtGiven functions for deriving start and end times calculate time span of sequence. Requires sequence be finite. seq_tspan id id [] == (0,0) seq_tspan id id (zip [0..9] ['a'..]) == (0,9) hmt  for  . hmt  for  . hmtStart time of sequence. 0wseq_start [((1,2),'a')] == 1 wseq_start [] == 0 hmtEnd time of sequence. wseq_end [((1,2),'a')] == 3 wseq_end (useq_to_wseq 0 (1,"linear")) == 6 hmtSum durations at  -, result is the end time of the last element. hmtSum durations at  /, result is the start time of the last element. hmtSum durations at  -, result is the end time of the last element. hmtThe interval of  , ie. from the start of the first element to the start of the last. "tseq_dur (zip [0..] "abcde|") == 5 hmtThe interval of  , ie. from the start of the first element to the end of the last. 2wseq_dur (zip (zip [0..] (repeat 2)) "abcde") == 6 hmtPrefix of sequence where the start time precedes or is at the indicated time. hmtKeep only elements that are entirely contained within the indicated temporal window, which is inclusive at the left & right edges, ie. [t0,t1]. Halts processing at end of window. let r = [((5,1),'e'),((6,1),'f'),((7,1),'g'),((8,1),'h')] wseq_twindow (5,9) (zip (zip [1..] (repeat 1)) ['a'..]) == r =wseq_twindow (1,2) [((1,1),'a'),((1,2),'b')] == [((1,1),'a')] hmtSelect nodes that are active at indicated time, comparison is inclusive at left and exclusive at right. Halts processing at end of window. let sq = [((1,1),'a'),((1,2),'b')] map (wseq_at sq) [1,2] == [sq,[((1,2),'b')]] ?wseq_at (zip (zip [1..] (repeat 1)) ['a'..]) 3 == [((3,1),'c')] hmtSelect nodes that are active within the indicated window, comparison is inclusive at left and exclusive at right. Halts processing at end of window. let sq = [((0,2),'a'),((0,4),'b'),((2,4),'c')] wseq_at_window sq (1,3) == sq wseq_at_window (zip (zip [1..] (repeat 1)) ['a'..]) (3,4) == [((3,1),'c'),((4,1),'d')] hmtType specialised  hmtType specialised  hmtType specialised  hmtMerge comparing only on time. hmt,Merge, where times are equal compare values. hmt#Merge, where times are equal apply f to form a single value. let {p = zip [1,3,5] "abc" ;q = zip [1,2,3] "ABC" ;left_r = [(1,'a'),(2,'B'),(3,'b'),(5,'c')] ;right_r = [(1,'A'),(2,'B'),(3,'C'),(5,'c')]} in tseq_merge_resolve (\x _ -> x) p q == left_r && tseq_merge_resolve (\_ x -> x) p q == right_r hmt.Compare first by start time, then by duration. hmt#Merge considering only start times. hmt3Merge set considering both start times & durations. hmt#Merge considering only start times. hmt5Locate nodes to the left and right of indicated time. hmtLinear interpolation. The Real constraint on t is to allow conversion from t to e (realToFrac). hmt Temporal map. hmtThis can give  if t precedes the   or if t is after the final element of  8 and that element has an interpolation type other than  . hmt ing variant. hmt over time (t) data. hmt over element (e) data. hmt t and e simultaneously. seq_bimap negate succ (zip [1..5] [0..4]) == [(-1,1),(-2,2),(-3,3),(-4,4),(-5,5)] hmt  over time (t) data. hmt  over element (e) data. hmt  over element (e) data. hmt  variant. hmt Variant of  . hmt8If value is unchanged at subsequent entry, according to f, replace with . hmt  . let r = [(1,'s'),(2,'t'),(4,'r'),(6,'i'),(7,'n'),(9,'g')] seq_cat_maybes (seq_changed (zip [1..] "sttrrinng")) == r hmtApply f at time points of  . hmtApply f at durations of elements of  . hmt#Given a function that determines a voice0 for a value, partition a sequence into voices. hmtType specialised  . let p = zip [0,1,3,5] (zip (repeat 0) "abcd") let q = zip [2,4,6,7] (zip (repeat 1) "ABCD") let sq = tseq_merge p q tseq_partition fst sq == [(0,p),(1,q)] hmtType specialised  . hmtGiven a decision predicate and a join function, recursively join adjacent elements. coalesce_f undefined undefined [] == [] coalesce_f (==) const "abbcccbba" == "abcba" coalesce_f (==) (+) [1,2,2,3,3,3] == [1,4,6,3] hmt  using   for the join function. hmtForm of  $ where the join predicate is on the element only, the times are summed. hmtForm of  7 where both the decision and join predicates are on theelement, the times are summed. let r = [(1,'a'),(2,'b'),(3,'c'),(2,'d'),(1,'e')] seq_coalesce (==) const (useq_to_dseq (1,"abbcccdde")) == r hmtGiven equality predicate, simplify sequence by summing durations of adjacent equal' elements. This is a special case of   where the join function is  4. The implementation is simpler and non-recursive. let d = useq_to_dseq (1,"abbcccdde") let r = dseq_coalesce (==) const d dseq_coalesce' (==) d == r hmtType specialised  . hmt Post-process   of cmp    . let r = [(0,"a"),(1,"bc"),(2,"de"),(3,"f")] group_f (==) (zip [0,1,1,2,2,3] ['a'..]) == r hmt"Group values at equal time points. let r = [(0,"a"),(1,"bc"),(2,"de"),(3,"f")] tseq_group (zip [0,1,1,2,2,3] ['a'..]) == r tseq_group [(1,'a'),(1,'b')] == [(1,"ab")] tseq_group [(1,'a'),(2,'b'),(2,'c')] == [(1,"a"),(2,"bc")] hmt,Group values where the inter-offset time is 0 to the left. let r = [(0,"a"),(1,"bcd"),(1,"ef")] iseq_group (zip [0,1,0,0,1,0] ['a'..]) == r hmtSet durations so that there are no gaps or overlaps. For entries with the same start time this leads to zero durations. let r = wseq_zip [0,3,3,5] [3,0,2,1] "abcd" wseq_fill_dur (wseq_zip [0,3,3,5] [2,1,2,1] "abcd") == r hmt0Scale by lcm so that all durations are integral. hmt,End-time of sequence (ie. sum of durations). hmtGiven a a default value, a   sq and a list of time-points t7, generate a Tseq that is a union of the timepoints at sq and t where times in t not at sq are given the current value, or def if there is no value. =tseq_latch 'a' [(2,'b'),(4,'c')] [1..5] == zip [1..5] "abbcc" hmt.End-time of sequence (ie. time of last event). hmtAppend the value nil at n' seconds after the end of the sequence. hmtSort   by start time,  ! ought never to be out of order. wseq_sort [((3,1),'a'),((1,3),'b')] == [((1,3),'b'),((3,1),'a')] hmt Transform   to   by discarding durations. hmtAre e equal and do nodes overlap? Nodes are ascending, and so overlap if: 1. they begin at the same time and the first has non-zero duration, or 2. the second begins before the first ends. hmtFind first node at sq that overlaps with e0, if there is one. Note: this could, but does not, halt early, ie. when t2 > (t1 + d1). hmtDetermine if sequence has any overlapping equal nodes, stops after finding first instance. wseq_has_overlaps (==) [] == False wseq_has_overlaps (==) [((0,1),'x')] hmt2Remove overlaps by deleting any overlapping nodes. let sq = [((0,1),'a'),((0,5),'a'),((1,5),'a'),((3,1),'a')] wseq_has_overlaps (==) sq == True let sq_rw = wseq_remove_overlaps_rm (==) sq sq_rw == [((0,1),'a'),((1,5),'a')] wseq_has_overlaps (==) sq_rw hmt"Find first instance of overlap of e at sq and re-write durations so nodes don't overlap. If equal nodes begin simultaneously delete the shorter node (eithe LHS or RHS). If a node extends into a later node shorten the initial (LHS) duration (apply dur_fn to iot). hmtRun   until sequence has no overlaps. let sq = [((0,1),'a'),((0,5),'a'),((1,5),'a'),((3,1),'a')] wseq_has_overlaps (==) sq == True let sq_rw = wseq_remove_overlaps_rw (==) id sq sq_rw == [((0,1),'a'),((1,2),'a'),((3,1),'a')] wseq_has_overlaps (==) sq_rw == False import qualified Music.Theory.Array.Csv.Midi.Mnd as T let csv_fn = "/home/rohan/uc/the-center-is-between-us/visitants/csv/midi/air.B.1.csv" sq <- T.csv_midi_read_wseq csv_fn :: IO (Wseq Double (T.Event Double)) length sq == 186 length (wseq_remove_overlaps_rw (==) id sq) == 183 hmt;Unjoin elements (assign equal time stamps to all elements). hmtType specialised  . hmt Shift (displace) onset times by i. +wseq_shift 3 [((1,2),'a')] == [((4,2),'a')] hmtShift q to end of p and append. wseq_append [((1,2),'a')] [((1,2),'b')] == [((1,2),'a'),((4,2),'b')] hmt  of  wseq_concat [[((1,2),'a')],[((1,2),'b')]] == [((1,2),'a'),((4,2),'b')] hmt)Transform sequence to start at time zero. hmtFunctor instance. hmtStructural comparison at  ,   compares less than  . hmtTranslate container types. hmtTranslate container types. hmtEquivalent to partitionEithers. hmtAdd or delete element from accumulated state given equality function. hmt  of . hmtConvert   to   transforming elements to  . When merging, end elements precede begin elements at equal times. let sq = [((0,5),'a'),((2,2),'b')] let r = [(0,Begin 'a'),(2,Begin 'b'),(4,End 'b'),(5,End 'a')] wseq_begin_end sq == r let sq = [((0,1),'a'),((1,1),'b'),((2,1),'c')] let r = [(0,Begin 'a'),(1,End 'a'),(1,Begin 'b'),(2,End 'b'),(2,Begin 'c'),(3,End 'c')] wseq_begin_end sq == r hmt  of  . hmtVariant that applies begin and end functions to nodes. let sq = [((0,5),'a'),((2,2),'b')] let r = [(0,'A'),(2,'B'),(4,'b'),(5,'a')] wseq_begin_end_f Data.Char.toUpper id sq == r hmtGenerate for each time-point the triple (begin-list,end-list,hold-list). The elements of the end-list have been deleted from the hold list. hmt"Variant that initially transforms   into non-overlapping begin-end sequence. If the sequence was edited for overlaps this is indicated. hmtThe transition sequence of active elements. let w = [((0,3),'a'),((1,2),'b'),((2,1),'c'),((3,3),'d')] wseq_accumulate w == [(0,"a"),(1,"ba"),(2,"cba"),(3,"d"),(6,"")] hmt Inverse of  . given a predicate function for locating the end node of a begin node. let sq = [(0,Begin 'a'),(2,Begin 'b'),(4,End 'b'),(5,End 'a')] let r = [((0,5),'a'),((2,2),'b')] tseq_begin_end_to_wseq (==) sq == r hmt+The conversion requires a start time and a nil value used as an eof4 marker. Productive given indefinite input sequence. let r = zip [0,1,3,6,8,9] "abcde|" dseq_to_tseq 0 '|' (zip [1,2,3,2,1] "abcde") == r let d = zip [1,2,3,2,1] "abcde" let r = zip [0,1,3,6,8,9,10] "abcdeab" take 7 (dseq_to_tseq 0 undefined (cycle d)) == r hmtVariant where the nil7 value is taken from the last element of the sequence. let r = zip [0,1,3,6,8,9] "abcdee" dseq_to_tseq_last 0 (zip [1,2,3,2,1] "abcde") == r hmt.Variant where the final duration is discarded. dseq_to_tseq_discard 0 (zip [1,2,3,2,1] "abcde") == zip [0,1,3,6,8] "abcde" hmt  to  , requires t0. let r = zip [1,3,6,8,9] "abcde" iseq_to_tseq 0 (zip [1,2,3,2,1] "abcde") == r hmt?The conversion requires a start time and does not consult the logical duration. let p = pseq_zip (repeat undefined) (cycle [1,2]) (cycle [1,1,2]) "abcdef" pseq_to_wseq 0 p == wseq_zip [0,1,2,4,5,6] (cycle [1,2]) "abcdef" hmtThe last element of   is required to be an eof< marker that has no duration and is not represented in the  . A nil value is required in case the   does not begin at 0. let r = zip [1,2,3,2,1] "abcde" tseq_to_dseq undefined (zip [0,1,3,6,8,9] "abcde|") == r let r = zip [1,2,3,2,1] "-abcd" tseq_to_dseq '-' (zip [1,3,6,8,9] "abcd|") == r hmtVariant that requires a final duration be provided, and that the Tseq have no end marker. let r = zip [1,2,3,2,9] "abcde" tseq_to_dseq_final_dur undefined 9 (zip [0,1,3,6,8] "abcde") == r hmtVariant that requires a total duration be provided, and that the Tseq have no end marker. let r = zip [1,2,3,2,7] "abcde" tseq_to_dseq_total_dur undefined 15 (zip [0,1,3,6,8] "abcde") hmtThe last element of   is required to be an eof< marker that has no duration and is not represented in the  . The duration of each value is either derived from the value, if a dur3 function is given, or else the inter-offset time. let r = wseq_zip [0,1,3,6,8] [1,2,3,2,1] "abcde" tseq_to_wseq Nothing (zip [0,1,3,6,8,9] "abcde|") == r let r = wseq_zip [0,1,3,6,8] (map fromEnum "abcde") "abcde" tseq_to_wseq (Just fromEnum) (zip [0,1,3,6,8,9] "abcde|") == r hmtTranslate Tseq to Wseq using inter-offset times, up to indicated total duration, as element durations. let r = [((0,1),'a'),((1,2),'b'),((3,3),'c'),((6,2),'d'),((8,3),'e')] tseq_to_wseq_iot 11 (zip [0,1,3,6,8] "abcde") == r hmt Tseq to Iseq. tseq_to_iseq (zip [0,1,3,6,8,9] "abcde|") == zip [0,1,2,3,2,1] "abcde|" hmtRequires start time. let r = zip (zip [0,1,3,6,8,9] [1,2,3,2,1]) "abcde" dseq_to_wseq 0 (zip [1,2,3,2,1] "abcde") == r hmt Inverse of  . The empty! value is used to fill holes in  . If values overlap at   durations are truncated. let w = wseq_zip [0,1,3,6,8,9] [1,2,3,2,1] "abcde" wseq_to_dseq '-' w == zip [1,2,3,2,1] "abcde" let w = wseq_zip [3,10] [6,2] "ab" wseq_to_dseq '-' w == zip [3,6,1,2] "-a-b" let w = wseq_zip [0,1] [2,2] "ab" wseq_to_dseq '-' w == zip [1,2] "ab" let w = wseq_zip [0,0,0] [2,2,2] "abc" wseq_to_dseq '-' w == zip [0,0,2] "abc" hmtGiven a list of  ! (measures) convert to a list of  + and the end time of the overall sequence. let r = [[(0,'a'),(1,'b'),(3,'c')],[(4,'d'),(7,'e'),(9,'f')]] dseql_to_tseql 0 [zip [1,2,1] "abc",zip [3,2,1] "def"] == (10,r) hmtList of cycles of  . hmt Only finite  / can be cycled, the resulting Wseq is infinite. -take 5 (wseq_cycle [((0,1),'a'),((3,3),'b')]) hmtVariant cycling only n times. (wseq_cycle_n 3 [((0,1),'a'),((3,3),'b')] hmt  of  . hmtRequires but does not check that there are no duplicate time points in Tseq. :tseq_to_map [(0, 'a'), (0, 'b')] == tseq_to_map [(0, 'b')]  / Safe-Inferred hmtIt is an un-checked invariant that the note list is in ascending order. hmtKeykit sets the length to the duration, i.e. ('c,e,g'%2).length is 192. hmt KeyKits p+q hmt KeyKits p|q? ? 0 Safe-Inferred hmtReturns an arpeggiated version of the phrase. One way of describing desc it is that all the notes have been separated and then put back together, back-to-back. phrase_arpeggio (wseq_to_phrase (zip (repeat (0,1)) [60, 64, 67])) hmtReturn phrase ph echoed num times, with rtime delay between each echo. hmtConvert a phrase to be in step time, ie. all notes with the same spacing and duration. Overlapped notes (no matter how small the overlap) are played at the same time. phrase_step (wseq_to_phrase [((0, 1), 60), ((5, 2), 64), ((23, 3), 67)]) 1 hmtThis function takes a phrase, splits in in 2 halves (along time) and shuffles the result (ie. first a note from the first half, then a note from the second half, etc.). The timing of the original phrase is applied to the result. ;phrase_to_wseq (phrase_shuffle (useq_to_phrase (1,[1..9])))  1 Safe-InferredC hmtMidi note/duration data. The type parameters are to allow for fractional note & velocity values. The command is a string, note, is standard, other commands may be present. unwords csv_mndd_hdr == "time duration message note velocity channel param" hmt((p0=midi-note,p1=velocity,channel,param) hmtMidi note data, the type parameters are to allow for fractional note & velocity values.The command is a string, on and off are standard, other commands may be present. note and velocity data is (0-127), channel is (0-15), param are ;-separated key:string=value:float. unwords csv_mnd_hdr == "time on/off note velocity channel param" all_notes_off = zipWith (\t k -> (t,"off",k,0,0,[])) [0.0,0.01 ..] [0 .. 127] csv_mnd_write 4 "/home/rohan/sw/hmt/data/csv/mnd/all-notes-off.csv" all_notes_off hmt Channel values are 4-bit (0-15). hmtIf r is whole to k/ places then show as integer, else as float to k places.hmt)The required header (column names) field.hmtMidi note data. let fn = "/home/rohan/cvs/uc/uc-26/daily-practice/2014-08-13.1.csv" let fn = "/home/rohan/sw/hmt/data/csv/mnd/1080-C01.csv" m <- csv_mnd_read fn :: IO [Mnd Double Int] length m -- 1800 17655 csv_mnd_write 4 "/tmp/t.csv" mhmtWriter.hmtmnn = midi-note-numberhmt ch = channelhmtAre events equal at mnn field?hmt&Are events equal at mnn and ch fields?hmt*Apply (mnn-f,vel-f,ch-f,param-f) to Event.hmtApply f at mnn and vel fields.hmtAdd x to mnn field.hmtTranslate from Tseq form to Wseq form.hmtIgnores non on/off messages.hmtTseq form of 8, channel information is retained, off-velocity is zero.hmtTseq form of  , data is .hmtMessage should be note for note data.hmtCompare sequence is: start-time,channel-number,note-number,velocity,duration,param.hmt,Pars midi note/duration data from Csv table.hmt of hmtWriter.hmtIgnores non note messages.hmtWseq form of .hmtWseq form of .hmtParse either Mnd or Mndd data to Wseq, Csv type is decided by header.& &    2 Safe-InferredhmtSkini data type of (message,time-stamp,channel,data-one,data-two)hmt+Skini allows delta or absolute time-stamps.  3 Safe-Inferred4 Safe-InferredhmtA rational time signature is a  where the parts are  .hmt,A composite time signature is a sequence of s.hmtA Time Signature is a (numerator,denominator) pair.hmt7Tied, non-multiplied durations to fill a whole measure. ts_whole_note (3,8) == [dotted_quarter_note] ts_whole_note (2,2) == [whole_note]hmtDuration of measure in . -map ts_whole_note_rq [(3,8),(2,2)] == [3/2,4]hmt Duration, in , of a measure of indicated . "map ts_rq [(3,4),(5,8)] == [3,5/2]hmt   .hmt% derived from whole note duration in  form. 8map rq_to_ts [4,3/2,7/4,6] == [(4,4),(3,8),(7,16),(6,4)]hmt#Uniform division of time signature. ts_divisions (3,4) == [1,1,1] ts_divisions (3,8) == [1/2,1/2,1/2] ts_divisions (2,2) == [2,2] ts_divisions (1,1) == [4] ts_divisions (7,4) == [1,1,1,1,1,1,1]hmtConvert a duration to a pulse count in relation to the indicated time signature. *ts_duration_pulses (3,8) quarter_note == 2hmt0Rewrite time signature to indicated denominator. ts_rewrite 8 (3,4) == (6,8)hmtSum time signatures.  ts_sum [(3,16),(1,2)] == (11,16)hmtThe  is the   of  of the elements. cts_rq [(3,4),(1,8)] == 3 + 1/2hmtThe divisions are the   of the  of the elements. *cts_divisions [(3,4),(1,8)] == [1,1,1,1/2]hmt1Pulses are 1-indexed, Rq locations are 0-indexed. map (cts_pulse_to_rq [(2,4),(1,8),(1,4)]) [1 .. 4] == [0,1,2,2 + 1/2]hmtVariant that gives the window9 of the pulse (ie. the start location and the duration). let r = [(0,1),(1,1),(2,1/2),(2 + 1/2,1)] in map (cts_pulse_to_rqw [(2,4),(1,8),(1,4)]) [1 .. 4] == rhmtThe   of the Rq of the elements. rts_rq [(3,4),(1,8)] == 3 + 1/2 rts_rq [(3/2,4),(1/2,8)] == 3/2 + 1/4hmtThe  divisions of the elements. rts_divisions [(3,4),(1,8)] == [1,1,1,1/2] rts_divisions [(3/2,4),(1/2,8)] == [1,1/2,1/4]hmt1Pulses are 1-indexed, Rq locations are 0-indexed. map (rts_pulse_to_rq [(2,4),(1,8),(1,4)]) [1 .. 4] == [0,1,2,2 + 1/2] map (rts_pulse_to_rq [(3/2,4),(1/2,8),(1/4,4)]) [1 .. 4] == [0,1,3/2,7/4]hmtVariant that gives the window9 of the pulse (ie. the start location and the duration). let r = [(0,1),(1,1),(2,1/2),(2 + 1/2,1)] in map (rts_pulse_to_rqw [(2,4),(1,8),(1,4)]) [1 .. 4] == r5 Safe-Inferredhmt7A tempo marking is in terms of a common music notation w.hmt:Duration of a Rq value, in seconds, given indicated tempo. *rq_to_seconds (quarter_note,90) 1 == 60/90hmtThe duration, in seconds, of a pulse at the indicated time signature and tempo marking. import Music.Theory.Duration.Name pulse_duration (6,8) (quarter_note,60) == 1/2hmtThe duration, in seconds, of a measure at the indicated time signaure and tempo marking. measure_duration (3,4) (quarter_note,90) == 2 measure_duration (6,8) (quarter_note,120) == 3/2hmt  variant of .hmtItalian terms and markings from Wittner metronome (W.-Germany). http://wittner-gmbh.de/hmtItalian terms and markings from Nikko Seiki metronome (Japan). http://nikkoseiki.com/hmtLookup metronome mark in table. 2mm_name metronome_table_nikko 72 == Just "Andante"6 Safe-Inferred5hmt Variant of  allowing multiple rules.hmtPredicate function at .hmtStructure given to . to decide simplification. The structure is  (ts,start-rq,(left-rq,right-rq)).hmt Applies a join= function to the first two elements of the list. If the join function succeeds the joined element is considered for further coalescing. .coalesce (\p q -> Just (p + q)) [1..5] == [15] let jn p q = if even p then Just (p + q) else Nothing coalesce jn [1..5] == map sum [[1],[2,3],[4,5]]hmt Variant of  with accumulation parameter.  Left (p + q)) 0 [1..5] == [(0,15)] let jn i p q = if even p then Left (p + q) else Right (p + i) coalesce_accum jn 0 [1..7] == [(0,1),(1,5),(6,9),(15,13)] let jn i p q = if even p then Left (p + q) else Right [p,q] coalesce_accum jn [] [1..5] == [([],1),([1,2],5),([5,4],9)]hmt Variant of  that accumulates running sum. let f i p q = if i == 1 then Just (p + q) else Nothing coalesce_sum (+) 0 f [1,1/2,1/4,1/4] == [1,1]hmtTake elements while the sum of the prefix is less than or equal to the indicated value. Returns also the difference between the prefix sum and the requested sum. Note that zero elements are kept left. take_sum_by id 3 [2,1] == ([2,1],0,[]) take_sum_by id 3 [2,2] == ([2],1,[2]) take_sum_by id 3 [2,1,0,1] == ([2,1,0],0,[1]) take_sum_by id 3 [4] == ([],3,[4]) take_sum_by id 0 [1..5] == ([],0,[1..5])hmt Variant of  with   function.hmt Variant of * that requires the prefix to sum to value. take_sum_by_eq id 3 [2,1,0,1] == Just ([2,1,0],[1]) take_sum_by_eq id 3 [2,2] == NothinghmtRecursive variant of . split_sum_by_eq id [3,3] [2,1,0,3] == Just [[2,1,0],[3]] split_sum_by_eq id [3,3] [2,2,2] == NothinghmtSplit sequence l( such that the prefix sums to precisely m. The third element of the result indicates if it was required to divide an element. Note that zero elements are kept left. If the required sum is non positive, or the input list does not sum to at least the required sum, gives nothing. split_sum 5 [2,3,1] == Just ([2,3],[1],Nothing) split_sum 5 [2,1,3] == Just ([2,1,2],[1],Just (2,1)) split_sum 2 [3/2,3/2,3/2] == Just ([3/2,1/2],[1,3/2],Just (1/2,1)) split_sum 6 [1..10] == Just ([1..3],[4..10],Nothing) fmap (\(a,_,c)->(a,c)) (split_sum 5 [1..]) == Just ([1,2,2],Just (2,1)) split_sum 0 [1..] == Nothing split_sum 3 [1,1] == Nothing split_sum 3 [2,1,0] == Just ([2,1,0],[],Nothing) split_sum 3 [2,1,0,1] == Just ([2,1,0],[1],Nothing)hmt Variant of  that operates at  sequences. t = True f = False r = Just ([(3,f),(2,t)],[(1,f)]) rqt_split_sum 5 [(3,f),(2,t),(1,f)] == r r = Just ([(3,f),(1,t)],[(1,t),(1,f)]) rqt_split_sum 4 [(3,f),(2,t),(1,f)] == r (rqt_split_sum 4 [(5/2,False)] == Nothinghmt Separate  values in sequences summing to , values. This is a recursive variant of #. Note that is does not ensure cmn notation of values. t = True f = False d = [(2,f),(2,f),(2,f)] r = [[(2,f),(1,t)],[(1,f),(2,f)]] rqt_separate [3,3] d == Right r d = [(5/8,f),(1,f),(3/8,f)] r = [[(5/8,f),(3/8,t)],[(5/8,f),(3/8,f)]] rqt_separate [1,1] d == Right r d = [(4/7,t),(1/7,f),(1,f),(6/7,f),(3/7,f)] r = [[(4/7,t),(1/7,f),(2/7,t)],[(5/7,f),(2/7,t)],[(4/7,f),(3/7,f)]] rqt_separate [1,1,1] d == Right rhmtMaybe form ot hmt If the input " sequence cannot be notated (see ) separate into equal parts, so long as each part is not less than i. rqt_separate_tuplet undefined [(1/3,f),(1/6,f)] rqt_separate_tuplet undefined [(4/7,t),(1/7,f),(2/7,f)] let d = map rq_rqt [1/3,1/6,2/5,1/10] in rqt_separate_tuplet (1/8) d == Right [[(1/3,f),(1/6,f)] ,[(2/5,f),(1/10,f)]] let d = [(1/5,True),(1/20,False),(1/2,False),(1/4,True)] in rqt_separate_tuplet (1/16) d let d = [(2/5,f),(1/5,f),(1/5,f),(1/5,t),(1/2,f),(1/2,f)] in rqt_separate_tuplet (1/2) d let d = [(4/10,True),(1/10,False),(1/2,True)] in rqt_separate_tuplet (1/2) dhmtRecursive variant of . let d = map rq_rqt [1,1/3,1/6,2/5,1/10] in rqt_tuplet_subdivide (1/8) d == [[(1/1,f)] ,[(1/3,f),(1/6,f)] ,[(2/5,f),(1/10,f)]]hmtSequence variant of . let d = [(1/5,True),(1/20,False),(1/2,False),(1/4,True)] in rqt_tuplet_subdivide_seq (1/2) [d]hmt7If a tuplet is all tied, it ought to be a plain value?! 3rqt_tuplet_sanity_ [(4/10,t),(1/10,f)] == [(1/2,f)]hmt Separate ! sequence into measures given by  length. to_measures_rq [3,3] [2,2,2] == Right [[(2,f),(1,t)],[(1,f),(2,f)]] to_measures_rq [3,3] [6] == Right [[(3,t)],[(3,f)]] to_measures_rq [1,1,1] [3] == Right [[(1,t)],[(1,t)],[(1,f)]] to_measures_rq [3,3] [2,2,1] to_measures_rq [3,2] [2,2,2] let d = [4/7,33/28,9/20,4/5] in to_measures_rq [3] d == Right [[(4/7,f),(33/28,f),(9/20,f),(4/5,f)]]hmtVariant that is applicable only at sequence that do not require splitting and ties, else error.hmt Variant of  that ensures  are cmn- durations. This is not a good composition. to_measures_rq_cmn [6,6] [5,5,2] == Right [[(4,t),(1,f),(1,t)] ,[(4,f),(2,f)]] let r = [[(4/7,t),(1/7,f),(1,f),(6/7,f),(3/7,f)]] in to_measures_rq_cmn [3] [5/7,1,6/7,3/7] == Right r to_measures_rq_cmn [1,1,1] [5/7,1,6/7,3/7] == Right [[(4/7,t),(1/7,f),(2/7,t)] ,[(4/7,t),(1/7,f),(2/7,t)] ,[(4/7,f),(3/7,f)]]hmt Variant of  with measures given by  values. Does not ensure  are cmn durations. to_measures_ts [(1,4)] [5/8,3/8] /= Right [[(1/2,t),(1/8,f),(3/8,f)]] to_measures_ts [(1,4)] [5/7,2/7] /= Right [[(4/7,t),(1/7,f),(2/7,f)]] let {m = replicate 18 (1,4) ;x = [3/4,2,5/4,9/4,1/4,3/2,1/2,7/4,1,5/2,11/4,3/2]} in to_measures_ts m x == Right [[(3/4,f),(1/4,t)],[(1/1,t)] ,[(3/4,f),(1/4,t)],[(1/1,f)] ,[(1/1,t)],[(1/1,t)] ,[(1/4,f),(1/4,f),(1/2,t)],[(1/1,f)] ,[(1/2,f),(1/2,t)],[(1/1,t)] ,[(1/4,f),(3/4,t)],[(1/4,f),(3/4,t)] ,[(1/1,t)],[(3/4,f),(1/4,t)] ,[(1/1,t)],[(1/1,t)] ,[(1/2,f),(1/2,t)],[(1/1,f)]] to_measures_ts [(3,4)] [4/7,33/28,9/20,4/5] to_measures_ts (replicate 3 (1,4)) [4/7,33/28,9/20,4/5]hmt Variant of  that allows for duration field operation but requires that measures be well formed. This is useful for re-grouping measures after notation and ascription.hmt(Divide measure into pulses of indicated  durations. Measure must be of correct length but need not contain only cmn durations. Pulses are further subdivided if required to notate tuplets correctly, see . let d = [(1/4,f),(1/4,f),(2/3,t),(1/6,f),(16/15,f),(1/5,f) ,(1/5,f),(2/5,t),(1/20,f),(1/2,f),(1/4,t)] in m_divisions_rq [1,1,1,1] d ;m_divisions_rq [1,1,1] [(4/7,f),(33/28,f),(9/20,f),(4/5,f)]hmt Variant of ' that determines pulse divisions from . let d = [(4/7,t),(1/7,f),(2/7,f)] in m_divisions_ts (1,4) d == Just [d] let d = map rq_rqt [1/3,1/6,2/5,1/10] in m_divisions_ts (1,4) d == Just [[(1/3,f),(1/6,f)] ,[(2/5,f),(1/10,f)]] let d = map rq_rqt [4/7,33/28,9/20,4/5] in m_divisions_ts (3,4) d == Just [[(4/7,f),(3/7,t)] ,[(3/4,f),(1/4,t)] ,[(1/5,f),(4/5,f)]]hmtComposition of  and :, where measures are initially given as sets of divisions. let m = [[1,1,1],[1,1,1]] in to_divisions_rq m [2,2,2] == Right [[[(1,t)],[(1,f)],[(1,t)]] ,[[(1,f)],[(1,t)],[(1,f)]]] let d = [2/7,1/7,4/7,5/7,8/7,1,1/7] in to_divisions_rq [[1,1,1,1]] d == Right [[[(2/7,f),(1/7,f),(4/7,f)] ,[(4/7,t),(1/7,f),(2/7,t)] ,[(6/7,f),(1/7,t)] ,[(6/7,f),(1/7,f)]]] let d = [5/7,1,6/7,3/7] in to_divisions_rq [[1,1,1]] d == Right [[[(4/7,t),(1/7,f),(2/7,t)] ,[(4/7,t),(1/7,f),(2/7,t)] ,[(4/7,f),(3/7,f)]]] let d = [2/7,1/7,4/7,5/7,1,6/7,3/7] in to_divisions_rq [[1,1,1,1]] d == Right [[[(2/7,f),(1/7,f),(4/7,f)] ,[(4/7,t),(1/7,f),(2/7,t)] ,[(4/7,t),(1/7,f),(2/7,t)] ,[(4/7,f),(3/7,f)]]] let d = [4/7,33/28,9/20,4/5] in to_divisions_rq [[1,1,1]] d == Right [[[(4/7,f),(3/7,t)] ,[(3/4,f),(1/4,t)] ,[(1/5,f),(4/5,f)]]] let {p = [[1/2,1,1/2],[1/2,1]] ;d = map (/6) [1,1,1,1,1,1,4,1,2,1,1,2,1,3]} in to_divisions_rq p d == Right [[[(1/6,f),(1/6,f),(1/6,f)] ,[(1/6,f),(1/6,f),(1/6,f),(1/2,True)] ,[(1/6,f),(1/6,f),(1/6,True)]] ,[[(1/6,f),(1/6,f),(1/6,f)] ,[(1/3,f),(1/6,f),(1/2,f)]]]hmt Variant of  with measures given as set of . let d = [3/5,2/5,1/3,1/6,7/10,17/15,1/2,1/6] in to_divisions_ts [(4,4)] d == Just [[[(3/5,f),(2/5,f)] ,[(1/3,f),(1/6,f),(1/2,t)] ,[(1/5,f),(4/5,t)] ,[(1/3,f),(1/2,f),(1/6,f)]]] let d = [3/5,2/5,1/3,1/6,7/10,29/30,1/2,1/3] in to_divisions_ts [(4,4)] d == Just [[[(3/5,f),(2/5,f)] ,[(1/3,f),(1/6,f),(1/2,t)] ,[(1/5,f),(4/5,t)] ,[(1/6,f),(1/2,f),(1/3,f)]]] let d = [3/5,2/5,1/3,1/6,7/10,4/5,1/2,1/2] in to_divisions_ts [(4,4)] d == Just [[[(3/5,f),(2/5,f)] ,[(1/3,f),(1/6,f),(1/2,t)] ,[(1/5,f),(4/5,f)] ,[(1/2,f),(1/2,f)]]] let d = [4/7,33/28,9/20,4/5] in to_divisions_ts [(3,4)] d == Just [[[(4/7,f),(3/7,t)] ,[(3/4,f),(1/4,t)] ,[(1/5,f),(4/5,f)]]]hmtPulse tuplet derivation. p_tuplet_rqt [(2/3,f),(1/3,t)] == Just ((3,2),[(1,f),(1/2,t)]) p_tuplet_rqt (map rq_rqt [1/3,1/6]) == Just ((3,2),[(1/2,f),(1/4,f)]) p_tuplet_rqt (map rq_rqt [2/5,1/10]) == Just ((5,4),[(1/2,f),(1/8,f)]) p_tuplet_rqt (map rq_rqt [1/3,1/6,2/5,1/10])hmtNotate pulse, ie. derive tuplet if neccesary. The flag indicates if the initial value is tied left. p_notate False [(2/3,f),(1/3,t)] p_notate False [(2/5,f),(1/10,t)] p_notate False [(1/4,t),(1/8,f),(1/8,f)] p_notate False (map rq_rqt [1/3,1/6]) p_notate False (map rq_rqt [2/5,1/10]) p_notate False (map rq_rqt [1/3,1/6,2/5,1/10]) == NothinghmtNotate measure. 1m_notate True [[(2/3,f),(1/3,t)],[(1,t)],[(1,f)]] let f = m_notate False . concat fmap f (to_divisions_ts [(4,4)] [3/5,2/5,1/3,1/6,7/10,17/15,1/2,1/6]) fmap f (to_divisions_ts [(4,4)] [3/5,2/5,1/3,1/6,7/10,29/30,1/2,1/3])hmtMultiple measure notation. let d = [2/7,1/7,4/7,5/7,8/7,1,1/7] in fmap mm_notate (to_divisions_ts [(4,4)] d) let d = [2/7,1/7,4/7,5/7,1,6/7,3/7] in fmap mm_notate (to_divisions_ts [(4,4)] d) let d = [3/5,2/5,1/3,1/6,7/10,4/5,1/2,1/2] in fmap mm_notate (to_divisions_ts [(4,4)] d) let {p = [[1/2,1,1/2],[1/2,1]] ;d = map (/6) [1,1,1,1,1,1,4,1,2,1,1,2,1,3]} in fmap mm_notate (to_divisions_rq p d)hmt Transform  to .hmt Transform  to set of .hmt!The default table of simplifiers. %default_table ((3,4),1,(1,1)) == Truehmt.The default eighth-note pulse simplifier rule. default_8_rule ((3,8),0,(1/2,1/2)) == True default_8_rule ((3,8),1/2,(1/2,1/2)) == True default_8_rule ((3,8),1,(1/2,1/2)) == True default_8_rule ((2,8),0,(1/2,1/2)) == True default_8_rule ((5,8),0,(1,1/2)) == True default_8_rule ((5,8),0,(2,1/2)) == Truehmt/The default quarter note pulse simplifier rule. default_4_rule ((3,4),0,(1,1/2)) == True default_4_rule ((3,4),0,(1,3/4)) == True default_4_rule ((4,4),1,(1,1)) == False default_4_rule ((4,4),2,(1,1)) == True default_4_rule ((4,4),2,(1,2)) == True default_4_rule ((4,4),0,(2,1)) == True default_4_rule ((3,4),1,(1,1)) == Falsehmt;The default simplifier rule. To extend provide a list of .hmt!Measure simplifier. Apply given .hmt (n,round (ratio_to_cents (fold_ratio_to_octave_err (n % 1))))) [1..21]hmtConstruct an exact   that approximates  to within epsilon. map (reconstructed_ratio 1e-5) [0,700,1200,1800] == [1,442/295,2,577/204] -ratio_to_cents (442/295) == 699.9976981706735hmtThe Syntonic comma. syntonic_comma == 81/80hmtThe Pythagorean comma.  pythagorean_comma == 3^12 / 2^19hmtMercators comma. mercators_comma == 3^53 / 2^84hmt512-tone equal temperament comma (ie. 12th root of 2). 9twelve_tone_equal_temperament_comma == 1.0594630943592953hmt-Give cents difference from nearest 12ET tone. let r = [50,-49,-2,0,2,49,50] map cents_et12_diff [650,651,698,700,702,749,750] == rhmtFractional form of .hmt'The class of cents intervals has range (0,600). 5map cents_interval_class [50,1150,1250] == [50,50,50] let r = concat [[0,50 .. 550],[600],[550,500 .. 0]] map cents_interval_class [1200,1250 .. 2400] == rhmtFractional form of .hmtAlways include the sign, elide 0.hmt'Given brackets, print cents difference.hmt with parentheses. 2map cents_diff_text [-1,0,1] == ["(-1)","","(+1)"]hmt with markdown superscript (^).hmt with HTML superscript ( sup).hmtRatio to savarts. fratio_to_savarts 10 == 1000 fratio_to_savarts 2 == 301.02999566398114hmtSavarts to ratio. savarts_to_fratio 1000 == 10 savarts_to_fratio 301.02999566398118 == 2hmtSavarts to cents. (savarts_to_cents 1 == 3.9863137138648352hmtCents to savarts. cents_to_savarts 3.9863137138648352 == 1 cents_to_savarts 1200 == ratio_to_savarts 2))9 Safe-Inferred3hmt5Generalised pitch, given by a generalised alteration.hmt,Midi note number with integral cents detune.hmt/Midi note number with real-valued cents detune.hmt Variant of  for incomplete functions.hmtFunction to spell a .hmt"Common music notation pitch value.hmtFractional octave pitch-class (octave is integral, pitch-class is fractional).hmtFractional midi note number.hmtMidi note number (0 - 127). Midi data values are unsigned 7-bit integers, however using an unsigned type would be problematic. It would make transposition, for instance, awkward. x - 12 would transpose down an octave, but the transposition interval itself could not be negative.hmt and  duple.hmt0Octaves are integers, the octave of middle C is 4.hmt/Pitch classes are modulo twelve integers (0-11)hmt and  duple.hmt Normalise , value, ie. ensure pitch-class is in (0,11).hmt Transpose  value.hmt value to integral midi note number. map octave_pitchclass_to_midi [(-1,9),(8,0)] == map (+ 9) [0,99]hmt Inverse of . map midi_to_octave_pitchclass [0,36,60,84,91] == [(-1,0),(2,0),(4,0),(6,0),(6,7)]hmtOne-indexed piano key number (for standard 88 key piano) to pitch class. This has the mnemonic that 49 maps to (4,9). map pianokey_to_octave_pitchclass [1,49,88] == [(0,9),(4,9),(8,0)]hmt2Translate from generic octave & pitch-class duple.hmt Normalise . octpc_nrm (4,16) == (5,4)hmt Transpose . :octpc_trs 7 (4,9) == (5,4) octpc_trs (-11) (4,9) == (3,10)hmtEnumerate range, inclusive. octpc_range ((3,8),(4,1)) == [(3,8),(3,9),(3,10),(3,11),(4,0),(4,1)]hmtType conversionhmtType-specialise f, ie. round, ceiling, truncatehmt value to integral midi note number. map octpc_to_midi [(0,0),(2,6),(4,9),(6,2),(9,0)] == [12,42,69,86,120] map octpc_to_midi [(0,9),(8,0)] == [21,108]hmt Inverse of . *map midi_to_octpc [40,69] == [(2,4),(4,9)]hmt(octave,pitch-class) to fractional octave. This is an odd notation, but can be useful for writing pitch data where a float is required. Note this is not a linear octave, for that see . :map octpc_to_foct [(4,0),(4,7),(5,11)] == [4.00,4.07,5.11]hmt Inverse of . map foct_to_octpc [3.11,4.00,4.07,5.11] == [(3,11),(4,0),(4,7),(5,11)]hmt of .hmt of .hmt1Fractional midi to fractional octave pitch-class. fmidi_to_foctpc 69.5 == (4,9.5)hmt&Octave of fractional midi note number.hmt5Move fractional midi note number to indicated octave. 2map (fmidi_in_octave 1) [59.5,60.5] == [35.5,24.5]hmtPrint fractional midi note number as ET12 pitch with cents detune in parentheses. 4fmidi_et12_cents_pp T.pc_spell_ks 66.5 == "FL4(+50)"hmt Simplify , to standard 12ET by deleting quarter tones. let p = Pitch T.A T.QuarterToneSharp 4 alteration (pitch_clear_quarter_tone p) == T.Sharphmt to  and  notation. )pitch_to_octpc (Pitch F Sharp 4) == (4,6)hmtIs  12-ET.hmt to midi note number notation. 'pitch_to_midi (Pitch A Natural 4) == 69hmt) to fractional midi note number notation. 3pitch_to_fmidi (Pitch A QuarterToneSharp 4) == 69.5hmtExtract  of  map pitch_to_pc [Pitch A Natural 4,Pitch F Sharp 4] == [9,6] map pitch_to_pc [Pitch C Flat 4,Pitch B Sharp 5] == [11,0]hmt comparison, implemented via . pitch_compare (Pitch A Natural 4) (Pitch A QuarterToneSharp 4) == LThmtGiven  function translate from  notation to . = 11 then 3 else 4 let g = map T.pitch_pp .fromJust . spell_cluster_f f let r = [["B3","C4"],["B3"],["C4"],["AL4","B4"]] map g [[11,0],[11],[0],[10,11]] == r ;map (spell_cluster_f (const 4)) [[0,11],[11,0],[6,7],[7,6]]hmt Variant of  that runs pitch_edit_octave* so that the left-most note is in octave o. fmap (map T.pitch_pp) (spell_cluster_left 3 [11,0]) == Just ["B3","C4"] fmap (map T.pitch_pp) (spell_cluster_left 3 [10,11]) == Just ["AL3","B3"]  < Safe-InferredB= Safe-InferredThmt$Common music notation interval. An   of  # indicates an ascending interval,   a descending interval, and   a unison.hmtInterval quality.hmtInterval type or degree.hmtInterval type between Note values. ,map (interval_ty C) [E,B] == [Third,Seventh]hmt'Table of interval qualities. For each = gives directed semitone interval counts for each allowable . For lookup function see , for reverse lookup see .hmtLookup  for given  and semitone count. interval_q Unison 11 == Just Diminished interval_q Third 5 == Just Augmented interval_q Fourth 5 == Just Perfect interval_q Unison 3 == NothinghmtLookup semitone difference of  with . interval_q_reverse Third Minor == Just 3 interval_q_reverse Unison Diminished == Just 11hmtSemitone difference of . interval_semitones (interval (Pitch C Sharp 4) (Pitch E Sharp 5)) == 16 interval_semitones (interval (Pitch C Natural 4) (Pitch D Sharp 3)) == -9hmt Determine  between two Pitches. interval (T.Pitch T.C T.Sharp 4) (T.Pitch T.D T.Flat 4) == Interval Second Diminished EQ 0 interval (T.Pitch T.C T.Sharp 4) (T.Pitch T.E T.Sharp 5) == Interval Third Major LT 1hmtApply   to  of . invert_interval (Interval Third Major LT 1) == Interval Third Major GT 1hmt/The signed difference in semitones between two " values when applied to the same . Can this be written correctly without knowing the Interval_Type? quality_difference_m Minor Augmented == Just 2 quality_difference_m Augmented Diminished == Just (-3) quality_difference_m Major Perfect == NothinghmtErroring variant of .hmt Transpose a Pitch by an . transpose (Interval Third Diminished LT 0) (Pitch C Sharp 4) == Pitch E Flat 4hmtMake leftwards (perfect fourth) and and rightwards (perfect fifth) circles from Pitch. let c = circle_of_fifths (Pitch F Sharp 4) in map pitch_to_pc (snd c) == [6,1,8,3,10,5,12,7,2,9,4,11]hmtParse a positive integer into interval type and octave displacement. 1mapMaybe parse_interval_type (map show [1 .. 15])hmt Parse interval quality notation. mapMaybe parse_interval_quality "dmPMA" == [minBound .. maxBound]hmt>Degree of interval type and octave displacement. Inverse of . map interval_type_degree [(Third,0),(Second,1),(Unison,2)] == [3,9,15]hmt#Inverse of 'parse_interval_quality.hmt.Parse standard common music interval notation. let i = mapMaybe parse_interval (words "P1 d2 m2 M2 A3 P8 +M9 -M2") in unwords (map interval_pp i) == "P1 d2 m2 M2 A3 P8 M9 -M2" mapMaybe (fmap interval_octave . parse_interval) (words "d1 d8 d15") == [-1,0,1]hmt variant.hmt)Pretty printer for intervals, inverse of .hmtStandard names for the intervals within the octave, divided into perfect, major and minor at the left, and diminished and augmented at the right. let {bimap f (p,q) = (f p,f q) ;f = mapMaybe (fmap interval_semitones . parse_interval)} in bimap f std_interval_names''> Safe-Inferred_hmt!A common music notation key is a Note,  Alteration,  triple.hmt+Enumeration of common music notation modes.hmtPretty printer for .hmt Lower-cased .hmt0There are two modes, given one return the other.hmt of .hmtEnumeration of 42 CMN keys. #length key_sequence_42 == 7 * 3 * 2hmt Subset of  key_sequence not including very eccentric keys (where there are more than 7 alterations). length key_sequence_30 == 30hmtParallel key, ie.  of .hmtTransposition of .hmtRelative key (ie. 1 with the same number of and type of alterations. let k = [(T.C,T.Natural,Major_Mode),(T.E,T.Natural,Minor_Mode)] in map (key_lc_uc_pp . key_relative) k == ["aL","GL"]hmtMediant minor of major key. key_mediant (T.C,T.Natural,Major_Mode) == Just (T.E,T.Natural,Minor_Mode)hmtPretty-printer where  is written in lower case (lc) and alteration symbol is shown using indicated function.hmt with unicode (uc) alteration. map key_lc_uc_pp [(C,Sharp,Minor_Mode),(E,Flat,Major_Mode)] == ["cL","EL"]hmt with ISO alteration.hmt with tonh alteration. map key_lc_tonh_pp [(T.C,T.Sharp,Minor_Mode),(T.E,T.Flat,Major_Mode)]hmtParse  from lc-uc string. let k = mapMaybe key_lc_uc_parse ["c","E","fL","ab","G#"] map key_lc_uc_pp k == ["cL","EL","fL","aL","GL"]hmt2Distance along circle of fifths path of indicated . A positive number indicates the number of sharps, a negative number the number of flats. key_fifths (T.A,T.Natural,Minor_Mode) == Just 0 key_fifths (T.A,T.Natural,Major_Mode) == Just 3 key_fifths (T.C,T.Natural,Minor_Mode) == Just (-3) key_fifths (T.B,T.Sharp,Minor_Mode) == Just 9 key_fifths (T.E,T.Sharp,Major_Mode) == Just 11 key_fifths (T.B,T.Sharp,Major_Mode) == Nothing zip (map key_lc_iso_pp key_sequence_42) (map key_fifths key_sequence_42)hmtTable mapping  to  value.hmtLookup  value in . let a = [0,1,-1,2,-2,3,-3,4,-4,5,-5] let f md = map key_lc_iso_pp . mapMaybe (fifths_to_key md) f Minor_Mode a f Major_Mode ahmtGiven sorted pitch-class set, find simplest implied key in given mode. mapMaybe (implied_key Major_Mode) [[0,2,4],[1,3],[4,10],[3,9],[8,9]] map (implied_key Major_Mode) [[0,1,2],[0,1,3,4]] == [Nothing,Nothing]hmt of .? Safe-Inferred`'@ Safe-Inferred`]A Safe-InferredahmtD = dominant, M = majorhmtNames and pc-sets for chord types. The name used here is in the first position, alternates follow.hmt Parse chord. let ch = words "CmM7 C#o EbM7 Fo7 Gx/D C/E G/F Bbsus4/C E7sus2" let c = map parse_chord ch map chord_pp c == ch map chord_pcset c$$B Safe-Inferredd`hmtSimplest spelling for semitone intervals. This is ambiguous for 6 which could be either aug.4 or dim.5. i_to_interval 6 == Interval Fourth Augmented LT 0 map i_to_interval [0..11]hmtPerform some interval simplifications. For non-tonal music some spellings are poor, ie. (f,g#). interval_simplify (Interval Second Augmented LT 0) == Interval Third Minor LT 0 interval_simplify (Interval Seventh Augmented GT 0) == Interval Unison Perfect GT 1C Safe-InferreddD Safe-InferredfhmtClef with octave offset.hmtClef enumeration type.hmtGive clef range as a 6 pair indicating the notes below and above the staff. map clef_range [Treble,Bass] == [Just (d4,g5),Just (f2,b3)] clef_range Percussion == Nothinghmt Suggest a  given a . :map clef_suggest [c2,c4] == [Clef Bass (-1),Clef Treble 0]hmtSet  to 0.hmtSet  to be no further than r from 0.E Safe-InferredkhmtVoice & part number.hmtTable giving ranges for s.hmt Voice types.hmt"Single character abbreviation for .hmt Standard Clef for .hmt$More or less standard choir ranges,  inclusive.hmtMore conservative ranges,  inclusive.hmtLookup voice range table.hmtLookup .hmtLookup .hmtIs p   l and   r.hmtIs p in range for v, (std & safe). )map (in_voice_rng T.c4) [Bass .. Soprano]hmtGiven tbl list s that can sing .hmtstd variant.hmtsafe variant.hmtEnumeration of SATB voices.hmt Names of .hmt of  as  s.hmtk part choir, ordered by voice.hmt grouped in parts. map (map part_nm) (ch_parts 8)hmtAbreviated name for part. part_nm (Soprano,1) == "S1"hmtk SATB choirs, grouped by choir.  k_ch_groups 2hmt  of .hmtTwo k! part SATB choirs in score order. %map part_nm (concat (dbl_ch_parts 8))hmt for s.F Safe-Inferredt hmtSet of 1. interval size (cents), 2. intervals as product of powers of primes, 3. frequency ratio and 4. harmonicity value.hmt Barlow's indigestibility function for prime numbers. map barlow [1,2,3,5,7,11,13] == [0,1,8/3,32/5,72/7,200/11,288/13]hmt+Compute the disharmonicity of the interval (p,q)% using the prime valuation function pv. map (disharmonicity barlow) [(9,10),(8,9)] == ([12 + 11/15,8 + 1/3] :: [Rational])hmtThe reciprocal of . map (harmonicity barlow) [(9,10),(8,9),(2,1)] == ([15/191,3/25,1] :: [Rational])hmt Variant of  with   input. harmonicity_r barlow 1 == 1/0hmt Variant of . with output in (0,100), infinity maps to 100.hmt Given ratio r generate hmtTable 2 (p.45) 7length (table_2 0.06) == 24 length (table_2 0.04) == 66hmtPretty printer for  values. ,mapM_ (putStrLn . table_2_pp) (table_2 0.06)  > 0.000 | 0 0 0 0 0 0 | 1:1 | Infinity > 111.731 | 4 -1 -1 0 0 0 | 15:16 | 0.076531 > 182.404 | 1 -2 1 0 0 0 | 9:10 | 0.078534 > 203.910 | -3 2 0 0 0 0 | 8:9 | 0.120000 > 231.174 | 3 0 0 -1 0 0 | 7:8 | 0.075269 > 266.871 | -1 -1 0 1 0 0 | 6:7 | 0.071672 > 294.135 | 5 -3 0 0 0 0 | 27:32 | 0.076923 > 315.641 | 1 1 -1 0 0 0 | 5:6 | 0.099338 > 386.314 | -2 0 1 0 0 0 | 4:5 | 0.119048 > 407.820 | -6 4 0 0 0 0 | 64:81 | 0.060000 > 435.084 | 0 2 0 -1 0 0 | 7:9 | 0.064024 > 498.045 | 2 -1 0 0 0 0 | 3:4 | 0.214286 > 519.551 | -2 3 -1 0 0 0 | 20:27 | 0.060976 > 701.955 | -1 1 0 0 0 0 | 2:3 | 0.272727 > 764.916 | 1 -2 0 1 0 0 | 9:14 | 0.060172 > 813.686 | 3 0 -1 0 0 0 | 5:8 | 0.106383 > 884.359 | 0 -1 1 0 0 0 | 3:5 | 0.110294 > 905.865 | -4 3 0 0 0 0 | 16:27 | 0.083333 > 933.129 | 2 1 0 -1 0 0 | 7:12 | 0.066879 > 968.826 | -2 0 0 1 0 0 | 4:7 | 0.081395 > 996.090 | 4 -2 0 0 0 0 | 9:16 | 0.107143 > 1017.596 | 0 2 -1 0 0 0 | 5:9 | 0.085227 > 1088.269 | -3 1 1 0 0 0 | 8:15 | 0.082873 > 1200.000 | 1 0 0 0 0 0 | 1:2 | 1.000000  G Safe-InferredyhmtSynonym for a list of strings.hmtFormat section stringhmtFormat   (text) attributehmtFormat   attributehmtFormat   attributehmt TUN V.200  Scale Begin (header) section.hmtFormat Info6 section given Name and ID (the only required fields). tun_info ("name","id")hmtFormat Tuning5 section given sequence of 128 integral cents values. tun_tuning [0,100.. 12700]hmtThe default base frequency for  Exact Tuning (A4=440)hmtFormat  Exact Tuning section given base frequency and sequence of 128 real cents values. /tun_exact_tuning tun_f0_default [0,100.. 12700]hmtFormat Functional Tuning section given base frequency and sequence of 128 real cents values.This simply sets note zero to f0 and increments each note by the difference from the previous note. 4tun_functional_tuning tun_f0_default [0,100.. 12700]hmtFormat  Scale End section header.hmtVersion 1 has just the Tuning and  Exact Tuning.hmt#Version 2 files have, in addition, Begin, Info, Functional Tuning and End sections.H Safe-Inferred[hmtNormal form, value with occurences count (ie. exponent in notation above).hmt$Degree of Efg, ie. sum of exponents. !efg_degree [(3,3),(7,2)] == 3 + 2hmt>Number of tones of Efg, ie. product of increment of exponents. ,efg_tones [(3,3),(7,2)] == (3 + 1) * (2 + 1)hmtCollate a genus given as a multiset into standard form, ie. histogram. (efg_collate [3,3,3,7,7] == [(3,3),(7,2)]hmt7Factors of Efg given with co-ordinate of grid location. efg_factors [(3,3)] let r = [([0,0],[]),([0,1],[7]),([0,2],[7,7]) ,([1,0],[3]),([1,1],[3,7]),([1,2],[3,7,7]) ,([2,0],[3,3]),([2,1],[3,3,7]),([2,2],[3,3,7,7]) ,([3,0],[3,3,3]),([3,1],[3,3,3,7]),([3,2],[3,3,3,7,7])] efg_factors [(3,3),(7,2)] == rhmtRatios of Efg, taking n8 as the 1:1 ratio, with indices, folded into one octave. import Data.List let r = sort $ map snd $ efg_ratios 7 [(3,3),(7,2)] r == [1/1,9/8,8/7,9/7,21/16,189/128,3/2,27/16,12/7,7/4,27/14,63/32] map (round . ratio_to_cents) r == [0,204,231,435,471,675,702,906,933,969,1137,1173]0: 1/1 C 0.000 cents 1: 9/8 D 203.910 cents 2: 8/7 D+ 231.174 cents 3: 9/7 E+ 435.084 cents 4: 21/16 F- 470.781 cents 5: 189/128 G- 674.691 cents 6: 3/2 G 701.955 cents 7: 27/16 A 905.865 cents 8: 12/7 A+ 933.129 cents 9: 7/4 Bb- 968.826 cents 10: 27/14 B+ 1137.039 cents 11: 63/32 C- 1172.736 cents 12: 2/1 C 1200.000 cents let r' = sort $ map snd $ efg_ratios 5 [(5,2),(7,3)] r' == [1/1,343/320,35/32,49/40,5/4,343/256,7/5,49/32,8/5,1715/1024,7/4,245/128] map (round . ratio_to_cents) r' == [0,120,155,351,386,506,583,738,814,893,969,1124] let r'' = sort $ map snd $ efg_ratios 3 [(3,1),(5,1),(7,1)] r'' == [1/1,35/32,7/6,5/4,4/3,35/24,5/3,7/4] map (round . ratio_to_cents) r'' == [0,155,267,386,498,653,884,969] let c0 = [0,204,231,435,471,675,702,906,933,969,1137,1173,1200] let c1 = [0,120,155,351,386,506,583,738,814,893,969,1124,1200] let c2 = [0,155,267,386,498,653,884,969,1200] let f (c',y) = map (\x -> (x,y,x,y + 10)) c' map f (zip [c0,c1,c2] [0,20,40])hmtGenerate a line drawing, as a set of (x0,y0,x1,y1) 4-tuples. h=row height, m=distance of vertical mark from row edge, k=distance between rows let e = [[3,3,3],[3,3,5],[3,5,5],[3,5,7],[3,7,7],[5,5,5],[5,5,7],[3,3,7],[5,7,7],[7,7,7]] let e = [[3,3,3],[5,5,5],[7,7,7],[3,3,5],[3,5,5],[5,5,7],[5,7,7],[3,7,7],[3,3,7],[3,5,7]] let e' = map efg_collate e efg_diagram_set (round,25,4,75) e'I Safe-Inferredhmt, with 12-Et/24-Et tuning deviation given in .hmtTuple indicating nearest  to  frequency with Et( frequency, and deviation in hertz and .(cps,nearest-pitch,cps-of-nearest-pitch,cps-deviation,cents-deviation)hmt and .hmt of (69,440)hmt)12-tone equal temperament table equating 3 and frequency over range of human hearing, where A4 has given frequency. tbl_12et_k0 (69,440)hmt (69,440). length tbl_12et == 192 T.minmax (map (round . snd) tbl_12et) == (1,31609)hmt%24-tone equal temperament variant of .hmt (69,440). length tbl_24et == 360 T.minmax (map (round . snd) tbl_24et) == (1,32535)hmt Given an Et* table (or like) find bounds of frequency. import qualified Music.Theory.Tuple as T let r = Just (T.t2_map octpc_to_pitch_cps ((3,11),(4,0))) bounds_et_table tbl_12et 256 == rhmt of . import qualified Music.Theory.Tuning.Hs as T map bounds_12et_tone (T.harmonic_series_cps_n 17 55)hmtn-decimal places. ndp 3 (1/3) == "0.333"hmt Pretty print . This discards the  cps-deviation$ field, ie. it has only four fields.hmt of hmtForm  for  frequency by consulting table. let f = 256 let f' = octpc_to_cps (4,0) let r = (f,Pitch C Natural 4,f',f-f',fratio_to_cents (f/f')) nearest_et_table_tone tbl_12et 256 == rhmt for .hmt for . let r = "55.0 A1 55.0 0.0" unwords (hs_r_pitch_pp 1 (nearest_24et_tone_k0 (69,440) 55)) == rhmt4Monzo 72-edo HEWM notation. The domain is (-9,9). .http://www.tonalsoft.com/enc/number/72edo.aspx let r = ["+",">","^","#<","#-","#","#+","#>","#^"] map alteration_72et_monzo [1 .. 9] == r let r = ["-","<","v","b>","b+","b","b-","b<","bv"] map alteration_72et_monzo [-1,-2 .. -9] == rhmtGiven a midi note number and 1/6 deviation determine Pitch' and frequency. let f = pitch_r_pp . fst . pitch_72et_k0 (69,440) let r = "C4 C+4 C>4 C^4 C#<4 C#-4 C#4 C#+4 C#>4 C#^4" unwords (map f (zip (repeat 60) [0..9])) == r let r = "A4 A+4 A>4 A^4 Bb<4 Bb-4 Bb4 Bb+4 Bb>4 Bv4" unwords (map f (zip (repeat 69) [0..9])) == r let r = "Bb4 Bb+4 Bb>4 Bv4 B<4 B-4 B4 B+4 B>4 B^4" unwords (map f (zip (repeat 70) [0..9])) == rhmt)72-tone equal temperament table equating Pitch'3 and frequency over range of human hearing, where A4 = 440hz. length (tbl_72et_k0 (69,440)) == 792 T.minmax (map (round . snd) (tbl_72et_k0 (69,440))) == (16,33167)hmt for tbl_72et. let r = "324.0 E<4 323.3 0.7 3.5" unwords (hs_r_pp pitch_r_pp 1 (nearest_72et_tone_k0 (69,440) 324)) let f = take 2 . hs_r_pp pitch_r_pp 1 . nearest_72et_tone_k0 (69,440) . snd mapM_ (print . unwords . f) (tbl_72et_k0 (69,440))hmtExtract  from .hmtNearest 12-Et  to indicated frequency (hz). 7nearest_pitch_detune_12et_k0 (69,440) 452.8929841231365hmtNearest 24-Et  to indicated frequency (hz). 7nearest_pitch_detune_24et_k0 (69,440) 452.8929841231365hmtGiven near function, f0 and ratio derive .hmtFrequency (hz) of . 9pitch_detune_to_cps (octpc_to_pitch pc_spell_ks (4,9),50)hmt of nearest_12et_tonehmt of nearest_24et_tonehmtMarkdown pretty-printer for .hmtHTML pretty-printer for .hmtNo-octave variant of .hmtNo-octave variant of .  J Safe-Inferred.hmt.Specify subset as list of families and scales.hmt and .hmt and .hmtA text annotation.hmtFrequency in hertz.hmtDegrees are one-indexed.hmt-Octaves are zero-indexed and may be negative.hmtEnumeration of Gamelan scales.hmt#Enumeration of Gamelan instruments.hmt'Bonang Barung (horizontal gong, middle)hmt&Bonang Panerus (horizontal gong, high)hmt#Gambang Kayu (wooden key&resonator)hmt%Gender Barung (key&resonator, middle)hmt&Gender Panembung (key&resonator, high)hmt/Gender Panembung, Slenthem (key&resonator, low)hmtGong Ageng (hanging gong, low)hmt#Gong Suwukan (hanging gong, middle)hmtKempul (hanging gong, middle)hmt Kempyang (horizontal gong, high)hmtKenong (horizontal gong, low)hmt'Ketuk, Kethuk (horizontal gong, middle)hmt!Saron Barung, Saron (key, middle)hmtSaron Demung, Demung (key, low)hmt!Saron Panerus, Peking (key, high)hmt+Enumeration of gamelan instrument families.hmt  with error message.hmt  of 0.01.hmtUniversehmtClef appropriate for .hmt Octaves are written as repeated - or +!, degrees are printed ordinarily. map pitch_pp_ascii (zipWith Pitch [-2 .. 2] [1 .. 5]) == ["--1","-2","3","+4","++5"]hmt of .hmt6It is an error to compare notes from different scales.hmtAscending sequence of  for  from p1 to p2 inclusive.hmtAscending sequence of  from n1 to n2 inclusive. note_gamut_elem (Note Slendro (Pitch 0 5)) (Note Slendro (Pitch 1 2))hmtConstructor for  without  frequency or  annotation.hmtTones are considered  equivalent if they have the same  and .hmt0Fractional (rational) 24-et midi note number of .hmt0Fractional (rational) 24-et midi note number of .hmtExtract subset of .hmtGiven a  , find those s that are within  of .hmtCompare s by frequency. 0s without frequency compare as if at frequency 0.hmtIf all f of a are  b, then  [b], else .hmtPelog has seven degrees, numbered one to seven. Slendro has five degrees, numbered one to six excluding four. map scale_degrees [Pelog,Slendro] == [[1,2,3,4,5,6,7],[1,2,3,5,6]]hmt-Zero based index of scale degree, or Nothing. degree_index Slendro 4 == Nothing degree_index Pelog 4 == Just 3hmtOrderable if scales are equal.hmt Orderable if frequency is given.K Safe-InferredBhmtEuler diagram given as (h,v) duple, where h" are the horizontal sequences and v are the vertical edges.hmt(unit-pitch-class,print-cents)hmt of  .hmt of  .hmtn = length, m = multiplier, r = initial ratio. .tun_seq 5 (3/2) 1 == [1/1,3/2,9/8,27/16,81/64]hmt All possible pairs of elements (x,y) where x is from p and y from q. all_pairs "ab" "cde" == [('a','c'),('a','d'),('a','e'),('b','c'),('b','d'),('b','e')]hmtGive all pairs from (l2,l1) and (l3,l2) that are at interval ratios r1 and r2 respectively.hmt)Pretty printer for pitch class (UNICODE). unwords (map pc_pp [0..11]) == "CL CL DL EL EL FL FL GL AL AL BL BL"hmtShow ratio as intergral ( ) cents value.hmtDot label for ratio, k& is the pitch-class of the unit ratio. rat_label (0,False) 1 == "CL\\n1:1" rat_label (3,True) (7/4) == "CL=969\\n7:4"hmtGenerate value dot node identifier for ratio. rat_id (5/4) == "R_5_4"hmt1Printer for edge label between given ratio nodes.hmtZip start-middle-end. ;zip_sme (0,1,2) "abcd" == [(0,'a'),(1,'b'),(1,'c'),(2,'d')]hmtRatios at plane, sorted.hmtApply f at all nodes of the plane.hmt Generate dot& graph given printer functions and an  Euler_Plane.hmt2Variant with default printers and fixed node type.L Safe-Inferred hmtOdd numbers to n. odd_to 7 == [1,3,5,7]hmtGenerate initial row for n. row 7 == [1,5/4,3/2,7/4]hmtGenerate initial column for n. column 7 == [1,8/5,4/3,8/7]hmt   .hmtGiven row and column generate matrix value at (i,j). #inner (row 7,column 7) (1,2) == 6/5hmtMeyer table in form (r,c,n). meyer_table_indices 7 == [(0,0,1/1),(0,1,5/4),(0,2,3/2),(0,3,7/4) ,(1,0,8/5),(1,1,1/1),(1,2,6/5),(1,3,7/5) ,(2,0,4/3),(2,1,5/3),(2,2,1/1),(2,3,7/6) ,(3,0,8/7),(3,1,10/7),(3,2,12/7),(3,3,1/1)]hmtMeyer table as set of rows. meyer_table_rows 7 == [[1/1, 5/4, 3/2,7/4] ,[8/5, 1/1, 6/5,7/5] ,[4/3, 5/3, 1/1,7/6] ,[8/7,10/7,12/7,1/1]] let r = [[ 1/1, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8] ,[16/9, 1/1, 10/9, 11/9, 4/3, 13/9, 14/9, 5/3] ,[ 8/5, 9/5, 1/1, 11/10, 6/5, 13/10, 7/5, 3/2] ,[16/11, 18/11, 20/11, 1/1, 12/11, 13/11, 14/11, 15/11] ,[ 4/3, 3/2, 5/3, 11/6, 1/1, 13/12, 7/6, 5/4] ,[16/13, 18/13, 20/13, 22/13, 24/13, 1/1, 14/13, 15/13] ,[ 8/7, 9/7, 10/7, 11/7, 12/7, 13/7, 1/1, 15/14] ,[16/15, 6/5, 4/3, 22/15, 8/5, 26/15, 28/15, 1/1]] in meyer_table_rows 15 == rhmtThird element of three-tuple.hmtSet of unique ratios in n table. elements 7 == [1,8/7,7/6,6/5,5/4,4/3,7/5,10/7,3/2,8/5,5/3,12/7,7/4] elements 9 == [1,10/9,9/8,8/7,7/6,6/5,5/4,9/7,4/3,7/5,10/7 ,3/2,14/9,8/5,5/3,12/7,7/4,16/9,9/5]hmtNumber of unique elements at n table. -map degree [7,9,11,13,15] == [13,19,29,41,49]hmt +http://en.wikipedia.org/wiki/Farey_sequence r = [[0 ] ,[0 ,1] ,[0 ,1/2 ,1] ,[0 ,1/3 ,1/2 ,2/3 ,1] ,[0 ,1/4,1/3 ,1/2 ,2/3,3/4 ,1] ,[0 ,1/5,1/4,1/3,2/5,1/2,3/5,2/3,3/4,4/5 ,1] ,[0,1/6,1/5,1/4,1/3,2/5,1/2,3/5,2/3,3/4,4/5,5/6,1]] map farey_sequence [0..6]  M Safe-InferredxhmtIncipient Tonality Diamond itd_map [4 .. 6]hmt of . itd_tbl [4 .. 13]N Safe-Inferred hmt The set of K slendro tunings. map length k_set == replicate (length k_set) 5 minimum (concat k_set) == 206 maximum (concat k_set) == 268.5hmtGiven a set of equal length lists calculate the average value of each position. /calculate_averages [[1,2,3],[3,2,1]] == [2,2,2]hmt Averages of K set, p. 10. 8k_averages == [233.8125,245.0625,234.0,240.8125,251.875]hmt The set of GM) (Gadja Mada University) slendro tunings. map length gm_set == replicate (length gm_set) 5 minimum (concat gm_set) == 218 maximum (concat gm_set) == 262hmt Averages of GM set, p. 10. 6gm_averages == [234.0,240.25,247.625,243.125,254.0625]hmtAssociation list giving interval boundaries for interval class categories (pp.10-11).hmtCategorise an interval.hmt+Pretty interval category table (pp. 10-11). i_category_table k_set == ["S L S S L " ,"S L S S L " ,"L L S S S " ,"L S S S L " ,"S S L S L " ,"S E-L S L L " ,"L E E S S " ,"S S S-E L L "] i_category_table gm_set == ["S L E-L E L " ,"L S-E E S L " ,"S S-E S L S-E" ,"S L L S L " ,"S S-E E-L S L " ,"S S-E E E L " ,"S-E S L E L " ,"S S E-L L L "]hmtRational tuning derived from , p.11. polansky_1984_r == sort polansky_1984_r polansky_1984_r == [1/1,8/7,21/16,512/343,12/7,96/49] import Music.Theory.List d_dx polansky_1984_r == [1/7,19/112,989/5488,76/343,12/49]hmtratio_to_cents of . import Music.Theory.List map round (d_dx polansky_1984_c) == [231,240,223,240,231]O Safe-Inferred; hmt(Kanjutmesem Slendro (S1,S2,S3,S5,S6,S1') -L.d_dx kanjutmesem_s == [252,238,241,236,253]hmt,Kanjutmesem Pelog (P1,P2,P3,P4,P5,P6,P7,P1') 5L.d_dx kanjutmesem_p == [141,141,272,140,115,172,246]hmt#Darius Slendro (S1,S2,S3,S5,S6,S1') L.d_dx darius_s == [204,231,267,231,267] ax_r darius_s == [9/8,8/7,7/6,8/7,7/6]hmt*Madeleine Pelog (P1,P2,P3,P4,P5,P6,P7,P1') L.d_dx madeleine_p == [139,128,336,99,94,173,231] ax_r madeleine_p == [13/12,14/13,17/14,18/17,19/18,21/19,8/7]hmt&Lipur Sih Slendro (S1,S2,S3,S5,S6,S1') +L.d_dx lipur_sih_s == [273,236,224,258,256]hmt*Lipur Sih Pelog (P1,P2,P3,P4,P5,P6,P7,P1') /L.d_dx lipur_sih_p == [110,153,253,146,113,179]hmt5Idealized ET Slendro, 5-tone equal temperament (p.17) .L.d_dx idealized_et_s == [240,240,240,240,240]hmt=Idealized ET Pelog, subset of 9-tone equal temperament (p.17) L.d_dx idealized_et_p == [400/3,800/3,400/3,400/3,400/3,400/3,800/3]hmt)Reconstruct approximate ratios to within 1e-3 from intervals.  P Safe-Inferredhmt?Just-intonation (ie. all rational) scales, collected by author.Q Safe-Inferred'hmtPlomp-Levelt consonance curve.R. Plomp and W. J. M. Levelt, "Tonal Consonance and Critical Bandwidth," Journal of the Acoustical Society of America.38, 548-560 (1965)."Relating Tuning and Timbre"  *http://sethares.engr.wisc.edu/consemi.html MATLAB: +https://sethares.engr.wisc.edu/comprog.html import Sound.SC3.Plot plot_p1_ln [map (\f -> pl_dissonance (220,1) (f,1)) [220 .. 440]]hmtSum of ! for all p in s1 and all q in s2.hmt+Return local minima of sequence with index.hmt:William A. Sethares "Adaptive Tunings for Musical Scales". plot_p1_ln atms_fig_1hmt"Relating Tuning and Timbre" *http://sethares.engr.wisc.edu/consemi.html plot_p1_ln [rtt_fig_2 880] map fst (local_minima (rtt_fig_2 880)) == [267,316,386,498,582,702,884,969]R Safe-InferredGhmtA tuning specified   as a sequence of exact ratios, or as a sequence of possibly inexact Cents#, and an octave if not 2:1 or 1200.In both cases, the values are given in relation to the first degree of the scale, which for ratios is 1 and for cents 0.hmt1Default epsilon for recovering ratios from cents.hmt4Tuning value as rational, reconstructed if required.hmtTuning value as cents.hmt!Tuning octave, defaulting to 2:1.hmtTuning octave in cents.hmtTuning octave as ratio cents.hmtDivisions of octave. ,tn_divisions (tn_equal_temperament 12) == 12hmt  exact ratios of , NOT including the octave.hmtLimit of JI tuning.hmt ing variant.hmtPossibly inexact Cents% of tuning, NOT including the octave.hmt    cents.hmt Variant of  that includes octave at right.hmt / 100hmtPossibly inexact Approximate_Ratio s of tuning.hmt'Cyclic form, taking into consideration  octave_ratio.hmtLookup function that allows both negative & multiple octave indices. :l Music.Theory.Tuning.DB.Werckmeister let map_zip f l = zip l (map f l) map_zip (tn_ratios_lookup werckmeister_vi) [-24 .. 24]hmtLookup function that allows both negative & multiple octave indices. map_zip (tn_approximate_ratios_lookup werckmeister_v) [-24 .. 24]hmt 2 exact ratios reconstructed from possibly inexact Cents of . :l Music.Theory.Tuning.DB.Werckmeister let r = [1,17/16,9/8,13/11,5/4,4/3,7/5,3/2,11/7,5/3,16/9,15/8] tn_reconstructed_ratios 1e-2 werckmeister_iii == Just rhmtMake n division equal temperament.hmt12-tone equal temperament. 1tn_cents tn_equal_temperament_12 == [0,100..1100]hmt19-tone equal temperament. let c = [0,63,126,189,253,316,379,442,505,568,632,695,758,821,884,947,1011,1074,1137] tn_cents_i tn_equal_temperament_19 == chmt31-tone equal temperament.hmt53-tone equal temperament.hmt72-tone equal temperament. let r = [0,17,33,50,67,83,100] take 7 (map round (tn_cents tn_equal_temperament_72)) == rhmt96-tone equal temperament.S Safe-Inferredhmt"Construct an isomorphic layout of r rows and c% columns with an upper left value of (i,j). r = [[(0,0),(-1,2),(-2,4)],[(-1,1),(-2,3),(-3,5)],[(-2,2),(-3,4),(-4,6)]] mk_isomorphic_layout 3 3 (0,0) == r map (map fst) r == [[0,-1,-2],[-1,-2,-3],[-2,-3,-4]] map (map snd) r == [[0,2,4],[1,3,5],[2,4,6]] map (map fst) r == map (map fst) (transpose r) map (map snd) (transpose r) == [[0,1,2],[2,3,4],[4,5,6]]hmt!A minimal isomorphic note layout. let [i,j,k] = mk_isomorphic_layout 3 5 (3,-4) [i,take 4 j,(2,-4):take 4 k] == minimal_isomorphic_note_layouthmt3Make a rank two regular temperament from a list of (i,j)$ positions by applying the scalars a and b.hmt Syntonic tuning system based on  of 5 rows and 7 columns starting at (3,-4) and a  with a of 1200 and indicated b.hmt of 697. tn_divisions syntonic_697 == 17 let c = [0,79,194,273,309,388,467,503,582,697,776,812,891,970,1006,1085,1164] tn_cents_i syntonic_697 == chmt of 702. tn_divisions syntonic_702 == 17 let c = [0,24,114,204,294,318,408,498,522,612,702,792,816,906,996,1020,1110] tn_cents_i syntonic_702 == cT Safe-InferredUhmtA scale has a name, a description, a degree, and a sequence of pitches. The name" is the the file-name without the .scl suffix. By convention the first comment line gives the file name (with suffix). The pitches do NOT include 1:1 or 0c and do include the octave.hmt4A nearness value for deriving approximate rationals.hmtAn enumeration type for .scl pitch classification.hmtA .scl pitch is either in Cents or is a  .hmtDerive  from .hmt Pitch as , conversion by  if necessary.hmt Pitch as  , conversion by  if necessary, hence epsilon.hmtA pair giving the number of Cents and number of   pitches.hmtIf scale is uniform, give type.hmt(The predominant type of the pitches for .hmtThe name of a scale.hmtText description of a scale.hmt#The degree of the scale (number of es).hmtThe es at .hmtIs  outside of the standard octave (ie. cents 0-1200 and ratios 1-2)hmt*Ensure degree and number of pitches align.hmt*Raise error if scale doesn't verify, else  .hmt The last  element of the scale (ie. the octave). For empty scales give .hmtError variant.hmtIs  perfect, ie.   of 2 or Cents of 1200.hmt!Are all pitches of the same type.hmt&Are the pitches in ascending sequence.hmtMake scale pitches uniform, conforming to the most predominant pitch type.hmtScale as list of  (ie. ) with 0 prefix.hmt   of .hmtScale as list of   (ie. ) with 1 prefix.hmt Require that  be uniformly of  s.hmt$Erroring variant of 'scale_ratios_u.hmtAre scales equal () at degree and tuning data. db <- scl_load_db let r = [2187/2048,9/8,32/27,81/64,4/3,729/512,3/2,6561/4096,27/16,16/9,243/128,2/1] let Just py = find (scale_eq ("","",length r,map Right r)) db scale_name py == "pyth_12"+ provides an approximate equality function. let c = map T.ratio_to_cents r let Just py' = find (scale_eqv 0.00001 ("","",length c,map Left c)) db scale_name py' == "pyth_12"hmtAre scales equal at degree and   to at least k places of tuning data.hmtIs s1 a proper subset of s2.hmt4Are scales equal at degree and equivalent to within epsilon at .hmtComment lines begin with !.hmtRemove to end of line ! comments. +remove_eol_comments " 1 ! comment" == " 1 "hmtRemove comments and trailing comments (the description may be empty, keep nulls) ;filter_comments ["!a","b","","c","d!e"] == ["b","","c","d"]hmtPitches are either cents (with decimal point, possibly trailing) or ratios (with /). map parse_pitch ["70.0","350.","3/2","2","2/1"] == [Left 70,Left 350,Right (3/2),Right 2,Right 2]hmt#Pitch lines may contain commentary.hmtParse .scl file.hmtRead the environment variable  SCALA_SCL_DIR, which is a sequence of directories used to locate scala files on. 6setEnv "SCALA_SCL_DIR" "/home/rohan/data/scala/90/scl"hmt Lookup the  SCALA_SCL_DIR environment variable, which must exist, and derive the filepath. It is an error if the name has a file extension. 2mapM scl_derive_filename ["young-lm_piano","et12"]hmt/If the name is an absolute file path and has a .scl& extension, then return it, else run . scl_resolve_name "young-lm_piano" scl_resolve_name "/home/rohan/data/scala/90/scl/young-lm_piano.scl" scl_resolve_name "/home/rohan/data/scala/90/scl/unknown-tuning.scl"hmtLoad .scl file, runs  resolve_scl. s <- scl_load "xenakis_chrom" pitch_representations (scale_pitches s) == (6,1) scale_ratios 1e-3 s == [1,21/20,29/23,179/134,280/187,11/7,100/53,2]hmt Load all .scl files at dir, associate with file-name. db <- scl_load_dir_fn "/home/rohan/data/scala/91/scl" length db == 5176 -- v.91 map (\(fn,s) -> (takeFileName fn,scale_name s)) dbhmt  of hmtLoad Scala data base at . db <- scl_load_db mapM_ (putStrLn . unlines . scale_stat) (filter (not . perfect_octave) db)hmt 0http://www.huygens-fokker.org/docs/scalesdir.txthmtFormat as CSV file. db <- scl_load_db writeFile "/tmp/scl.csv" (scales_dir_txt_csv db)hmt(Simple plain-text display of scale data. db <- scl_load_db writeFile "/tmp/scl.txt" (unlines (intercalate [""] (map scale_stat db)))hmt Pretty print  in Scala format.hmt Pretty print  in Scala format. scl <- scl_load "et19" scl <- scl_load "young-lm_piano" putStr $ unlines $ scale_pp sclhmtWrite scl to dir with the file-name .sclhmtscala" distribution directory, given at SCALA_DIST_DIR. 8setEnv "SCALA_DIST_DIR" "/home/rohan/opt/build/scala-22"hmtLoad file from .hmt    s <- load_dist_file_ln "intnam.par" length s == 565 -- Scala 2.46dhmt5Is scale just-intonation (ie. are all pitches ratios)hmt7Calculate limit for JI scale (ie. largest prime factor)hmtSum of absolute differences to scale given in cents, sorted, with rotation.hmtVariant selecting only nearest and with post-processing function. scl <- scl_load "holder" scale_cents_i scl c = [0,83,193,308,388,502,584,695,778,890,1004,1085,1200] (_,r,_) = scl_cdiff_abs_sum_1 round c scl r == [0,2,-1,1,0,-1,0,-1,0,0,0,0,0]hmtSort DB into ascending order of sum of absolute of differences to scale given in cents. Scales are sorted and all rotations are considered. db <- scl_load_db c = [0,83,193,308,388,502,584,695,778,890,1004,1085,1200] r = scl_db_query_cdiff_asc round db c ((_,dx,_),_):_ = r dx == [0,2,-1,1,0,-1,0,-1,0,0,0,0,0] mapM_ (putStrLn . unlines . scale_stat . snd) (take 10 r)hmtIs x the same scale as scl under cmp.hmtFind scale(s) that are  to x . Usual cmp are (==) and  is_subset.hmt Translate  to . If  is uniformly rational,  is rational, else it is in .hmtConvert  to . tuning_to_scale ("et12","12 tone equal temperament") (T.tn_equal_temperament 12)hmt of . 3fmap T.tn_limit (scl_load_tuning "pyra") -- Just 59U Safe-Inferredhmt)(mode-count,mode-length-maxima,mode-list)hmt3(mode-start-degree,mode-intervals,mode-description)hmtStarting degree of mode in underlying scale. If non-zero the mode will not lie within an ordinary octave of the tuning.hmt;Intervals (in steps) between adjacent elements of the mode.hmtInterval set of mode (ie.   of   of )hmt Histogram () of hmtThe text description of the mode, ordinarily a comma separated list of names.hmt  (or degree) of  (ie. number of notes in mode)hmt  of ' (ie. number of notes in tuning system)hmt  of $. This seqence includes the octave.hmt!Search for mode by interval list.hmtExpect one result. mn <- load_modenam let sq = putStrLn . unlines . mode_stat . fromJust . modenam_search_seq1 mn sq [2,2,1,2,2,2,1] sq [2,1,2,2,1,2,2] sq [2,1,2,2,1,3,1] sq (replicate 6 2) sq [1,2,1,2,1,2,1,2] sq [2,1,2,1,2,1,2,1] sq (replicate 12 1)hmt$Search for mode by description text. map (modenam_search_description mn) ["Messiaen","Xenakis","Raga"]hmtIs p' an element of the set of rotations of q.hmtPretty printer. mn <- load_modenam let r = filter ((/=) 0 . mode_starting_degree) (modenam_modes mn) -- non-zero starting degrees let r = filter ((== [(1,2),(2,5)]) . mode_histogram) (modenam_modes mn) -- 21 and 52 let r = filter ((== 22) . mode_univ) (modenam_search_description mn "Raga") -- raga of 22 shruti univ [(p,q) | p <- r, q <- r, p < q, mode_rot_eqv p q] -- rotationally equivalent elements of r length r putStrLn $ unlines $ intercalate ["\n"] $ map mode_stat rhmt6Bracketed integers are a non-implicit starting degree. 7map non_implicit_degree ["4","[4]"] == [Nothing,Just 4]hmtPredicate formhmt+Lines ending with @@ continue to next line.hmt/Parse joined non-comment lines of modenam file.hmt of  of  modenam.par. mn <- load_modenam let (n,x,m) = mn (n, x, length m) == (3087,15,3087) -- Scala 2.64pV Safe-InferredihmtScala keyboard mapping(sz,(m0,mN),mC,(mF,f),o,m)=sz = size of map, the pattern repeats every so many keys8(m0,mN) = the first and last midi note numbers to retunemC = the middle note where the first entry of the mapping is mapped to(mF,f) = the reference midi-note for which a frequency is given, ie. (69,440)3o = scale degree to consider as formal octavem = mapping, numbers represent scale degrees mapped to keys, Nothing indicates no mappinghmt#Pretty-printer for scala .kbm file.hmtIs mnn in range?hmtIs kbm linear?, ie. is size zero? (formal-octave may or may not be zero)hmt>= \x -> putStrLn (kbm_pp x) pp "example" pp "bp" pp "7" -- error -- 12/#13 pp "8" -- error -- 12/#13 pp "white" -- error -- 12/#13 pp "black" -- error -- 12/#13 pp "128" pp "a440" pp "61"hmtIf nm+ is a file name (has a .kbm) extension run  else run .hmt!Load all .kbm files at directory.hmt&Load all .kbm files at scala dist dir. db <- kbm_load_dist_dir_fn length db == 41 x = map (\(fn,(sz,_,_,_,o,m)) -> (System.FilePath.takeFileName fn,sz,length m,o)) db filter (\(_,i,j,_) -> i < j) x -- size < map-length filter (\(_,i,_,k) -> i == 0 && k == 0) x -- size and formal octave both zero map (\(fn,k) -> (System.FilePath.takeFileName fn,kbm_lookup_mF k)) dbhmt#Pretty-printer for scala .kbm file. m <- kbm_load_dist "7.kbm" kbm_parse (kbm_format m) == m putStrLn $ kbm_pp mhmt of hmt7Standard 12-tone mapping with A=440hz (ie. example.kbm) fmap (== kbm_d12_a440) (kbm_load_dist "example.kbm") putStrLn $ kbm_pp kbm_d12_a440hmtGiven size and note-center calculate relative octave and key number (not scale degree) of the zero entry. 5map (kbm_k0 12) [59,60,61] == [(-4,1),(-5,0),(-5,11)]hmtGiven size and note-center calculate complete octave and key number sequence (ie. for entries 0 - 127). /map (zip [0..] . kbm_oct_key_seq 12) [59,60,61]hmt5Given Kbm and SCL calculate frequency of note-center.hmtGiven Kbm and SCL calculate fractional midi note-numbers for each key.hmt5Given Kbm and SCL calculate frequencies for each key.W Safe-Inferred? hmtLength prefixed list of .hmt,Interval and name, ie. (3/2,"perfect fifth")hmtLookup ratio in . db <- load_intnam intnam_search_ratio db (3/2) == Just (3/2,"perfect fifth") intnam_search_ratio db (2/3) == Nothing intnam_search_ratio db (4/3) == Just (4/3,"perfect fourth") intnam_search_ratio db (31/16) == Just (31/16,"=31st harmonic") intnam_search_ratio db (64/49) == Just (64 % 49,"=2 septatones or septatonic major third") map (intnam_search_ratio db) [3/2,4/3,7/4,7/6,9/7,9/8,12/7,14/9] import Data.Maybe mapMaybe (intnam_search_ratio db) [567/512,147/128,21/16,1323/1024,189/128,49/32,441/256,63/32]hmtLookup approximate ratio in  given espilon. r = [Just (3/2,"perfect fifth"),Just (64/49,"=2 septatones or septatonic major third")] map (intnam_search_fratio 0.0001 db) [1.5,1.3061] == rhmt"Lookup name of interval, or error.hmtLookup interval name in , ci = case-insensitive. db <- load_intnam intnam_search_description_ci db "didymus" == [(81/80,"syntonic comma, Didymus comma")]hmtParse line from intnam.parhmt'Parse non-comment lines from intnam.parhmt of  of "intnam.par". intnam <- load_intnam fst intnam == 516 -- Scala 2.42p fst intnam == length (snd intnam) lookup (129140163/128000000) (snd intnam) == Just "gravity comma"  X Safe-Inferredhmt 6http://www.huygens-fokker.org/scala/help.htm#EQUALTEMP map round (equaltemp 12 2 13) == [0,100,200,300,400,500,600,700,800,900,1000,1100,1200] map round (equaltemp 13 3 14) == [0,146,293,439,585,732,878,1024,1170,1317,1463,1609,1756,1902] map round (equaltemp 12.5 3 14) == [0,152,304,456,609,761,913,1065,1217,1369,1522,1674,1826,1978]hmt 7http://www.huygens-fokker.org/scala/help.htm#LINEARTEMP let py = lineartemp 12 2 () (3/2 :: Rational) 3 py == [1/1,2187/2048,9/8,32/27,81/64,4/3,729/512,3/2,6561/4096,27/16,16/9,243/128,2/1]hmt ;http://www.huygens-fokker.org/scala/help.htm#SHOW_INTERVALS 5mapM_ intervals_list_ratios (words "pyth_12 kepler1")hmtGiven interval function (ie.   or  *) and scale generate interval half-matrix.Y Safe-Inferred fhmtTuning, ratios for each octave. length (concat dr_tuning_oct) == 19 import qualified Music.Theory.Tuning as T map (map (T.ratio_to_cents . t2_to_ratio)) dr_tuning_octhmtTuning, actual ratios.hmtActual scale, in CPS. let r = [52,69,76,83,92,104,119,138,156,166,185,208,234,260,277,286,311,332,363] map round dr_scale == r  Z Safe-Inferred 0 hmtEdges are (v1,v2) where v1 < v2hmt R = Rationalhmt(Flip a ratio in (1,2) and multiply by 2. import Data.Ratio {- base -} map r_flip [5%4,3%2,7%4] == [8%5,4%3,8%7] map r_flip [3/2,5/4,7/4] == [4/3,8/5,8/7]hmtr = ratio, nrm = normalisehmt The folded interval from p to q. r_rel (1,3/2) == 4/3hmtThe interval set i and it's .hmtRequire r to have a perfect octave as last element, and remove it.hmtDoes [R] construct indicated pcset.hmtThe graph with vertices scl_r. and all edges where the interval (i,j) is in iset.[ Safe-Inferred{hmt9The tuning has four octaves, these ratios are per-octave.hmtFour-octave tuning. import Data.List.Split let r = [[ 0, 84, 204, 316, 386, 498, 583, 702, 814, 884, 969,1088] ,[1200,1284,1404,1516,1586,1698,1783,1902,2014,2084,2169,2288] ,[2400,2453,2604,2716,2786,2871,2951,3102,3214,3241,3369,3488] ,[3600,3684,3804,3867,3986,4098,4151,4302,4414,4506,4569,4688]] in chunksOf 12 (cents_i ps5_jpr) == r let r = [[0,84,204,316,386,498,583,702,814,884,969,1088] ,[0,84,204,316,386,498,583,702,814,884,969,1088] ,[0,53,204,316,386,471,551,702,814,841,969,1088] ,[0,84,204,267,386,498,551,702,814,906,969,1088]] chunksOf 12 (map (`mod` 1200) (cents_i ps5_jpr))\ Safe-InferredhmtThree interlocking harmonic series on 1:5:3, by Larry Polansky in "Psaltery". import qualified Music.Theory.Tuning.Scala as T scl <- T.scl_load "polansky_ps" T.pitch_representations (T.scale_pitches scl) == (0,50) 1 : Data.Either.rights (T.scale_pitches scl) == psaltery_rhmt of psaltery. 4length psaltery_r == 51 && length psaltery_o_r == 21 psaltery_o_r == [1,65/64,33/32,17/16,35/32,9/8,75/64,39/32 ,5/4,21/16,85/64,11/8,45/32 ,3/2,25/16,51/32,13/8,27/16,55/32,7/4,15/8]hmtTuning derived from  with  octave_ratio of 2. cents_i psaltery_o == [0,27,53,105,155,204,275,342,386,471,491,551,590",702,773,807,841,906,938,969,1088] let r = [0,1200,1902,2400,2786,3102,3369,3600,3804,3986,4151,4302,4441,4569,4688,4800,4905,386,1586,2288,2786,3173,3488,3755,3986,4190,4373,4538,4688,4827,4955,5075,5186,5291 ,702,1902,2604,3102,3488,3804,4071,4302,4506,4688,4853,5004,5142,5271,5390,5502] > in cents_i (T.scale_tuning 0.01 scl) == r] Safe-Inferredhmt/Midi-note-number -> Cps table, possibly sparse.hmtmidi-note-number -> fractional-midi-note-number table, possibly sparse.hmt(t,f0,k,g) where t=tuning, f0=fundamental-frequency, k=midi-note-number (for f0), g=gamuthmt(t,c,k) where t=tuning (must have 12 divisions of octave), c=cents deviation (ie. constant detune offset), k=midi offset (ie. value to be added to incoming midi note number).hmt.Variant for sparse tunings that require state.hmt(Variant for tunings that are incomplete.hmt(n -> dt#). Function from midi note number n to  Midi_Detune dt. The incoming note number is the key pressed, which may be distant from the note sounded.hmtLift  to .hmtLift  to .hmt for . let f = d12_midi_tuning_f (equal_temperament 12,0,0) map f [0..127] == zip [0..127] (repeat 0)hmt for 1. The function is sparse, it is only valid for g values from k. import qualified Music.Theory.Pitch as T let f = cps_midi_tuning_f (equal_temperament 72,T.midi_to_cps 59,59,72 * 4) map f [59 .. 59 + 72]hmtLoad  from two-column Csv file.hmt Generates  given  with keys for all valid Mnn. import Sound.SC3.Plot let f = cps_midi_tuning_f (equal_temperament 12,T.midi_to_cps 0,0,127) plot_p2_ln [map (fmap round) (gen_cps_tuning_tbl f)]hmt Given an  tbl , a list of Cps c, and a Mnn m find the Cps in c that is nearest to the Cps in t for m%. In equal distance cases bias left.hmtRequire table be non-sparse.hmt%Given two tuning tables generate the dtt table.^ Safe-Inferred_ Safe-Inferredmhmtcps = (tuning-name,frequency-zero,midi-note-number-of-f0) d12 = (tuning-name,cents-deviation,midi-note-offset)hmtLoad possibly sparse and possibly one-to-many (midi-note-number,cps-frequency) table from Csv file. !load_cps_tbl "/home/rohan/dr.csv"hmtLoad scala scl file as .hmtLoad scala file and apply .hmtLoad scala file and apply .hmt'Lookup first matching element in table.hmt8Randomly choose from elements in table, equal weighting.hmtLoad tuning table with stateful selection function for one-to-many entries.  ` Safe-Inferred%/ hmtHarmonic series to n"th partial, with indicated octave. harmonic_series 17 2hmtHarmonic series on n.hmtn elements of . let r = [55,110,165,220,275,330,385,440,495,550,605,660,715,770,825,880,935] harmonic_series_cps_n 17 55 == rhmtSub-harmonic series on n.hmtn elements of . let r = [1760,880,587,440,352,293,251,220,196,176,160,147,135,126,117,110,104] map round (subharmonic_series_cps_n 17 1760) == rhmtnth partial of f1, ie. one indexed. (map (partial 55) [1,5,3] == [55,275,165]hmt%Derivative harmonic series, based on kth partial of f1. import Music.Theory.Pitch let r = [52,103,155,206,258,309,361,412,464,515,567,618,670,721,773] let d = harmonic_series_cps_derived 5 (T.octpc_to_cps (1,4)) map round (take 15 d) == rhmtHarmonic series to n)th harmonic (folded, duplicated removed). harmonic_series_folded_r 17 == [1,17/16,9/8,5/4,11/8,3/2,13/8,7/4,15/8] let r = [0,105,204,386,551,702,841,969,1088] map (round . ratio_to_cents) (harmonic_series_folded_r 17) == rhmt variant of .hmt12-tone tuning of first 21! elements of the harmonic series. tn_cents_i harmonic_series_folded_21 == [0,105,204,298,386,471,551,702,841,969,1088] tn_divisions harmonic_series_folded_21 == 11  a Safe-Inferred/hmt Ratios for /. lmy = La Monte Young. wtp = Well-Tuned Piano. let c = [0,177,204,240,471,444,675,702,738,969,942,1173] in map (round . T.ratio_to_cents) lmy_wtp_r == chmtThe pitch-class of the key associated with each ratio of the tuning. 9mapMaybe lmy_wtp_ratio_to_pc [1,1323/1024,7/4] == [3,8,0]hmt;The list of all non-unison ascending intervals possible in . length lmy_wtp_univ == 66hmtCollated and sorted . 0let r_cents_pp = show . round . T.ratio_to_cents (import qualified Music.Theory.Math as T  let f (r,i) = concat [T.ratio_pp r," = " ,r_cents_pp r," = #" ,show (length i)," = " ,unwords (map show i)] 'putStrLn $ unlines $ map f lmy_wtp_uniq3:2 = 702 = #9 = (3,10) (4,9) (5,10) (6,11) (6,1) (7,0) (7,2) (8,1) (9,2) 7:4 = 969 = #7 = (3,0) (5,2) (6,7) (7,10) (8,9) (11,0) (1,2) 7:6 = 267 = #6 = (4,8) (5,7) (6,2) (7,11) (9,1) (10,0) 9:7 = 435 = #4 = (4,1) (5,0) (6,9) (11,2) 9:8 = 204 = #6 = (3,5) (4,2) (6,8) (7,9) (11,1) (0,2) 21:16 = 471 = #6 = (3,7) (5,9) (6,0) (7,1) (8,2) (10,2) 27:14 = 1137 = #2 = (4,6) (9,11) 27:16 = 906 = #3 = (4,7) (8,11) (9,0) 49:32 = 738 = #3 = (3,11) (5,1) (6,10) 49:36 = 534 = #1 = (5,11) 63:32 = 1173 = #5 = (3,2) (4,5) (8,7) (9,10) (1,0) 49:48 = 36 = #2 = (5,6) (10,11) 81:56 = 639 = #1 = (4,11) 81:64 = 408 = #1 = (4,0) 147:128 = 240 = #3 = (3,6) (5,8) (10,1) 189:128 = 675 = #3 = (3,9) (4,10) (8,0) 441:256 = 942 = #2 = (3,1) (8,10) 567:512 = 177 = #1 = (3,4) 1323:1024 = 444 = #1 = (3,8)hmtGann, 1993, p.137. cents_i lmy_wtp == [0,177,204,240,471,444,675,702,738,969,942,1173] import Data.List import Music.Theory.Tuning.Scala scl <- scl_load "young-lm_piano" cents_i (scale_to_tuning 0.01 scl) == cents_i lmy_wtp let f = d12_midi_tuning_f (lmy_wtp,-74.7,-3) import qualified Music.Theory.Pitch as T T.octpc_to_midi (-1,11) == 11 map (round . T.midi_detune_to_cps . f) [62,63,69] == [293,298,440] map (fmap round . T.midi_detune_normalise . f) [0 .. 127]hmtRatios for 'lmy_wtp_1964.hmtLa Monte Young's initial 1964 tuning for "The Well-Tuned Piano" (Gann, 1993, p.141). cents_i lmy_wtp_1964 == [0,149,204,240,471,647,675,702,738,969,1145,1173] import Music.Theory.Tuning.Scala let nm = ("young-lm_piano_1964","LaMonte Young's Well-Tuned Piano (1964)") let scl = tuning_to_scale nm lmy_wtp_1964 putStr $ unlines $ scale_pp sclhmtEuler diagram for . let dir = "homerohanswhmtdatadot/" let f = unlines . T.euler_plane_to_dot_rat (3,True) writeFile (dir ++ "euler-wtp.dot") (f lmy_wtp_euler)  b Safe-Inferred6 hmtApproximate ratios for . let c = [0,90,192,294,390,498,588,696,792,888,996,1092] in map (round . ratio_to_cents) werckmeister_iii_ar == chmt Cents for .hmt2Werckmeister III, Andreas Werckmeister (1645-1706) cents_i werckmeister_iii == [0,90,192,294,390,498,588,696,792,888,996,1092] import Music.Theory.Tuning.Scala scl <- scl_load "werck3" cents_i (scale_tuning 0.01 scl) == cents_i werckmeister_iiihmtApproximate ratios for . let c = [0,82,196,294,392,498,588,694,784,890,1004,1086] in map (round . ratio_to_cents) werckmeister_iv_ar == chmt Cents for .hmt1Werckmeister IV, Andreas Werckmeister (1645-1706) cents_i werckmeister_iv == [0,82,196,294,392,498,588,694,784,890,1004,1086] scl <- scl_load "werck4" cents_i (scale_tuning 0.01 scl) == cents_i werckmeister_ivhmtApproximate ratios for . let c = [0,96,204,300,396,504,600,702,792,900,1002,1098] in map (round . ratio_to_cents) werckmeister_v_ar == chmt Cents for .hmt0Werckmeister V, Andreas Werckmeister (1645-1706) cents_i werckmeister_v == [0,96,204,300,396,504,600,702,792,900,1002,1098] scl <- scl_load "werck5" cents_i (scale_tuning 0.01 scl) == cents_i werckmeister_vhmt Ratios for  , with supposed correction of 2825 to 4944. let c = [0,91,186,298,395,498,595,698,793,893,1000,1097] in map (round . ratio_to_cents) werckmeister_vi_r == chmt1Werckmeister VI, Andreas Werckmeister (1645-1706) cents_i werckmeister_vi == [0,91,186,298,395,498,595,698,793,893,1000,1097] scl <- scl_load "werck6" cents_i (scale_tuning 0.01 scl) == cents_i werckmeister_vi  c Safe-Inferred9hmt Ratios for . let r = [0,112,204,316,386,498,610,702,814,884,996,1088] in map (round . ratio_to_cents) riley_albion_r == rhmtRiley's five-limit tuning as used in _The Harp of New Albion_, see  1http://www.ex-tempore.org/Volx1/hudson/hudson.htm. cents_i riley_albion == [0,112,204,316,386,498,610,702,814,884,996,1088] import Music.Theory.Tuning.Scala scl <- scl_load "riley_albion" cents_i (scale_tuning 0.01 scl) == cents_i riley_albiond Safe-InferredH hmt Ratios for  pythagorean.hmtPythagorean tuning,  :http://www.microtonal-synthesis.com/scale_pythagorean.html. cents_i pythagorean_12 == [0,114,204,294,408,498,612,702,816,906,996,1110] scl <- scl_load "pyth_12" cents_i (scale_tuning 0.1 scl) == cents_i pythagorean_12hmt Ratios for . let c = [0,112,204,316,386,498,590,702,814,884,996,1088] in map (round . ratio_to_cents) five_limit_tuning_r == chmtFive-limit tuning (five limit just intonation), Alexander Malcolm's Monochord (1721). cents_i five_limit_tuning == [0,112,204,316,386,498,590,702,814,884,996,1088] scl <- scl_load "malcolm" cents_i (scale_tuning 0.1 scl) == cents_i five_limit_tuninghmt Ratios for . let c = [0,112,204,316,386,498,583,702,814,884,1018,1088] in map (round . ratio_to_cents) septimal_tritone_just_intonation == chmt'Septimal tritone Just Intonation, see >http://www.microtonal-synthesis.com/scale_just_intonation.html let c = [0,112,204,316,386,498,583,702,814,884,1018,1088] in cents_i septimal_tritone_just_intonation == c scl <- scl_load "ji_12" cents_i (scale_tuning 0.1 scl) == cents_i septimal_tritone_just_intonationhmt Ratios for . let c = [0,112,204,316,386,498,583,702,814,884,969,1088] in map (round . ratio_to_cents) seven_limit_just_intonation == chmtSeven limit Just Intonation. cents_i seven_limit_just_intonation == [0,112,204,316,386,498,583,702,814,884,969,1088]hmtApproximate ratios for . let c = [0,90,193,294,386,498,590,697,792,890,996,1088] in map (round.to_cents) kirnberger_iii_ar == chmt 9http://www.microtonal-synthesis.com/scale_kirnberger.html. cents_i kirnberger_iii == [0,90,193,294,386,498,590,697,792,890,996,1088] scl <- scl_load "kirnberger" cents_i (scale_tuning 0.1 scl) == cents_i kirnberger_iiihmt0Vallotti & Young scale (Vallotti version), see  =http://www.microtonal-synthesis.com/scale_vallotti_young.html. cents_i vallotti == [0,94,196,298,392,502,592,698,796,894,1000,1090] scl <- scl_load "vallotti" cents_i (scale_tuning 0.1 scl) == cents_i vallottihmt.Mayumi Tsuda 13-limit Just Intonation scale,  7http://www.microtonal-synthesis.com/scale_reinhard.html. cents_i mayumi_tsuda == [0,128,139,359,454,563,637,746,841,911,1072,1183] scl <- scl_load "tsuda13" cents_i (scale_tuning 0.1 scl) == cents_i mayumi_tsudahmt Ratios for . length lou_harrison_16_r == 16 let c = [0,112,182,231,267,316,386,498,603,702,814,884,933,969,1018,1088] in map (round . ratio_to_cents) lou_harrison_16_r == chmt1Lou Harrison 16 tone Just Intonation scale, see :http://www.microtonal-synthesis.com/scale_harrison_16.html let r = [0,112,182,231,267,316,386,498,603,702,814,884,933,969,1018,1088] in cents_i lou_harrison_16 == r import Music.Theory.Tuning.Scala scl <- scl_load "harrison_16" cents_i (scale_tuning 0.1 scl) == cents_i lou_harrison_16hmt Ratios for .hmt!Harry Partch 43 tone scale, see 5http://www.microtonal-synthesis.com/scale_partch.html cents_i partch_43 == [0,22,53,84,112,151,165 ,182,204,231,267,294,316 ,347,386,418,435 ,471,498,520,551,583,617,649 ,680,702,729,765,782,814,853,884,906,933 ,969,996,1018,1035,1049,1088,1116,1147,1178] scl <- scl_load "partch_43" cents_i (scale_tuning 0.1 scl) == cents_i partch_43hmt Ratios for .hmt1Ben Johnston 25 note just enharmonic scale, see :http://www.microtonal-synthesis.com/scale_johnston_25.html scl <- scl_load "johnston_25" cents_i (scale_tuning 0.1 scl) == cents_i ben_johnston_25e Safe-InferredQz hmt Cents for . let c = [0,76,193,310,386,503,580,697,773,890,1007,1083] map round pietro_aaron_1523_c == c *map ((+ 60) . (/ 100)) pietro_aaron_1523_chmt/Pietro Aaron (1523) meantone temperament, see $http://www.kylegann.com/histune.html tn_cents_i pietro_aaron_1523 == [0,76,193,310,386,503,580,697,773,890,1007,1083] import Music.Theory.Tuning.Scala scl <- scl_load "meanquar" tn_cents_i (scale_to_tuning 0.01 scl) == [0,76,193,310,386,503,579,697,773,890,1007,1083]hmt Cents for . let c = [0,94,196,298,392,500,592,698,796,894,1000,1092] map round thomas_young_1799_c == chmt'Thomas Young (1799), Well Temperament,  $http://www.kylegann.com/histune.html. tn_cents_i thomas_young_1799 == [0,94,196,298,392,500,592,698,796,894,1000,1092] scl <- scl_load "young2" tn_cents_i (scale_to_tuning 0.01 scl) == tn_cents_i thomas_young_1799hmt Ratios for zarlino. length zarlino_1588_r == 16hmtGioseffo Zarlino, 1588, see  #http://www.kylegann.com/tuning.html. tn_divisions zarlino_1588 == 16 tn_cents_i zarlino_1588 == [0,71,182,204,294,316,386,498,569,590,702,773,884,996,1018,1088] scl <- scl_load "zarlino2" tn_cents_i (scale_to_tuning 0.01 scl) == tn_cents_i zarlino_1588hmt Ratios for . let c = [0,105,204,298,386,471,551,702,841,906,969,1088] map (round . ratio_to_cents) ben_johnston_mtp_1977_r == chmt9Ben Johnston's "Suite for Microtonal Piano" (1977), see #http://www.kylegann.com/tuning.html tn_cents_i ben_johnston_mtp_1977 == [0,105,204,298,386,471,551,702,841,906,969,1088]hmt Ratios for .hmtKyle Gann, _Arcana XVI_, see  #http://www.kylegann.com/Arcana.html. let r = [0,84,112,204,267,316,347,386,471,498,520,583,663,702,734,814,845,884,898,969,1018,1049,1088,1161] tn_cents_i gann_arcana_xvi == rhmt Ratios for .hmt"Kyle Gann, _Superparticular_, see  "http://www.kylegann.com/Super.html. 'tn_divisions gann_superparticular == 22 let r = [0,165,182,204,231,267,316,386,435,498,551,583,617,702,782,765,814,884,933,969,996,1018] tn_cents_i gann_superparticular == r scl <- scl_load "gann_super" tn_cents_i (scale_to_tuning 0.01 scl) == tn_cents_i gann_superparticular  f Safe-InferredShmt Ratios for  (SCALA=pyth_12) import Music.Theory.Tuning let c = [0,114,204,294,408,498,612,702,816,906,996,1110] map (round . ratio_to_cents) harrison_ditone_r == c import Music.Theory.Tuning.Scala scl_find_ji (harrison_ditone_r ++ [2])hmtDitonepythagorean tuning, tn_divisions harrison_ditone == 12 tn_cents_i harrison_ditone == [0,114,204,294,408,498,612,702,816,906,996,1110]g Safe-InferredVHhmtHMC slendro tuning. ,cents_i alves_slendro == [0,231,498,765,996] import Music.Theory.Tuning.Scala scl <- scl_load "alves_slendro" tn_cents_i (scale_to_tuning 0.01 scl) == tn_cents_i alves_slendrohmtHMC  pelog bem tuning. 1tn_cents_i alves_pelog_bem == [0,231,316,702,814] scl <- scl_load "alves_pelog" tn_cents_i (scale_to_tuning 0.01 scl) == [0,231,316,471,702,814,969]hmtHMC  pelog barang tuning. 4tn_cents_i alves_pelog_barang == [0,386,471,857,969]hmtHMC pelog 2,3,4,6,7 tuning. 3tn_cents_i alves_pelog_23467 == [0,386,471,702,969]h Safe-InferredVhmt$(last-name,first-name,title,year,hmt tuning,scalaname)i Safe-Inferredm<hmt(ratio,M3-steps)hmt(ratio,multiplier,steps)hmt>(maybe (maybe lattice-design, maybe primes),gr-attr,vertex-pp)hmtRatio given as (n,d)hmtPositions in a k-lattice are given as a k-list of steps.hmt A discrete k'-lattice is described by a sequence of k-factors. Values are ordinarily though not necessarily primes beginning at three.hmtk-unit co-ordinates for k -lattice.hmtNormalise set of points to lie in (-1,-1) - (1,1), scaling symetrically about (0,0) pt_set_normalise_sym [(40,0),(0,40),(13,11),(-8,4)] == [(1,0),(0,1),(0.325,0.275),(-0.2,0.1)] pt_set_normalise_sym [(-10,0),(1,10)] == [(-1,0),(0.1,1)]hmtErv Wilson standard lattice, unit co-ordinates for 5-dimensions, ie. [3,5,7,11,13] (http://anaphoria.com/wilsontreasure.htmlhmtKraig Grady standard lattice, unit co-ordinates for 5-dimensions, ie. [3,5,7,11,13] (http://anaphoria.com/wilsontreasure.htmlhmtErv Wilson tetradic lattice (3-lattice), used especially when working with hexanies or 7 limit tunings (http://anaphoria.com/wilsontreasure.htmlhmtDelete entry at index.hmt5Resolve Lattice_Position against Lattice_Design to V2hmt0White-space pretty printer for Lattice_Position. %pos_pp_ws (3,[0,-2,1]) == " 0 -2 1"hmtGiven Lattice_Factors [X,Y,Z..] and Lattice_Position [x,y,z..], calculate the indicated ratio. =lat_res (2,[3,5]) (2,[-5,2]) == (5 * 5) / (3 * 3 * 3 * 3 * 3)hmtRemove all octaves from n and d.hmtLift  function to  .hmtConvert  to  hmtMediant, ie. n1+n2/d1+d2  rat_mediant (0,1) (1,2) == (1,3)hmtRat written as n/dhmtLifted . 5map ew_r_rem_oct [256/243,7/5,1/7] == [1/243,7/5,1/7]hmt Assert that n is in [1,2).hmtFind limit of set of ratios, ie. largest factor in either numerator or denominator. r_seq_limit [1] == 1hmtFind factors of set of ratios, ie. the union of all factor in both numerator & denominator. 7r_seq_factors [1/3,5/7,9/8,13,27,31] == [2,3,5,7,13,31]hmtVector of prime-factors up to limit. map (rat_fact_lm 11) [3,5,7,2/11] == [(5,[0,1,0,0,0]),(5,[0,0,1,0,0]),(5,[0,0,0,1,0]),(5,[1,0,0,0,-1])]hmt add position attribute if a  is given.hmt of hmt-Divide MOS, keeps retained value on same side mos_step (5,7) == (5,2) mos_step (5,2) == (3,2) mos_step (3,2) == (1,2)hmtP.3 7-limit {Scala=nil} :db <- Scala.scl_load_db ew_scl_find_r (1 : ew_1357_3_r) dbhmtP.7 11-limit {Scala=nil} ew_scl_find_r ew_el12_7_r dbhmt P.9 7-limit {Scala=wilson_class} ew_scl_find_r ew_el12_9_r dbhmtP.12 11-limit {Scala=nil} ew_scl_find_r ew_el12_12_r dbhmtP.2 11-limit {Scala=wilson_l4} ew_scl_find_r ew_el22_2_r dbhmtP.3 11-limit {Scala=wilson_l5} ew_scl_find_r ew_el22_3_r dbhmtP.4 11-limit {Scala=wilson_l3} ew_scl_find_r ew_el22_4_r dbhmtP.5 11-limit {Scala=wilson_l1} ew_scl_find_r ew_el22_5_r dbhmtP.6 11-limit {Scala=wilson_l2} ew_scl_find_r ew_el22_6_r dbhmt%P.7 & P.12 11-limit {Scala=partch_29}1,3,5,7,9,11 diamond -ew_scl_find_r ew_diamond_12_r db -- partch_29hmt%P.10 & P.13 13-limit {Scala=novaro15}1,3,5,7,9,11,13,15 diamond ,ew_scl_find_r ew_diamond_13_r db -- novaro15hmtP.6hmtP.6hmtP.10hmtP.12 {Scala=nil})22-tone 23-limit Evangalina tuning (2001) ew_scl_find_r ew_hel_12_r dbhmtshe = Stellate Hexany Expansions, P.10 {Scala=stelhex1,stelhex2,stelhex5,stelhex6} she [1,3,5,7] == [1,21/20,15/14,35/32,9/8,5/4,21/16,35/24,3/2,49/32,25/16,105/64,7/4,15/8] mapM (flip ew_scl_find_r db . she) [[1,3,5,7],[1,3,5,9],[1,3,7,9],[1,3,5,11]] ew_scl_find_r (she [1,(5*7)/(3*3),1/(3 * 5),1/3]) db -- NILhmtMeru 2 = META-PELOG map (sum . meru_2) [1 .. 14] == [1,1,1,2,3,4,6,9,13,19,28,41,60,88]hmtmeru_3 = META-SLENDROhmtP.13, tanabe {Scala=chin_7} #ew_scl_find_r ew_mos_13_tanabe_r dbhmtP.1 {Scala=nil}23-tone 7-limit (2004) )ew_scl_find_r ew_novarotreediamond_1_r dbhmtP.2 {Scala=nil}9-tone Pelog cycle (1988) "ew_scl_find_r ew_Pelogflute_2_r dbhmt P.9, Fig. 3hmt P.9, Fig. 4hmt/P.3 Turkisk Baglama Scale {11-limit, Scala=nil}hmtP.9 {SCALA 5=nil 7=ptolemy_idiat 12=nil 19=wilson2 31=wilson_31} mapM ew_scl_find_r xen3b_9_r dbhmtP.13 {SCALA 5=slendro5_2 7=ptolemy_diat2 12=nil 17=nil 22=wilson7_4}hmtPP.1-2 {SCALA: 22=wilson7_4}#17,31,41 lattices from XEN3B (1975)hmt$P.9 {Scala=nil ; Scala:Rot=wilson11}*19-tone scale for the Clavichord-19 (1976) ew_scl_find_r ew_xen456_9_r db import qualified Music.Theory.List as List Scala.scl_find_ji List.is_subset ew_xen456_9_r db -- NILhmt http://wilsonarchives.blogspot.com/2010/10/scale-for-rod-poole.html"13-limit 22-tone scale {Scala=nil} ew_scl_find_r ew_poole_r dbhmt http://wilsonarchives.blogspot.com/2014/05/an-11-limit-centaur-implied-in-wilson.html(11-limit 17-tone scale {Scala=wilcent17} ew_scl_find_r ew_centaur17_r dbhmt http://wilsonarchives.blogspot.com/2018/03/an-unusual-22-tone-7-limit-tuning.html!7-limit 22-tone scale {Scala=nil} ew_scl_find_r ew_two_22_7_r dbhmtScales not( present in the standard scala file set. mapM_ (Scala.scale_wr_dir "/home/rohan/sw/hmt/data/scl/") ew_scl_db map Scala.scale_name ew_scl_dbj Safe-InferredzhmtSequences are either in  or  order.hmt In a modulo m system, normalise step increments to be either -1 or 1. Non steps raise an error. 1map (normalise_step 6) [-5,-1,1,5] == [1,-1,1,-1]hmtWyschnegradsky writes the direction sign at the end of the number. (map parse_num_sign ["2+","4-"] == [2,-4]hmtExpand a chromatic (step-wise) sequence, sign indicates direction. .map vec_expand [2,-4] == [[1,1],[-1,-1,-1,-1]]hmtParse the vector notation used in some drawings, a comma separated list of chromatic sequences. parse_vec Nothing 0 "4-,4+,4-,4+,4-,4+,4-,4+,4-" parse_vec Nothing 0 "2+,2-,2+,2-,2+,2-,2+,2-,2+,18+"hmtModulo addition.hmt.Parse hex colour string, as standard in HTML5. &parse_hex_clr "#e14630" == (225,70,48)hmtType specialised.hmt/Normalise colour by dividing each component by m. 8clr_normalise 255 (parse_hex_clr "#ff0066") == (1,0,0.4)hmt Group sequence into normal (ie. ") order given drawing dimensions.hmt!Printer for pitch-class segments.hmt"Index to colour name abbreviation. map u3_ix_ch [0..5] == "ROYGBV"hmt Inverse of . map u3_ch_ix "ROYGBV" == [0..5]hmt1Drawing definition, as written by Wyschnegradsky. mapM_ (\(c,r) -> putStrLn (unlines ["C: " ++ c,"R: " ++ r])) u3_vec_text_iwhmtRe-written for local parser and to correct ambiguities and errors (to align with actual drawing). let f = parse_vec Nothing 0 in map (\(p,q) -> (f p,f q)) u3_vec_text_rw let f (c,r) = putStrLn (unlines ["C: " ++ c,"R: " ++ r]) mapM_ f (List.interleave u3_vec_text_iw u3_vec_text_rw)hmt Parse of . let {(c,r) = u3_vec_ix ; c' = map length c} in (length c,c',sum c',length r,map length r)hmtRadial indices (ie. each ray as an index sequence). 4putStrLn $ unlines $ map (map u3_ix_ch) u3_ix_radialhmtColour names in index sequence.hmt.Colour values (hex strings) in index sequence.hmt RGB form of .hmt8Notated radial color sequence, transcribed from drawing. map (\(n,c) -> let v = u3_ch_seq_to_vec c in (n,sum v,v)) u3_radial_chhmtNotated circumferenctial color sequence, transcribed from drawing. 1map (\(n,c) -> (n,u3_ch_seq_to_vec c)) u3_circ_chhmt;Translate notated sequence to "re-written" vector notation.hmt#Circumference pitch classes, C = 0. let c' = map length dc9_circ in (sum c',c') == (72,[5,6,7,2,3,4,4,3,2,7,7,4,4,3,2,2,3,4]) iw_pc_pp " | " dc9_circhmtRayon pitch classes, C = 0. 7length dc9_rad == 18 putStrLn $ unwords $ map f dc9_radhmtRadial indices. $map length dc9_ix == replicate 72 18hmt!Approximate colours, hex strings.hmtRGB form of colours.%%k Safe-Inferred hmtEnumeration of set of faces of a cube.hmtRelation between to  values as a (complementary,permutation) pair.hmtComplete sequence (ie. #8).hmtInitial half of  (ie. #4). The complete  is formed by appending the  of the .hmt)s for elements of the symmetric group P4.hmtComplement of a . =map complement [[4,1,3,2],[6,7,8,5]] == [[8,5,7,6],[2,3,4,1]]hmtForm  from . full_seq [3,2,4,1] == [3,2,4,1,7,6,8,5] label_of (full_seq [3,2,4,1]) == G2 label_of (full_seq [1,4,2,3]) == LhmtLower , ie.  or  . 8map lower [[4,1,3,2],[6,7,8,5]] == [[4,1,3,2],[2,3,4,1]]hmtApplication of  p on q. l_on Q1 I == Q1 l_on D Q12 == Q4 [l_on L L,l_on E D,l_on D E] == [L2,C,B]hmt%Generalisation of Fibonnaci process, f1 is the binary operator giving the next element, p and q are the initial elements.See discussion in: Carlos Agon, Moreno Andreatta, Grard Assayag, and Stphan Schaub. _Formal Aspects of Iannis Xenakis' "Symbolic Music": A Computer-Aided Exploration of Compositional Processes_. Journal of New Music Research, 33(2):145-159, 2004.Note that the article has an error, printing Q4 for Q11 in the sequence below. 'import qualified Music.Theory.List as T let r = [D,Q12,Q4, E,Q8,Q2, E2,Q7,Q4, D2,Q3,Q11, L2,Q7,Q2, L,Q8,Q11] (take 18 (fib_proc l_on D Q12) == r,T.duplicates r == [Q2,Q4,Q7,Q8,Q11])+Beginning E then G2 no Q nodes are visited. let r = [E,G2,L2,C,G,D,E,B,D2,L,G,C,L2,E2,D2,B] (take 16 (fib_proc l_on E G2) == r,T.duplicates r == [B,C,D2,E,G,L2]) let [a,b] = take 2 (T.segments 18 18 (fib_proc l_on D Q12)) in a == bThe prime numbers that are not factors of 18 are {1,5,7,11,13,17}. They form a closed group under modulo 18 multiplication. let n = [5,7,11,13,17] let r0 = [(5,7,17),(5,11,1),(5,13,11),(5,17,13)] let r1 = [(7,11,5),(7,13,1),(7,17,11)] let r2 = [(11,13,17),(11,17,7)] let r3 = [(13,17,5)] [(p,q,(p * q) `mod` 18) | p <- n, q <- n, p < q] == concat [r0,r1,r2,r3]=The article also omits the 5 after 5,1 in the sequence below. let r = [11,13,17,5,13,11,17,7,11,5,1,5,5,7,17,11,7,5,17,13,5,11,1,11] take 24 (fib_proc (\p q -> (p * q) `mod` 18) 11 13) == rhmt of  , inverse of . seq_of Q1 == [8,7,5,6,4,3,1,2]hmt of , ie.   . half_seq_of Q1 == [8,7,5,6]hmt of , ie.   4. .complement (half_seq (seq_of Q7)) == [3,4,2,1]hmt of  , inverse of . ;label_of [8,7,5,6,4,3,1,2] == Q1 label_of (seq_of Q4) == Q4hmt if two  s are complementary, ie. form a . )complementary [4,2,1,3] [8,6,5,7] == Truehmt Determine  of s. relate [1,4,2,3] [1,3,4,2] == (False,[0,3,1,2]) relate [1,4,2,3] [8,5,6,7] == (True,[1,0,2,3])hmt from  p to q. "relate_l L L2 == (False,[0,3,1,2])hmt adjacent  , see also .hmt adjacent s. =relations_l [L2,L,A] == [(False,[0,2,3,1]),(False,[2,0,1,3])]hmtApply  to . 7apply_relation (False,[0,3,1,2]) [1,4,2,3] == [1,3,4,2]hmtApply sequence of  to initial .hmt Variant of . =apply_relations_l (relations_l [L2,L,A,Q1]) L2 == [L2,L,A,Q1]hmtTable indicating set of faces of cubes as drawn in Fig. VIII-6 (p.220). lookup [1,4,6,7] faces == Just F_Left T.reverse_lookup F_Right faces == Just [2,3,5,8]hmtLabel sequence of Fig. VIII-6. Hexahedral (Octahedral) Group (p. 220) let r = [I,A,B,C,D,D2,E,E2,G,G2,L,L2,Q1,Q2,Q3,Q4,Q5,Q6,Q7,Q8,Q9,Q10,Q11,Q12] in viii_6_lseq == rhmt%Label sequence of Fig. VIII-7 (p.221) let r = [I,A,B,C,D,D2,E,E2,G,G2,L,L2,Q1,Q2,Q3,Q4,Q5,Q6,Q7,Q8,Q9,Q10,Q11,Q12] in viii_7_lseq == rhmtFig. VIII-7 (p.221) map (take 4) (take 4 viii_7) == [[I,A,B,C] ,[A,I,C,B] ,[B,C,I,A] ,[C,B,A,I]] import Music.Theory.Array.MD let t = md_matrix_opt show (\x -> "_" ++ x ++ "_") (head viii_7,head viii_7) viii_7 putStrLn $ unlines $ md_table' thmt'Label sequence of Fig. VIII-6/b (p.221) length viii_6b_l == length viii_6_l take 8 viii_6b_l == [I,A,B,C,D2,D,E2,E]hmtFig. VIII-6/b . viii_6b_p' == map half_seq_of viii_6b_l nub (map (length . nub) viii_6b_p') == [4]hmt Variant of  with .hmtFig. VIII-6/b. map (viii_6b !!) [0,8,16] == [(I,[1,2,3,4,5,6,7,8]) ,(G2,[3,2,4,1,7,6,8,5]) ,(Q8,[6,8,5,7,2,4,1,3])]hmtThe sequence of  to give viii_6_l from . apply_relations_l viii_6_relations L2 == viii_6_l length (nub viii_6_relations) == 14hmtThe sequence of  to give  viii_6b_l from . apply_relations_l viii_6b_relations I == viii_6b_l length (nub viii_6b_relations) == 10>>l Safe-Inferred hmtA Sieve.hmt hmt Primitive  of modulo and indexhmt of two shmt of two shmt of a hmtThe  of a list of s, ie.   .hmtThe  of a list of s, ie.   .hmtUnicode synonym for .hmtUnicode synonym for .hmt Synonym for .hmt)Pretty-print sieve. Fully parenthesised.hmt Variant of , ie.   . l 15 19 == L (15,19)hmtunicode synonym for .hmtIn a normal  m is   i. normalise (L (15,19)) == L (15,4) normalise (L (11,13)) == L (11,2)hmtPredicate to test if a  is normal. ;is_normal (L (15,4)) == True is_normal (L (11,13)) == FalsehmtPredicate to determine if an I is an element of the . map (element (L (3,1))) [1..4] == [True,False,False,True] map (element (L (15,4))) [4,19 .. 49] == [True,True,True,True]hmtI not in set. *take 9 (i_complement [1,3..]) == [0,2..16]hmt$Construct the sequence defined by a . Note that building a sieve that contains an intersection clause that has no elements gives _|_. let d = [0,2,4,5,7,9,11] let r = d ++ map (+ 12) d take 14 (build (union (map (l 12) d))) == rhmt Variant of  that gives the first n places of the  of . buildn 6 (union (map (l 8) [0,3,6])) == [0,3,6,8,11,14] buildn 12 (L (3,2)) == [2,5,8,11,14,17,20,23,26,29,32,35] buildn 9 (L (8,0)) == [0,8,16,24,32,40,48,56,64] buildn 3 (L (3,2) D L (8,0)) == [8,32,56] buildn 12 (L (3,1) D L (4,0)) == [0,1,4,7,8,10,12,13,16,19,20,22] buildn 14 (5E4 D 3E2 D 7E3) == [2,3,4,5,8,9,10,11,14,17,19,20,23,24] buildn 6 (3E0 D 4E0) == [0,3,4,6,8,9] buildn 8 (5E2 D 2E0 D 7E3) == [2,3,10,12,17,22,24,31] buildn 12 (5E1 D 7E2) == [1,2,6,9,11,16,21,23,26,30,31,36] buildn 19 (L (3,2) D L (7, 1)) == [1, 2, 5, 8, 11, 14, 15, 17, 20, 22, 23, 26, 29, 32, 35, 36, 38, 41, 43] buildn 19 (3E0 D 7E0) == [0, 3, 6, 7, 9, 12, 14, 15, 18, 21, 24, 27, 28, 30, 33, 35, 36, 39, 42] buildn 10 (3E2 D 4E7 D 6E9 D 15E18) == [3,11,23,33,35,47,59,63,71,83] let s = 3E2D4E7D6E11D8E7 D 6E9D15E18 D 13E5D8E6D4E2 D 6E9D15E19 let s' = 24E23 D 30E3 D 104E70 buildn 16 s == buildn 16 s' buildn 10 (24E23 D 30E3 D 104E70) == [3,23,33,47,63,70,71,93,95,119] let r = [2,3,4,5,8,9,10,11,14,17,19,20,23,24,26,29,31] buildn 17 (5E4 D 3E2 D 7E3) == r let r = [0,1,3,6,9,10,11,12,15,16,17,18,21,24,26,27,30] buildn 17 (5E1 D 3E0 D 7E3) == r let r = [0,2,3,4,6,7,9,11,12,15,17,18,21,22,24,25,27,30,32] buildn 19 (5E2 D 3E0 D 7E4) == rAgon et. al. p.155 let a = c (13E3 D 13E5 D 13E7 D 13E9) let b = 11E2 let c' = c (11E4 D 11E8) let d = 13E9 let e = 13E0 D 13E1 D 13E6 let f = (a D b) D (c' D d) D e buildn 13 f == [0,1,2,6,9,13,14,19,22,24,26,27,32] differentiate [0,1,2,6,9,13,14,19,22,24,26,27,32] == [1,1,4,3,4,1,5,3,2,2,1,5] import Music.Theory.Pitch  let n = [0,1,2,6,9,13,14,19,22,24,26,27,32] let r = "C C CL DL E F G A B C CL C E" unwords (map (pitch_class_pp . pc24et_to_pitch . (`mod` 24)) n) == r Jonchaies let s = map (17E) [0,1,4,5,7,11,12,16] let r = [1,3,1,2,4,1,4,1,1,3,1,2,4,1,4,1,1,3,1,2,4,1,4,1] differentiate (buildn 25 (union s)) == r let a2 = octpc_to_midi (2,9) let m = scanl (+) a2 r import Music.Theory.Pitch.Spelling.Table let p = "A2 A#2 C#3 D3 E3 G#3 A3 C#4 D4 D#4 F#4 G4 A4 C#5 D5 F#5 G5 G#5 B5 C6 D6 F#6 G6 B6 C7" unwords (map (pitch_pp_iso . midi_to_pitch pc_spell_sharp) m) == pNekua let s = [24E0,14E2,22E3,31E4,28E7,29E9,19E10,25E13,24E14,26E17,23E21,24E10,30E9,35E17,29E24,32E25,30E29,26E21,30E17,31E16] let r = [2,1,1,3,2,1,3,1,2,1,4,3,1,4,1,4,1,3,1,4,1,3,1,4,1,4,1,1,3,1,3,1,2,3,1,4,1,4,4,1] differentiate (buildn 41 (union s)) == r let a0 = octpc_to_midi (0,9) let m = scanl (+) a0 r import Music.Theory.Pitch.Spelling.Table let p = "A0 B0 C1 C#1 E1 F#1 G1 A#1 B1 C#2 D2 F#2 A2 A#2 D3 D#3 G3 G#3 B3 C4 E4 F4 G#4 A4 C#5 D5 F#5 G5 G#5 B5 C6 D#6 E6 F#6 A6 A#6 D7 D#7 G7 B7 C8" unwords (map (pitch_pp_iso . midi_to_pitch pc_spell_sharp) m) == p let s = [8E0D3E0,2E0D7E2,2E1D11E3,31E4,4E3D7E0,29E9,19E10,25E13,8E6D3E2,2E1D13E4,23E21,8E2D3E1,2E1D3E0D5E4,5E2D7E3,29E24,32E25,2E1D3E2D5E4,2E1D13E8,2E1D3E2D5E2,31E16] differentiate (buildn 41 (union s)) == r Major scale: let s = (c(3E2) D 4E0) D (c(3E1) D 4E1) D (3E2 D 4E2) D (c(3E0) D 4E3) buildn 7 s == [0,2,4,5,7,9,11] Nomos Alpha:let s = (c (13E3 D 13E5 D 13E7 D 13E9) D 11E2) D (c (11E4 D 11E8) D 13E9) D (13E0 D 13E1 D 13E6) let r = [0,1,2,6,9,13,14,19,22,24,26,27,32,35,39,40,45,52,53,58,61,65,66,71,78,79,84,87,90,91,92,97] buildn 32 s == rhmt"Standard differentiation function. differentiate [1,3,6,10] == [2,3,4] differentiate [0,2,4,5,7,9,11,12] == [2,2,1,2,2,2,1]hmt=Euclid's algorithm for computing the greatest common divisor. euclid 1989 867 == 51hmtBachet De Mziriac's algorithm. )de_meziriac 15 4 == 3 && euclid 15 4 == 1hmtAttempt to reduce the  of two  nodes to a singular  node. reduce_intersection (3,2) (4,7) == Just (12,11) reduce_intersection (12,11) (6,11) == Just (12,11) reduce_intersection (12,11) (8,7) == Just (24,23)hmt Reduce the number of nodes at a . reduce (L (3,2) D Empty) == L (3,2) reduce (L (3,2) D Empty) == L (3,2) reduce (L (3,2) D L (4,7)) == L (12,11) reduce (L (6,9) D L (15,18)) == L (30,3) let s = 3E2D4E7D6E11D8E7 D 6E9D15E18 D 13E5D8E6D4E2 D 6E9D15E19 reduce s == (24E23 D 30E3 D 104E70) putStrLn $ sieve_pp (reduce s) let s = 3E2D4E7D6E11D8E7 D 6E9D15E18 D 13E5D8E6D4E2 D 6E9D15E19 reduce s == (24E23 D 30E3 D 104E70)hmtPsappha (Flint) let r = [0,1,3,4,6,8,10,11,12,13,14,16,17,19,20,22,23,25,27,28,29,31,33,35,36,37,38] buildn 27 psappha_flint == rhmt. R. (Hommage  Maurice Ravel) (Squibbs, 1996)let r = [0,2,3,4,7,9,10,13,14,16,17,21,23,25,29,30,32,34,35,38,39,43,44,47,48,52,53,57,58,59,62,63,66,67,69,72,73,77,78,82,86,87] buildn 42 a_r_squibbs == r345m Safe-Inferred8hmtZ type.  map z_modulus [z7,z12] == [7,12]hmt  of . 4map (z_mod z12) [-1,0,1,11,12,13] == [11,0,1,11,0,1]hmtCommon moduli in music theory.hmtCommon moduli in music theory.hmtCommon moduli in music theory.hmtCommon moduli in music theory.hmtIs n in (0,m-1).hmt Add two Z. *map (z_add z12 4) [1,5,6,11] == [5,9,10,3]hmtThe underlying type i is presumed to be signed... z_sub z12 0 8 == 4 import Data.Word {- base -} z_sub z12 (0::Word8) 8 == 8 ((0 - 8) :: Word8) == 248 248 `mod` 12 == 8hmtAllowing unsigned i is rather inefficient... $z_sub_unsigned z12 (0::Word8) 8 == 4hmt Universe of . z_univ z12 == [0..11]hmtZ of  not in given set. z_complement z5 [0,2,3] == [1,4] z_complement z12 [0,2,4,5,7,9,11] == [1,3,6,8,10]hmtType generalised  . 5map integral_to_digit [0 .. 15] == "0123456789abcdef"hmt 16.hmt Alias for .hmt in braces, {1,2,3}.hmt in arrows,  1,2,3.hmt in brackets, [1,2,3].$$n Safe-Inferred]hmt,Shift sequence so the initial value is zero. $transpose_to_zero [1,2,5] == [0,1,4]hmt!Diatonic pitch class (Z7) set to chord. map dpcset_to_chord [[0,1],[0,2,4],[2,3,4,5,6]] == [[1,6],[2,2,3],[1,1,1,1,3]]hmt Inverse of . 6map chord_to_dpcset [[1,6],[2,2,3]] == [[0,1],[0,2,4]]hmtComplement, ie. in relation to . map dpcset_complement [[0,1],[0,2,4]] == [[2,3,4,5,6],[1,3,5,6]]hmtInterval class predicate (ie. ). 8map is_ic [-1 .. 4] == [False,True,True,True,True,False]hmtInterval to interval class. 'map i_to_ic [0..7] == [0,1,2,3,3,2,1,0]hmtIs chord , ie. is   7. is_chord [2,2,3]hmt)Interval vector, given list of intervals. iv [2,2,3] == [0,2,1]hmtComparison function for inv.hmtInterval normal form. >map inf [[2,2,3],[1,2,4],[2,1,4]] == [[2,2,3],[1,2,4],[2,1,4]]hmtInverse of chord (retrograde). let p = [1,2,4] in (inf p,invert p,inf (invert p)) == ([1,2,4],[4,2,1],[2,1,4])hmtComplement of chord. let r = [[1,1,1,1,3],[1,1,1,2,2],[1,1,2,1,2],[1,1,1,4],[2,1,1,3],[1,2,1,3],[1,2,2,2]] in map complement [[1,6],[2,5],[3,4],[1,1,5],[1,2,4],[1,3,3],[2,2,3]] == rhmt/Z7 pitch sequence to Z7 interval sequence, ie.  of  . map iseq (permutations [0,1,2]) == [[1,1],[6,2],[6,6],[1,5],[5,1],[2,6]] map iseq (permutations [0,1,3]) == [[1,2],[6,3],[5,6],[2,4],[4,1],[3,5]] map iseq (permutations [0,2,3]) == [[2,1],[5,3],[6,5],[1,4],[4,2],[3,6]] map iseq (permutations [0,1,4]) == [[1,3],[6,4],[4,6],[3,3],[3,1],[4,4]] map iseq (permutations [0,2,4]) == [[2,2],[5,4],[5,5],[2,3],[3,2],[4,5]]hmtIs n in (0,m - 1).hmtZ m universe, ie [0 .. m-1].hmt of 4.hmt of 7. z7_univ == [0 .. 6]hmt of 7.hmt  7.o Safe-InferredhmtSet class database with descriptors for historically and theoretically significant set classes, indexed by Forte name. lookup "6-Z17" sc_db == Just "All-Trichord Hexachord" lookup "7-35" sc_db == Just "diatonic collection (d)"p Safe-Inferredhmt   . (L.observeAll (fromList [1..7]) == [1..7]hmtInterval from i to j in modulo-n. -let f = int_n 12 in (f 0 11,f 11 0) == (11,1)hmt all-interval series. map (length . L.observeAll . all_interval_m) [4,6,8,10] == [2,4,24,288] [0,1,3,2,9,5,10,4,7,11,8,6] `elem` L.observeAll (all_interval_m 12) length (L.observeAll (all_interval_m 12)) == 3856hmt of . let r = [[0,1,5,2,4,3],[0,2,1,4,5,3],[0,4,5,2,1,3],[0,5,1,4,2,3]] all_interval 6 == r d_dx_n n l = zipWith (int_n n) l (tail l) map (d_dx_n 6) r == [[1,4,3,2,5],[2,5,3,1,4],[4,1,3,5,2],[5,2,3,4,1]]q Safe-InferredhmtINT operator. 9map (int z12) [[0,1,3,6,10],[3,7,0]] == [[1,2,3,4],[4,5]]r Safe-Inferred\hmtParse a pitch class object string. Each  is either a number, a space which is ignored, or a letter name for the numbers 10 (t or a or A ) or 11 (e or B or b). 2pco "13te" == [1,3,10,11] pco "13te" == pco "13ab"s Safe-Inferred hmt"Serial operator,of the form rRTMI.hmt Printer in rnRTnMI form.hmtParser for Sro.hmt1Parse a Morris format serial operator descriptor. ,sro_parse 5 "r2RT3MI" == Sro 2 True 3 5 Truehmt#The total set of serial operations. let u = z_sro_univ 3 5 z12 zip (map sro_pp u) (map (\o -> z_sro_apply z12 o [0,1,3]) u)hmtThe set of transposition s.hmt'The set of transposition and inversion s.hmt6The set of retrograde and transposition and inversion s.hmtThe set of transposition, M and inversion s.hmt$The set of retrograde,transposition,M5 and inversion s.hmt Apply Sro. z_sro_apply z12 (Sro 1 True 1 5 False) [0,1,2,3] == [11,6,1,4] z_sro_apply z12 (Sro 1 False 4 5 True) [0,1,2,3] == [11,6,1,4]hmtFind  s that map x to y given m and z. map sro_pp (z_sro_rel 5 z12 [0,1,2,3] [11,6,1,4]) == ["r1T4MI","r1RT1M"]hmt Transpose p by n. z_sro_tn z5 4 [0,1,4] == [4,0,3] z_sro_tn z12 4 [1,5,6] == [5,9,10]hmtInvert p about n. z_sro_invert z5 0 [0,1,4] == [0,4,1] z_sro_invert z12 6 [4,5,6] == [8,7,6] map (z_sro_invert z12 0) [[0,1,3],[1,4,8]] == [[0,11,9],[11,8,4]] import Data.Word {- base -} z_sro_invert z12 (0::Word8) [1,4,8] == [3,0,8]hmtComposition of invert about 0 and tn. z_sro_tni z5 1 [0,1,3] == [1,0,3] z_sro_tni z12 4 [1,5,6] == [3,11,10] (z_sro_invert z12 0 . z_sro_tn z12 4) [1,5,6] == [7,3,2]hmtModulo multiplication. 6z_sro_mn z12 11 [0,1,4,9] == z_sro_tni z12 0 [0,1,4,9]hmtM5, ie. mn 5. z_sro_m5 z12 [0,1,3] == [0,5,3]hmtT-related sequences of p. length (z_sro_t_related z12 [0,3,6,9]) == 12 z_sro_t_related z5 [0,2] == [[0,2],[1,3],[2,4],[3,0],[4,1]]hmtT/I-related sequences of p. length (z_sro_ti_related z12 [0,1,3]) == 24 length (z_sro_ti_related z12 [0,3,6,9]) == 24 z_sro_ti_related z12 [0] == map return [0..11]hmtR/T/I-related sequences of p. length (z_sro_rti_related z12 [0,1,3]) == 48 length (z_sro_rti_related z12 [0,3,6,9]) == 24hmtT/M/I-related sequences of p, duplicates removed.hmtR/T/M/I-related sequences of p, duplicates removed.hmtr/R/T/M/I-related sequences of p, duplicates removed.hmt Variant of tn , transpose p so first element is n. z_sro_tn_to z12 5 [0,1,3] == [5,6,8] map (z_sro_tn_to z12 0) [[0,1,3],[1,3,0],[3,0,1]] == [[0,1,3],[0,2,11],[0,9,10]]hmt Variant of invert, inverse about n th element. map (z_sro_invert_ix z12 0) [[0,1,3],[3,4,6]] == [[0,11,9],[3,2,0]] map (z_sro_invert_ix z12 1) [[0,1,3],[3,4,6]] == [[2,1,11],[5,4,2]]hmtThe standard t-matrix of p. 4z_tmatrix z12 [0,1,3] == [[0,1,3],[11,0,2],[9,10,0]]  t Safe-Inferred6hmt Bit array.hmtCoding.hmtNumber of bits at .hmtLogical complement.hmtPretty printer for .hmt Parse PP of . 8bit_array_parse "01001" == [False,True,False,False,True]hmt Generate  from *, the coding is most to least significant. map (bit_array_to_code . bit_array_parse) (words "000 001 010 011 100 101 110 111") == [0..7] bit_array_to_code (bit_array_parse "1100100011100") == 6428hmt Inverse of .  (p == q,p,q)) (z_sc_univ z12) (map snd sc_table)hmt,The Z12 set-class table (Forte prime forms). length sc_table == 224hmt&Unicode (non-breaking hyphen) variant.hmtLookup name of prime form of set class. It is an error for the input not to be a forte prime form. 1forte_prime_name [0,1,4,6] == ("4-Z15",[0,1,4,6])hmtLookup entry for set in table.hmtErroring varianthmt  of hmt7Lookup a set-class name. The input set is subject to  forte_prime of  before lookup. ?sc_name [0,2,3,6,7] == "5-Z18" sc_name [0,1,4,6,7,8] == "6-Z17"hmt/Long name (ie. with enumeration of prime form). -sc_name_long [0,1,4,6,7,8] == "6-Z17[012478]"hmt&Unicode (non-breaking hyphen) variant.hmt*Lookup a set-class given a set-class name. sc "6-Z17" == [0,1,2,4,7,8]hmt-The set-class table (Forte prime forms), ie.   of .hmt Cardinality n subset of . >map (length . scs_n) [1..11] == [1,6,12,29,38,50,38,29,12,6,1]hmtVector indicating degree of intersection with inversion at each transposition. tics z12 [0,2,4,5,7,9] == [3,2,5,0,5,2,3,4,1,6,1,4] map (tics z12) scshmtLocate Z relation of set class. 9fmap sc_name (z_relation_of (sc "7-Z12")) == Just "7-Z36"v Safe-Inferredhmt2Rahn prime form (comparison is rightmost inwards). *rahn_cmp [0,1,3,6,8,9] [0,2,3,6,7,9] == GThmtRahn prime form, ie.  of . /z_rahn_prime z12 [0,1,3,6,8,9] == [0,2,3,6,7,9]hmtThe six sets where the Forte and Rahn prime forms differ. Given here in Forte prime form. all (\p -> Forte_1973.forte_prime z12 p /= rahn_prime z12 p) rahn_forte_diff == Truew Safe-InferredhmtSIM icv 12 [0,1,3,6] == [1,1,2,0,1,1] && icv 12 [0,2,4,7] == [0,2,1,1,2,0] sim [0,1,3,6] [0,2,4,7] == 6 sim [0,1,2,4,5,8] [0,1,3,7] == 9hmtASIM asim [0,1,3,6] [0,2,4,7] == 6/12 asim [0,1,2,4,5,8] [0,1,3,7] == 9/21 asim [0,1,2,3,4] [0,1,4,5,7] == 2/5 asim [0,1,2,3,4] [0,2,4,6,8] == 3/5 asim [0,1,4,5,7] [0,2,4,6,8] == 3/5x Safe-Inferredvhmt$Predicate for list with cardinality n.hmtSet classes of cardinality n. 5sc_table_n 2 == [[0,1],[0,2],[0,3],[0,4],[0,5],[0,6]]hmt/Minima and maxima of ICV of SCs of cardinality n. -icv_minmax 5 == ([0,0,0,1,0,0],[4,4,4,4,4,2])hmtPretty printer for . map r_pp [MIN,MAX] == ["+","-"]hmt$ element measure with given funtion.hmt Pretty printer for SATV element. 9satv_e_pp (satv_a [0,1,2,6,7,8]) == "<-1,+2,+0,+0,-1,-0>"hmtPretty printer for .hmtSATVa measure. satv_e_pp (satv_a [0,1,2,6,7,8]) == "<-1,+2,+0,+0,-1,-0>" satv_e_pp (satv_a [0,1,2,3,4]) == "<-0,-1,-2,+0,+0,+0>"hmtSATVb measure. satv_e_pp (satv_b [0,1,2,6,7,8]) == "<+4,-4,-5,-4,+4,+3>" satv_e_pp (satv_b [0,1,2,3,4]) == "<+4,+3,+2,-3,-4,-2>"hmt measure. satv_pp (satv [0,3,6,9]) == "(<+0,+0,-0,+0,+0,-0>,<-3,-3,+4,-3,-3,+2>)" satv_pp (satv [0,1,3,4,8]) == "(<-2,+1,-2,-1,-2,+0>,<+2,-3,+2,+2,+2,-2>)" satv_pp (satv [0,1,2,6,7,8]) == "(<-1,+2,+0,+0,-1,-0>,<+4,-4,-5,-4,+4,+3>)" satv_pp (satv [0,4]) == "(<+0,+0,+0,-0,+0,+0>,<-1,-1,-1,+1,-1,-1>)" satv_pp (satv [0,1,3,4,6,9]) == "(<+2,+2,-0,+0,+2,-1>,<-3,-4,+5,-4,-3,+2>)" satv_pp (satv [0,1,3,6,7,9]) == "(<+2,+2,-1,+0,+2,-0>,<-3,-4,+4,-4,-3,+3>)" satv_pp (satv [0,1,2,3,6]) == "(<-1,-2,-2,+0,+1,-1>,<+3,+2,+2,-3,-3,+1>)" satv_pp (satv [0,1,2,3,4,6]) == "(<-1,-2,-2,+0,+1,+1>,<+4,+4,+3,-4,-4,-2>)" satv_pp (satv [0,1,3,6,8]) == "(<+1,-2,-2,+0,-1,-1>,<-3,+2,+2,-3,+3,+1>)" satv_pp (satv [0,2,3,5,7,9]) == "(<+1,-2,-2,+0,-1,+1>,<-4,+4,+3,-4,+4,-2>)"hmt reorganised by . satv_minmax (satv [0,1,2,6,7,8]) == ([4,2,0,0,4,3],[1,4,5,4,1,0])hmtAbsolute difference.hmtSum of numerical components of a and b parts of . satv_n_sum (satv [0,1,2,6,7,8]) == [5,6,5,4,5,3] satv_n_sum (satv [0,3,6,9]) == [3,3,4,3,3,2]hmtSATSIM metric. satsim [0,1,2,6,7,8] [0,3,6,9] == 25/46 satsim [0,4] [0,1,3,4,6,9] == 25/34 satsim [0,4] [0,1,3,6,7,9] == 25/34 satsim [0,1,2,3,6] [0,1,2,3,4,6] == 1/49 satsim [0,1,3,6,8] [0,2,3,5,7,9] == 1/49 satsim [0,1,2,3,4] [0,1,4,5,7] == 8/21 satsim [0,1,2,3,4] [0,2,4,6,8] == 4/7 satsim [0,1,4,5,7] [0,2,4,6,8] == 4/7hmt Table of  measures for all SC pairs. length satsim_table == 24310hmtHistogram of values at .  <22> <111> <1100> <5> <000000> putStrLn $ frg_pp [0,2,4,5,7,9]hmtCan the set-class q (under prime form algorithm pf) be drawn from the pcset p.hmt of  forte_prime let d = [0,2,4,5,7,9,11] has_sc z12 d (z_complement z12 d) == True has_sc z12 [] [] == TruehmtInterval-class cycle vector.hmtPretty printer for . let r = "IC cycle vector: <1> <22> <111> <1100> <5> <000000>" ic_cycle_vector_pp (ic_cycle_vector [0,2,4,5,7,9]) == rhmtInterval cycle filter.echo 22341 | pct icf22341 "icf [[2,2,3,4,1]] == [[2,2,3,4,1]]hmt$Interval class set to interval sets.pct ici -c 1231231291A31A9 4ici_c [1,2,3] == [[1,2,3],[1,2,9],[1,10,3],[1,10,9]]hmt5Interval class set to interval sets, concise variant. 4ici_c [1,2,3] == [[1,2,3],[1,2,9],[1,10,3],[1,10,9]]hmtInterval segment (INT).hmt Imbrications. let r = [[[0,2,4],[2,4,5],[4,5,7],[5,7,9]] ,[[0,2,4,5],[2,4,5,7],[4,5,7,9]]] in imb [3,4] [0,2,4,5,7,9] == rhmt* gives the set-classes that can append to p to give q.pct issb 3-7 6-323-73-23-11 3issb (sc "3-7") (sc "6-32") == ["3-2","3-7","3-11"]hmtMatrix search.pct mxs 024579 642 | sort -u6421B9B97642 set (mxs z12 [0,2,4,5,7,9] [6,4,2]) == [[6,4,2,1,11,9],[11,9,7,6,4,2]]hmtNormalize (synonym for set)pct nrm 01234565432100123456 2nrm [0,1,2,3,4,5,6,5,4,3,2,1,0] == [0,1,2,3,4,5,6]hmt%Normalize, retain duplicate elements.hmt Pitch-class invariances (called pi at pct).pct pi 0236 12 pcseg 0236 pcseg 6320 pcseg 532B pcseg B235 pci z12 [1,2] [0,2,3,6] == [[0,2,3,6],[5,3,2,11],[6,3,2,0],[11,2,3,5]]hmtRelate sets (TnMI), ie $ pct rs 0123 641BT1M  (p,self_inv p)) trichordshmt Pretty printer, comma separated. !pcset_pp [0,3,7,10] == "0,3,7,10"hmt*Pretty printer, hexadecimal, no separator. !pcset_pp_hex [0,3,7,10] == "037A"hmt/Forte prime form of the all-trichord hexachord. ,T.sc_name ath == "6-Z17" T.sc "6-Z17" == athhmtIs p an instance of .hmt Table 1, p.20 length ath_univ == 24hmt Calculate ( of pcset, which must be an instance of . (ath_tni [1,2,3,7,8,11] == T.Tto 3 1 TruehmtGive label for instance of -, prime forms are written H and inversions h. ath_pp [1,2,3,7,8,11] == "h3"hmt$The twenty three-element subsets of . length ath_trichords == 20hmt  of  and p$, ie. the pitch classes that are in  and not in p. !ath_complement [0,1,2] == [4,7,8]hmtp is a pcset, q a sc, calculate pcsets in q that with p form . ath_completions [0,1,2] (T.sc "3-3") == [[6,7,10],[4,7,8]] ath_completions [6,7,10] (T.sc "3-5") == [[1,2,8]]hmtSelf-inversional pcsets are drawn in a double circle, other pcsets in a circle.:: Safe-Inferred,t hmt'interval (0,11) to interval class (0,6)hmtdegree of intersectionhmt-The sum of the pointwise absolute difference.hmt4The number of places that are, pointwise, not equal. loc_dif_n "test" "pest" == 1hmtdegree of intersectionhmtAdd k5 as prefix to both left and right hand sides of edge.hmt Tn.hmt TnI.hmtk# is length of the T & I sequences, n" is the T & I sequence interval, m, is the interval between the T & I sequence. r = ["T0 T5I T3 T8I T6 T11I T9 T2I","T1 T6I T4 T9I T7 T0I T10 T3I"] map (unwords . map T.tto_pp . gen_tni_seq 4 3 5) [0,1] == rhmtList of pcsets s where  prime(p+s)=r and  prime(q+s)=r. #p and #q must be equal, and less than #r. mk_bridge (T.sc "4-Z15") [0,6] [1,7] == [[2,5],[8,11]] mk_bridge (T.sc "4-Z29") [0,6] [1,7] == [[2,11],[5,8]]hmt of . >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>????@@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBCCCDDDDDDDDDDDDDDDDDDDDEEE EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFGGGGGGGGGGGGGGGHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJJ J JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ JJJJJJ J JJJJJJJJJJJJJJJJJJJJKKKKKKKKKKKKKKKKKLLLLLLLLLLLLMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOPQQQQQQQRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVVVVVVVVVVVVVVWWWWWWWWWXXXXXXXXXXXXXXXXYYYYYYYYYYYYZZ ZZZZZZZZZZZZZZZZ[[\\\]]]]]]]]]]]]]]]]]^ ^^^^^^^^^^^^^^^^^^^^^^^___________```````````aaaaaaaaabbbbbbbbbbbccddddddddddddddddddddeeeeeeeeeeeeffgggggggghhhhiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiij jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkkkkkkkkk kkk k k k kk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkklllllllllll llllllllllllllllllllmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnnnnnnnnnnnop pppqrssssssssssssssssssssssssssssssssssttttttttttttttttttuuuuuuuuuuuuuuuuuuuuuuuuuuuvvvwwxx x xxxxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyzzzz{{{{{{{{{{{{{{{{{{{{{{{{{{||||||||||||| |||||||||||||||||||||||||||||||||||}}}}}}}}}}}}}}}}}}}}}}}}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                     !!!! !! ! ! ! !!!!hmt-0.20-IuIZfrzUDBhHKj8WFCdzfZMusic.Theory.Array.DirectionMusic.Theory.Bjorklund&Music.Theory.Block_Design.Johnson_2007Music.Theory.BrailleMusic.Theory.Db.CommonMusic.Theory.Db.CsvMusic.Theory.Db.PlainMusic.Theory.Db.CliMusic.Theory.DurationMusic.Theory.Duration.Name'Music.Theory.Duration.Name.AbbreviationMusic.Theory.Duration.Rq Music.Theory.Duration.AnnotationMusic.Theory.Duration.Rq.TiedMusic.Theory.Dynamic_MarkMusic.Theory.Graph.FglMusic.Theory.Graph.DotMusic.Theory.Graph.Deacon_1934Music.Theory.Instrument.NamesMusic.Theory.List.LogicMusic.Theory.Math.Convert.FxMusic.Theory.Math.NichomachusMusic.Theory.Math.PrimeMusic.Theory.Math.OeisMusic.Theory.Array.SquareMusic.Theory.Meter.Barlow_1987Music.Theory.ParseMusic.Theory.Permutations.List!Music.Theory.Duration.Rq.Division%Music.Theory.Permutations.Morris_1984Music.Theory.Pitch.BarkMusic.Theory.Pitch.NoteMusic.Theory.Pitch.Note.NameMusic.Theory.Random.I_ChingMusic.Theory.Random.Jones_1981Music.Theory.Set.List Music.Theory.Duration.Hollos2014"Music.Theory.Contour.Polansky_1992!Music.Theory.Metric.Polansky_1996Music.Theory.Set.SetMusic.Theory.Tiling.Canon Music.Theory.Tiling.Johnson_2004 Music.Theory.Tiling.Johnson_2009Music.Theory.Time.Bel1990.RMusic.Theory.Time.KeyKit.ParserMusic.Theory.Time.SeqMusic.Theory.Time.KeyKitMusic.Theory.Time.KeyKit.BasicMusic.Theory.Array.Csv.Midi.Mnd!Music.Theory.Array.Csv.Midi.SkiniMusic.Theory.Array.Csv.Midi.CliMusic.Theory.Time_SignatureMusic.Theory.Tempo_Marking%Music.Theory.Duration.Sequence.Notate Music.Theory.Duration.ClickTrackMusic.Theory.TuningMusic.Theory.Pitch!Music.Theory.Pitch.Spelling.Table#Music.Theory.Pitch.Spelling.ClusterMusic.Theory.Pitch.NameMusic.Theory.IntervalMusic.Theory.KeyMusic.Theory.Pitch.Spelling.KeyMusic.Theory.Pitch.SpellingMusic.Theory.Pitch.ChordMusic.Theory.Interval.SpellingMusic.Theory.Interval.NameMusic.Theory.ClefMusic.Theory.Instrument.Choir!Music.Theory.Interval.Barlow_1987Music.Theory.Tuning.AnamarkMusic.Theory.Tuning.EfgMusic.Theory.Tuning.EtMusic.Theory.GamelanMusic.Theory.Tuning.Graph.EulerMusic.Theory.Tuning.Meyer_1929Music.Theory.Tuning.Partch!Music.Theory.Tuning.Polansky_1984!Music.Theory.Tuning.Polansky_1990Music.Theory.Tuning.Scala.Meta!Music.Theory.Tuning.Sethares_1994Music.Theory.Tuning.TypeMusic.Theory.Tuning.SyntonicMusic.Theory.Tuning.ScalaMusic.Theory.Tuning.Scala.ModeMusic.Theory.Tuning.Scala.Kbm"Music.Theory.Tuning.Scala.Interval#Music.Theory.Tuning.Scala.Functions"Music.Theory.Tuning.Rosenboom_1979Music.Theory.Tuning.Graph.Iset"Music.Theory.Tuning.Polansky_1985c!Music.Theory.Tuning.Polansky_1978Music.Theory.Tuning.MidiMusic.Theory.Tuning.Scala.CliMusic.Theory.Tuning.LoadMusic.Theory.Tuning.HsMusic.Theory.Tuning.Gann_1993#Music.Theory.Tuning.Db.WerckmeisterMusic.Theory.Tuning.Db.Riley+Music.Theory.Tuning.Db.Microtonal_SynthesisMusic.Theory.Tuning.Db.GannMusic.Theory.Tuning.Db.AlvesMusic.Theory.Tuning.Alves_1997Music.Theory.Tuning.DbMusic.Theory.Tuning.WilsonMusic.Theory.WyschnegradskyMusic.Theory.Xenakis.S4Music.Theory.Xenakis.SieveMusic.Theory.ZMusic.Theory.Z.Clough_1979Music.Theory.Z.LiteratureMusic.Theory.Z.Morris_1974Music.Theory.Z.Morris_1987 Music.Theory.Z.Morris_1987.ParseMusic.Theory.Z.SroMusic.Theory.Z.Read_1978Music.Theory.Z.Forte_1973Music.Theory.Z.Rahn_1980Music.Theory.Metric.Morris_1980 Music.Theory.Metric.Buchler_1998Music.Theory.Z.Castren_1994Music.Theory.Z.Lewin_1980Music.Theory.Z.TtoMusic.Theory.Z.Drape_1999Music.Theory.Z.Drape_1999.CliMusic.Theory.Z.Boros_1990Music.Theory.Graph.Johnson_2014Sound.SC3.Common.Math oct_to_cpsTfold_to_octavefold_ratio_to_octave' Forte_1973 ti_cmp_primeZTto DIRECTION_C DIRECTION_SVECLOC vector_add vector_sub vector_sum apply_vec segment_vec derive_vec unfold_path is_directiondirection_char_to_vector_tbldirection_char_to_vectordirection_to_vectorvector_to_direction_chardir_seq_to_cell_seq BJORKLUND_STbjorklund_left_fbjorklund_right_f bjorklund_f bjorklund bjorklund_r euler_pp_feuler_pp_unicodeeuler_pp_ascii xdot_ascii xdot_unicodeiseqiseq_strDesignc_7_3_1b_7_3_1d_7_3_1n_7_3_1p_9_3_1b_13_4_1d_13_4_1n_13_4_1b_12_4_3n_12_4_3BRAILLE braille_asciibraille_unicode braille_dots braille_tablebraille_lookup_unicodebraille_lookup_ascii braille_64transcribe_unicodetranscribe_char_grid dots_gridstring_html_tabledecode braille_rng braille_seq braille_char braille_ix unicode_html white_circle black_circle shaded_circleone_letter_contractionsDb'Record'Entry'ValueKeyDbRecordEntryrecord_key_seqrecord_has_keyrecord_key_histogramrecord_has_duplicate_keysrecord_lookup_by record_lookuprecord_lookup_atrecord_lookup_uniqrecord_has_key_uniqrecord_lookup_uniq_errrecord_lookup_uniq_defrecord_delete_by record_delete db_key_set db_lookup_by db_lookupdb_has_duplicate_keysdb_key_histogram db_to_tablerecord_collate_fromrecord_collaterecord_uncollate db_load_utf8 db_store_utf8Sep sep_plain record_parsedb_parsedb_sort record_pp db_load_ty db_store_tyconvertstathelpdb_cliDurationdivisiondots multiplierDotsDivision duration_meq duration_m1duration_compare_meqduration_compare_meq_errno_dotssum_dur_undottedsum_dur_dottedsum_dur sum_dur_errdivisions_std_setdivisions_musicxml_set duration_setbeam_count_tbl!whole_note_division_to_beam_countduration_beam_countdivision_musicxml_tbl$whole_note_division_to_musicxml_typeduration_to_musicxml_typedivision_unicode_tbl%whole_note_division_to_unicode_symbolduration_to_unicodeduration_to_lilypond_typeduration_recip_ppwhole_note_division_name_tblwhole_note_division_namewhole_note_division_letter_tblwhole_note_division_letter_ppduration_letter_pp $fOrdDuration $fEqDuration$fShowDurationbreve whole_note half_note quarter_note eighth_notesixteenth_notethirtysecond_note dotted_brevedotted_whole_notedotted_half_notedotted_quarter_notedotted_eighth_notedotted_sixteenth_notedotted_thirtysecond_notedouble_dotted_brevedouble_dotted_whole_notedouble_dotted_half_notedouble_dotted_quarter_notedouble_dotted_eighth_notedouble_dotted_sixteenth_notedouble_dotted_thirtysecond_notewhqesw'h'q'e's'w''h''q''e''s''_1_2_4_8_16_32_1'_2'_4'_8'_16'_32'_1''_2''_4''_8''_16''_32''Rqrq_tuplet_duration_tablerq_tuplet_to_durationrq_plain_duration_tblrq_plain_to_durationrq_plain_to_duration_errrq_to_durationrq_to_duration_err rq_is_cmnwhole_note_division_to_rq rq_apply_dotsduration_to_rqduration_compare_rqrq_modrq_divisible_byrq_is_integral rq_integralrq_derive_tuplet_plainrq_derive_tuplet rq_un_tuplet rq_to_cmn rq_can_notaterq_to_seconds_qpm rq_to_qpm Duration_A D_Annotation Tie_RightTie_Left Begin_Tuplet End_Tuplet begin_tupletda_begin_tuplet begins_tupletda_begins_tupletda_ends_tuplet da_tied_right da_tupletda_group_tuplets break_left sep_balancedda_group_tuplets_nnzip_kr nn_reshaped_annotated_tied_lrduration_a_tied_lr$fEqD_Annotation$fShowD_AnnotationRq_Tied Tied_Right rqt_to_rq rqt_to_rq_errrqtrqt_rqrqt_tied is_tied_right rqt_un_tupletrq_rqt rq_tie_lastrqt_to_duration_arqt_can_notate rqt_to_cmn rqt_to_cmn_lrqt_set_to_cmn Dynamic_NodeHairpin Crescendo Diminuendo End_Hairpin Dynamic_MarkNientePppppPpppPppPpPMpMfFFfFffFfffFffffFpSfSfpSfppSfzSffzdynamic_mark_t_parse_cidynamic_mark_mididynamic_mark_midi_errmidi_dynamic_markdynamic_mark_dbampmididamp_dbdb_ampimplied_hairpinempty_dynamic_nodedynamic_sequencedelete_redundant_marksdynamic_sequence_setsapply_dynamic_nodedynamic_mark_ascii hairpin_asciidynamic_node_asciidynamic_sequence_ascii $fEqHairpin $fOrdHairpin $fEnumHairpin$fBoundedHairpin $fShowHairpin$fEqDynamic_Mark$fOrdDynamic_Mark$fEnumDynamic_Mark$fBoundedDynamic_Mark$fShowDynamic_Mark$fReadDynamic_MarkEdge_LblEdge G_Node_Sel_f lbl_to_fgl lbl_to_fgl_gr fgl_to_lblg_degree g_partition g_node_lookupg_node_lookup_errug_node_set_impl ml_from_listg_hamiltonian_path_mlug_hamiltonian_path_ml_0g_from_edges_l g_from_edges e_label_seq e_normalise_l e_collate_le_collate_normalised_le_univ_select_edgese_univ_select_u_edgese_path_to_edgese_undirected_eqelem_by e_is_pathpathTreemakeLeaf Graph_Type Graph_Digraph Graph_UgraphGraph_Pp Dot_Meta_Attr Dot_Meta_Key Dot_Attr_SetDot_TypeDot_Attr Dot_ValueDot_Key s_classify is_symbol is_number maybe_quote dot_attr_ppdot_attr_seq_pp dot_attr_extdot_attr_set_pp dot_key_sepdot_attr_collate dot_attr_def gr_pp_label_m gr_pp_label gr_pp_label_v br_csl_ppg_type_to_stringg_type_to_edge_symbol node_pos_attr edge_pos_attredge_pos_attr_1 lbl_to_dot lbl_to_udotlbl_to_udot_wr fgl_to_dot fgl_to_udot dot_to_ext dot_to_svgG gen_graph gen_graph_ul gen_digraphg1g2g4g6g8g9g10g11g12g13g_allwrwr_allinstrument_db' instrument_dball_embeddings_mall_embeddingsI64I32I24I16I14I12I8I7I4U64U32U24U16U14U12U8U7U4u4_to_u7u4_to_u8 u4_to_u12 u4_to_u14 u4_to_u16 u4_to_u24 u4_to_u32 u4_to_u64u4_to_i4u4_to_i7u4_to_i8 u4_to_i12 u4_to_i14 u4_to_i16 u4_to_i24 u4_to_i32 u4_to_i64u7_to_u4u7_to_u8 u7_to_u12 u7_to_u14 u7_to_u16 u7_to_u24 u7_to_u32 u7_to_u64u7_to_i4u7_to_i7u7_to_i8 u7_to_i12 u7_to_i14 u7_to_i16 u7_to_i24 u7_to_i32 u7_to_i64u8_to_u4u8_to_u7 u8_to_u12 u8_to_u14 u8_to_u16 u8_to_u24 u8_to_u32 u8_to_u64u8_to_i4u8_to_i7u8_to_i8 u8_to_i12 u8_to_i14 u8_to_i16 u8_to_i24 u8_to_i32 u8_to_i64 u12_to_u4 u12_to_u7 u12_to_u8 u12_to_u14 u12_to_u16 u12_to_u24 u12_to_u32 u12_to_u64 u12_to_i4 u12_to_i7 u12_to_i8 u12_to_i12 u12_to_i14 u12_to_i16 u12_to_i24 u12_to_i32 u12_to_i64 u14_to_u4 u14_to_u7 u14_to_u8 u14_to_u12 u14_to_u16 u14_to_u24 u14_to_u32 u14_to_u64 u14_to_i4 u14_to_i7 u14_to_i8 u14_to_i12 u14_to_i14 u14_to_i16 u14_to_i24 u14_to_i32 u14_to_i64 u16_to_u4 u16_to_u7 u16_to_u8 u16_to_u12 u16_to_u14 u16_to_u24 u16_to_u32 u16_to_u64 u16_to_i4 u16_to_i7 u16_to_i8 u16_to_i12 u16_to_i14 u16_to_i16 u16_to_i24 u16_to_i32 u16_to_i64 u24_to_u4 u24_to_u7 u24_to_u8 u24_to_u12 u24_to_u14 u24_to_u16 u24_to_u32 u24_to_u64 u24_to_i4 u24_to_i7 u24_to_i8 u24_to_i12 u24_to_i14 u24_to_i16 u24_to_i24 u24_to_i32 u24_to_i64 u32_to_u4 u32_to_u7 u32_to_u8 u32_to_u12 u32_to_u14 u32_to_u16 u32_to_u24 u32_to_u64 u32_to_i4 u32_to_i7 u32_to_i8 u32_to_i12 u32_to_i14 u32_to_i16 u32_to_i24 u32_to_i32 u32_to_i64 u64_to_u4 u64_to_u7 u64_to_u8 u64_to_u12 u64_to_u14 u64_to_u16 u64_to_u24 u64_to_u32 u64_to_i4 u64_to_i7 u64_to_i8 u64_to_i12 u64_to_i14 u64_to_i16 u64_to_i24 u64_to_i32 u64_to_i64i4_to_u4i4_to_u7i4_to_u8 i4_to_u12 i4_to_u14 i4_to_u16 i4_to_u24 i4_to_u32 i4_to_u64i4_to_i7i4_to_i8 i4_to_i12 i4_to_i14 i4_to_i16 i4_to_i24 i4_to_i32 i4_to_i64i7_to_u4i7_to_u7i7_to_u8 i7_to_u12 i7_to_u14 i7_to_u16 i7_to_u24 i7_to_u32 i7_to_u64i7_to_i4i7_to_i8 i7_to_i12 i7_to_i14 i7_to_i16 i7_to_i24 i7_to_i32 i7_to_i64i8_to_u4i8_to_u7i8_to_u8 i8_to_u12 i8_to_u14 i8_to_u16 i8_to_u24 i8_to_u32 i8_to_u64i8_to_i4i8_to_i7 i8_to_i12 i8_to_i14 i8_to_i16 i8_to_i24 i8_to_i32 i8_to_i64 i12_to_u4 i12_to_u7 i12_to_u8 i12_to_u12 i12_to_u14 i12_to_u16 i12_to_u24 i12_to_u32 i12_to_u64 i12_to_i4 i12_to_i7 i12_to_i8 i12_to_i14 i12_to_i16 i12_to_i24 i12_to_i32 i12_to_i64 i14_to_u4 i14_to_u7 i14_to_u8 i14_to_u12 i14_to_u14 i14_to_u16 i14_to_u24 i14_to_u32 i14_to_u64 i14_to_i4 i14_to_i7 i14_to_i8 i14_to_i12 i14_to_i16 i14_to_i24 i14_to_i32 i14_to_i64 i16_to_u4 i16_to_u7 i16_to_u8 i16_to_u12 i16_to_u14 i16_to_u16 i16_to_u24 i16_to_u32 i16_to_u64 i16_to_i4 i16_to_i7 i16_to_i8 i16_to_i12 i16_to_i14 i16_to_i24 i16_to_i32 i16_to_i64 i24_to_u4 i24_to_u7 i24_to_u8 i24_to_u12 i24_to_u14 i24_to_u16 i24_to_u24 i24_to_u32 i24_to_u64 i24_to_i4 i24_to_i7 i24_to_i8 i24_to_i12 i24_to_i14 i24_to_i16 i24_to_i32 i24_to_i64 i32_to_u4 i32_to_u7 i32_to_u8 i32_to_u12 i32_to_u14 i32_to_u16 i32_to_u24 i32_to_u32 i32_to_u64 i32_to_i4 i32_to_i7 i32_to_i8 i32_to_i12 i32_to_i14 i32_to_i16 i32_to_i24 i32_to_i64 i64_to_u4 i64_to_u7 i64_to_u8 i64_to_u12 i64_to_u14 i64_to_u16 i64_to_u24 i64_to_u32 i64_to_u64 i64_to_i4 i64_to_i7 i64_to_i8 i64_to_i12 i64_to_i14 i64_to_i16 i64_to_i24 i64_to_i32arithmetic_meangeometric_mean harmonic_meancont_harmonic_meancont_geometric_meansubcont_geometric_mean primes_listprime_k prime_k_errfactor prime_factors prime_limitmultiplicitiesmultiplicities_ppprime_factors_mprime_factors_m_pprat_prime_factorsrational_prime_factorsrat_prime_factors_sgnrational_prime_factors_sgnrat_prime_limitrational_prime_limit rat_pf_mergerat_prime_factors_mrational_prime_factors_mrat_prime_factors_lrational_prime_factors_lrat_prime_factors_trational_prime_factors_trat_prime_factors_crational_prime_factors_cprime_factors_ppprime_factors_pp_sup_ola000005a000010 a000010_na000012a000031 a000031_na000032a000040a000041a000045a000051a000071a000073a000078a000079a000085a000108a000120a000142a000201a000204a000213a000217a000225a000285a000290a000292a000384a000578a000583a000670a000796a000930a000931a001008a001037 a001037_na001113a001147a001156a001333a001622 a001622_ka001644a001653a001687a001950a002267a002487a002858ulama003108 a003215_na003215a003269a003520a003462 a003462_na003586a003849a004001a004718a005185a005448 a005448_na005728a005811a005917a006003 a006003_na006046a006052a006842a006843a007318 a007318_tbla008277 a008277_tbla008278 a008278_tbla008683 a008683_na010049a010060a014081a014577a016813a017817a020695a020985a022095a022096a027750 a027750_rowa027934a029635 a029635_tbla030308a033622 a033622_na033812a034968a036562 a036562_na046042a047999 a047999_tbla048993 a048993_tbla049455a049456a053121 a053121_tbla058265 a058265_ka060588a a060588a_na061654 a061654_na071996a073334a080843a080992a083866a095660 a095660_tbla095666 a095666_tbla096940 a096940_tbla105809 a105809_tbla124010 a124010_rowa124472a125519a126275 a126275_na126276 a126276_na126651a126652a126653a126654a126709a126710a126976a212804a245553a255723a256184a256185a270876a320872 Square_Map Square_Ix Square_LinearSquaresq_mapsq_scalesq_zipsq_mulsq_addsq_sum sq_is_square sq_from_listsq_is_linear_squaresq_linear_degree sq_transposesq_diagonals_ul_lrsq_diagonals_ll_ursq_undiagonals_ul_lrsq_undiagonals_ll_ursq_diagonal_ul_lrsq_diagonal_ll_ursq_h_reflection sq_is_normalsq_sumssq_optsq_ppsq_wrsq_pp_msq_wr_m sq_to_mapsqm_ix sqm_ix_seqsqm_to_partial_sq sq_trs_op sq_trs_seqS_MMStratification traceShowat1 at1_bnd_err mod_pos_errto_r div_pos_errindispensibilities lower_psireverse_primesprime_stratification upper_psithinning_tablethinning_table_pprelative_to_lengthrelative_indispensibilities align_meters whole_div whole_quotprolong_stratifications align_s_mm upper_psi' mps_limitmean_square_productmetrical_affinitymetrical_affinity'is_char parse_int run_parserrun_parser_mayberun_parser_errorpermutations_lpermutations_nk_lmultiset_permutationsmultiset_permutations_nRq1_DivRq_Divrq1_div_to_rq_div rq_div_verifyrq_div_mm_verifyrq_div_to_rq_set_trq_set_t_to_rqt rq_div_seq_rqpartitions_sumpartitions_sum_p rq1_div_univPlaceMethodChangeSwap_AllHold method_limitmethod_changes parse_change split_changes parse_method parse_place is_swap_all flatten_pairsswap_allnumeric_spelling_tbl nchar_to_int int_to_nchar gen_swaps derive_holds pair_to_listswaps_to_cyclesto_zero_indexed swap_abbrev apply_change apply_method closed_methodclosed_method_lp closed_placecambridgeshire_place_doubles_pl"cambridgeshire_slow_course_doubles$double_cambridge_cyclic_bob_minor_pl!double_cambridge_cyclic_bob_minorhammersmith_bob_triples_plhammersmith_bob_triplescambridge_surprise_major_plcambridge_surprise_majorsmithsonian_surprise_royal_plsmithsonian_surprise_royalecumenical_surprise_maximus_plecumenical_surprise_maximus $fEqMethod $fShowMethod $fEqChange $fShowChange bark_center bark_edgebark_bandwidthcps_to_bark_zwickercps_to_bark_traunmullerbark_to_cps_traunmullercps_to_bark_wsgbark_to_cps_wsg Alteration_R Alteration DoubleFlatThreeQuarterToneFlatFlatQuarterToneFlatNaturalQuarterToneSharpSharpThreeQuarterToneSharp DoubleSharpNoteCDEABnote_seqnote_pp note_pp_ly note_pc_tbl note_to_pc pc_to_notenote_t_transpose parse_note_tchar_to_note_t note_spangeneric_alteration_to_diffalteration_to_diffalteration_is_12etalteration_to_diff_erralteration_to_fdifffdiff_to_alterationalteration_raise_quarter_tonealteration_lower_quarter_tonealteration_edit_quarter_tonealteration_clear_quarter_tonealteration_symbol_tblalteration_symbolsymbol_to_alterationsymbol_to_alteration_isosymbol_to_alteration_iso_err%symbol_to_alteration_unicode_plus_isoalteration_iso_tblalteration_iso_malteration_isoalteration_tonh_tblalteration_tonhtonh_to_alterationtonh_to_alteration_errnote_alteration_to_pcnote_alteration_to_pc_errnote_alteration_kspc_note_alteration_ks_tblpc_to_note_alteration_ks alteration_rp_note_t p_note_t_lc p_note_t_cip_alteration_t_isop_alteration_t_tonhp_note_alteration_ly$fEqAlteration$fEnumAlteration$fBoundedAlteration$fOrdAlteration$fShowAlteration$fEqNote $fEnumNote $fBoundedNote $fOrdNote $fReadNote $fShowNotecesesdeseseesesfesesgesesaesesbesescesehdeseheesehfesehgesehaesehbesehcesdeseesfesgesaesbescehdeheehfehgehaehbehcdfgabcihdiheihfihgihaihbihcisdiseisfisgisaisbiscisihdisiheisihfisihgisihaisihbisihcisisdisiseisisfisisgisisaisisbisisHexagram Line_StatLineL6L7L8L9 i_ching_chart line_unbroken line_from_bit line_ascii_ppline_is_movingline_complementfour_coin_sequence hexagram_ppfour_coin_gen_hexagramhexagram_has_complementhexagram_complementhexagram_nameshexagram_unicode_sequencehexagram_to_binaryhexagram_to_binary_strhexagram_from_binaryhexagram_from_binary_strtrigram_unicode_sequence trigram_chart$fEqLine $fShowLineSFSG ProbablitiesRulep_verifyp_select p_select_err g_collectunfold sfsg_chain sfsg_chain_n$fEqG$fShowGset n_powersetpowersetpowerset_sortedpairstriples expand_set partitionscartesian_productnfold_cartesian_productmultiset_cyclespartmpartpartacompcompmcompacompamneckneckm necklacePartsnecklaceWithPartsneckaneckampermi Conforms_fBuild_fContour_Descriptioncontour_description_ncontour_description_mContour_Half_Matrixcontour_half_matrix_ncontour_half_matrix_mMatrixadjacent_indices all_indicesmatrix_fcontour_matrix half_matrix_fcontour_half_matrixcontour_half_matrix_strcontour_descriptioncontour_description_strhalf_matrix_to_descriptioncontour_description_ixuniform no_equalities all_contours implication violations is_possiblepossible_contoursimpossible_contourscontour_description_lmcontour_truncatecontour_is_prefix_of contour_eq_at draw_contourcontour_description_invert build_f_nbuild_sequence build_contourbuild_contour_retrybuild_contour_setbuild_contour_set_nodupex_1ex_2ex_3ex_4$fShowContour_Half_Matrix$fShowContour_Description$fEqContour_Description$fEqContour_Half_Matrix$fOrdContour_Half_MatrixPsiDeltaIntervaldif_idif_rabs_ofsqrsqr_of sqr_abs_of sqrt_abs_ofcity_block_metriceuclidean_metric_2euclidean_metric_lcbrtnthrtminkowski_metric_2minkowski_metric_ld_dx_abs olm_no_delta' olm_generalix_dif abs_ix_difsqr_abs_ix_difolm olm_no_deltaolm_no_delta_squared second_orderolm_no_delta_second_order!olm_no_delta_squared_second_order!second_order_binonial_coefficientdirection_intervalord_histdirection_vectoruldoldocducdcombinatorial_magnitude_matrixulm_simplifiedocm_zcmocmocm_absolute_scaledVRSp_cyclee_to_seq e_from_seqr_voices rr_voices t_retrogradet_normalr_from_tfromListperfect_tilings_mperfect_tilingselemOrd v_dot_star v_space_ix with_bars v_dot_star_mv_print v_print_mv_print_m_fromp1p2p3p4p4_bp5p7p10p11L_BelL_TermL_StVoiceTimeBelNodeIsoSeqParMulTermRestContinueTempoPar_ModePar_Left Par_RightPar_MinPar_MaxPar_Nonepar_mode_brackets par_mode_kindbel_brackets_match term_valuepar_ofbel_pp bel_char_pp par_analysepar_durbel_tdurbel_dur lterm_timelterm_durationlterm_end_time lterm_voice lterm_term lterm_value bel_linearise lbel_merge lbel_tempilbel_tempo_mullbel_normalise_multiplierlbel_normalisevoice_normalisevoice_eq lbel_voices lbel_duration lbel_lookup lbel_gridbel_grid bel_ascii bel_ascii_pr~>lseqnodenseqcseqparrestnrestsbel_parse_pp_ident bel_ascii_ppp_restp_nrests p_continue p_char_value p_char_term p_char_nodep_non_negative_integerp_non_negative_rationalp_non_negative_doublep_non_negative_numberp_mulp_iso p_char_isop_par p_char_par p_char_belbel_char_parse$fEqBel $fShowBel$fEqTerm $fShowTerm $fEqPar_Mode$fShowPar_Mode Kk_Phrasekk_phrase_noteskk_phrase_lengthKk_Notekk_note_numberkk_note_octavekk_note_volumekk_note_durationkk_note_channel kk_note_timeKk_Contextual_Notekk_contextual_note_numberkk_contextual_note_octavekk_contextual_note_volumekk_contextual_note_durationkk_contextual_note_channelkk_contextual_note_timekk_parse_eitherkk_parse>>~ kk_lexemekk_uintkk_intkk_note_name_pkk_midi_note_p kk_rest_pkk_accidental_pkk_char_to_note_numberkk_char_to_alterationkk_note_number_to_namekk_named_note_number_pkk_note_number_p kk_modifier_pkk_modifiers_pkk_empty_contextual_notekk_empty_contextual_restkk_contextual_note_ppkk_contextual_note_pkk_contextual_note_is_rest kk_comma_pkk_contextual_phrase_element_pkk_contextual_phrase_pkk_default_note"kk_note_to_initial_contextual_notekk_note_to_contextual_note kk_note_ppkk_decontextualise_note kk_phrase_ppkk_decontextualise_phrasekk_recontextualise_phrasekk_phrase_readkk_phrase_print $fEqKk_Phrase$fShowKk_Phrase $fEqKk_Note $fOrdKk_Note $fShowKk_Note$fEqKk_Contextual_Note$fOrdKk_Contextual_Note$fShowKk_Contextual_Note Begin_EndBeginEndLseqInterpolation_TNoneLinearEseqWseqTseqPseqIseqDseqUseqpseq_zipwseq_zip seq_tspan tseq_tspan wseq_tspan wseq_startwseq_enddseq_duriseq_durpseq_durtseq_durwseq_dur wseq_until wseq_twindowwseq_atwseq_at_window dseq_append iseq_append pseq_append tseq_merge tseq_merge_bytseq_merge_resolve w_compare wseq_mergewseq_merge_set eseq_mergetseq_lookup_window_bytseq_lookup_active_bytseq_lookup_activetseq_lookup_active_by_deftseq_lookup_active_deflerp lseq_tmap lseq_lookuplseq_lookup_errseq_tmapseq_map seq_bimap seq_tfilter seq_filterseq_find seq_map_maybeseq_cat_maybesseq_changed_by seq_changed wseq_tmap_st wseq_tmap_dur seq_partitiontseq_partitionwseq_partition coalesce_f coalesce_m coalesce_t seq_coalesce dseq_coalescedseq_coalesce' iseq_coalesce seq_tcoalescetseq_tcoalescewseq_tcoalescegroup_f tseq_group iseq_group wseq_fill_durdseq_lcmdseq_set_wholedseq_end tseq_latchtseq_endtseq_add_nil_after wseq_sortwseq_discard_durwseq_nodes_overlapwseq_find_overlap_1wseq_has_overlapswseq_remove_overlaps_rmwseq_remove_overlap_rw_1wseq_remove_overlaps_rw seq_unjoin wseq_unjoin wseq_shift wseq_append wseq_concat wseq_zero begin_end_map cmp_begin_endeither_to_begin_endbegin_end_to_eitherbegin_end_partitionbegin_end_track_bybegin_end_trackwseq_begin_endwseq_begin_end_eitherwseq_begin_end_ftseq_begin_end_accumwseq_begin_end_accumtseq_accumulatewseq_accumulatetseq_begin_end_to_wseq useq_to_dseq useq_to_wseq dseq_to_tseqdseq_to_tseq_lastdseq_to_tseq_discard iseq_to_tseq pseq_to_wseq tseq_to_dseqtseq_to_dseq_final_durtseq_to_dseq_total_dur tseq_to_wseqtseq_to_wseq_iot tseq_to_iseq dseq_to_wseq wseq_to_dseq eseq_to_wseqdseql_to_tseql wseq_cycle_ls wseq_cycle wseq_cycle_nwseq_cycle_until dseq_tmap pseq_tmap tseq_tmap tseq_bimap wseq_tmapdseq_mappseq_maptseq_mapwseq_map dseq_tfilter iseq_tfilter pseq_tfilter tseq_tfilter wseq_tfilter dseq_filter iseq_filter pseq_filter tseq_filter wseq_filterwseq_map_maybewseq_cat_maybes tseq_to_map$fFunctorBegin_End $fEqBegin_End$fShowBegin_End$fEqInterpolation_T$fEnumInterpolation_T$fShowInterpolation_TPhrase phrase_notes phrase_lengthnote_start_time note_duration note_valueLength note_end_time note_regionnote_shift_timenote_scale_durationnote_scale_duration_and_timenote_is_start_in_regionnote_is_entirely_in_region phrase_valuesphrase_set_length phrase_degreephrase_start_timephrase_end_timephrase_durationphrase_maximumphrase_minimum phrase_atphrase_time_atphrase_clear_at phrase_at_putphrase_is_empty phrase_appendphrase_append_list phrase_mergephrase_merge_list phrase_selectphrase_partitionphrase_select_regionphrase_clear_regionphrase_select_indicesphrase_clear_indicesphrase_extract_regionphrase_delete_regionphrase_separatephrase_reversephrase_reorderphrase_truncate phrase_trimnote_mapphrase_value_mapphrase_note_mapphrase_phrase_map phrase_map phrase_shiftphrase_scale_durationphrase_scale_duration_and_timephrase_scale_to_durationphrase_scale_to_regionphrase_to_wsequseq_to_phrasedseq_to_phrasewseq_to_phrase $fEqPhrase $fOrdPhrase $fShowPhrasephrase_arpeggio phrase_echo phrase_stepphrase_shuffleMnddEventMndChannelParam param_parseparam_pp data_value_pp csv_mnd_hdrcsv_mnd_parse_f csv_mnd_parseload_csv csv_mnd_read csv_mnd_write event_mnnevent_ch event_eq_mnn event_eq_ol event_map event_castevent_transposemidi_tseq_to_midi_wseqmidi_wseq_to_midi_tseq mnd_to_tseqcsv_mnd_read_tseqcsv_mnd_write_tseq csv_mndd_hdr mndd_comparecsv_mndd_parse_fcsv_mndd_parse csv_mndd_readcsv_mndd_write mndd_to_wseqcsv_mndd_read_wseqcsv_mndd_write_wseqcsv_midi_parse_wseq_fcsv_midi_parse_wseqcsv_midi_read_wseqSkiniAbsolutemnd_msg_to_skini_msgmnd_to_skini_fmnd_to_skini_absmidi_tseq_to_skini_seqtime_pp skini_pp_csvskini_write_csvusage read_wseq_i read_wseq_r mnd_to_mndd_imndd_transpose_rcsv_midi_concat_r csv_midi_cliRational_Time_SignatureComposite_Time_SignatureTime_Signature ts_whole_notets_whole_note_rqts_rq ts_comparerq_to_ts ts_divisionsts_duration_pulses ts_rewritets_sumcts_rq cts_divisionscts_pulse_to_rqcts_pulse_to_rqwrts_rq rts_divisions rts_deriverts_pulse_to_rqrts_pulse_to_rqw Tempo_Marking rq_to_secondspulse_durationmeasure_durationmeasure_duration_fmetronome_table_wittnermetronome_table_nikkomm_name Simplify_M Simplify_P Simplify_Tcoalescecoalesce_accum coalesce_sum take_sum_bytake_sumtake_sum_by_eqsplit_sum_by_eq split_sum rqt_split_sum rqt_separaterqt_separate_mrqt_separate_tupletrqt_tuplet_subdividerqt_tuplet_subdivide_seqrqt_tuplet_sanity_ rqt_tuplet_subdivide_seq_sanity_to_measures_rqto_measures_rq_untied_errto_measures_rq_cmnto_measures_tsto_measures_ts_by_eqm_divisions_rqm_divisions_tsto_divisions_rqto_divisions_ts p_tuplet_rqtp_notatem_notate mm_notate meta_table_p meta_table_t default_tabledefault_8_ruledefault_4_rule default_rule m_simplifym_simplify_fixp_simplify_rule p_simplify notate_rqpnotate zip_hold_lhszip_hold_lhs_errzip_hold m_ascribeascribe mm_ascribenotate_mm_ascribenotate_mm_ascribe_err group_chd ascribe_chdmm_ascribe_chdCtct_lenct_tsct_markct_tempoct_countCt_NodeCt_MarkCt_Start Ct_NormalCt_EdgeCt_PreCt_EndMrqMdvPulseMeasure mdv_to_mrq mp_lookup_err mp_comparect_extct_ext1 ct_dv_seq ct_mdv_seqct_rq ct_mp_lookup ct_m_to_rq ct_mark_seq ct_pre_markct_pre_mark_seqct_tempo_lseq_rq ct_tempo_at ct_leadindelay1 ct_measure ct_tempo0 ct_tempo0_err ct_measuresct_dseq'ct_dseq ct_rq_measurect_rq_mp ct_rq_mp_err ct_mp_to_rq$fShowCt $fEqCt_Node $fShowCt_NodeSavartsCents_ICentsApproximate_Ratiofmidi_to_cps_k0fmidi_to_cps_f0 fmidi_to_cpsmidi_to_cps_k0 midi_to_cpscents_to_fratiofratio_to_centscps_shift_centscps_difference_centsoct_diff_to_ratio ratio_to_pcfold_ratio_to_octave_nonrecfold_ratio_to_octave_errfold_ratio_to_octaveratio_interval_class_byratio_interval_classapproximate_ratioapproximate_ratio_to_centsratio_to_centsreconstructed_ratiosyntonic_commapythagorean_commamercators_comma#twelve_tone_equal_temperament_commacents_et12_difffcents_et12_diffcents_interval_classfcents_interval_class cents_diff_pp cents_diff_brcents_diff_text cents_diff_mdcents_diff_htmlfratio_to_savartssavarts_to_fratiosavarts_to_centscents_to_savartsPitch_R Midi_Cents Midi_Detune Spelling_MSpellingPitchnote alterationoctaveFOctPcFMidiMidiOctPcOctave PitchClassOctave_PitchClassoctave_pitchclass_nrmoctave_pitchclass_trsoctave_pitchclass_to_midimidi_to_octave_pitchclasspianokey_to_octave_pitchclassoctave_pitchclass_to_octpc octpc_nrm octpc_trs octpc_range midi_to_intdouble_to_midi octpc_to_midi midi_to_octpc octpc_to_foct foct_to_octpc foct_to_midioctpc_to_fmidifmidi_to_foctpc fmidi_octavefoctpc_to_fmidifmidi_in_octavefmidi_et12_cents_pppitch_clear_quarter_tonepitch_to_octpc pitch_is_12et pitch_to_midipitch_to_fmidi pitch_to_pc pitch_compareoctpc_to_pitch midi_to_pitchfmidi_to_pitchfmidi_to_pitch_errpitch_transpose_fmidifmidi_in_octave_offmidi_in_octave_nearestfmidi_in_octave_abovefmidi_in_octave_belowlift_fmidi_binop_to_cpscps_in_octave_nearestcps_in_octave_abovecps_in_octave_belowcps_in_octave_above_directpitch_in_octave_nearestpitch_note_raisepitch_note_lower%pitch_rewrite_threequarter_alterationpitch_edit_octavepitch_to_cps_k0pitch_to_cps_f0 pitch_to_cpscps_to_fmidi_k0 cps_to_fmidi cps_to_midioctpc_to_cps_k0 octpc_to_cps cps_to_octpc cps_octavecents_is_normalmidi_detune_is_normalmidi_detune_normalisemidi_detune_normalise_positivemidi_detune_to_cps_f0midi_detune_to_cpsmidi_detune_to_fmidimidi_detune_to_pitchfmidi_to_midi_detunecps_to_midi_detunemidi_detune_nearest_24etmidi_detune_to_midi_cents midi_cents_pp pc24et_univpc24et_to_pitch pitch_r_pppitch_r_class_pp p_octave_isop_octave_iso_optp_iso_pitch_strictp_iso_pitch_oct parse_octaveparse_iso_pitch_octparse_iso_pitchparse_iso_pitch_err pitch_pp_optpitch_pppitch_class_pppitch_class_names_12et pitch_pp_iso ly_octave_tbl octave_pp_lyoctave_parse_ly pitch_pp_hly pitch_pp_tonh p_octave_ly p_pitch_lypitch_parse_ly_err p_pitch_hlypitch_parse_hly $fOrdPitch $fEqPitch_R $fShowPitch_R $fEqPitch $fShowPitchSpelling_Tablepc_spell_natural_tblpc_spell_sharp_tblpc_spell_flat_tblpc_spell_ks_tbl pc_spell_tblpc_spell_tbl_kspc_spell_natural_mpc_spell_natural pc_spell_kspc_spell_sharp pc_spell_flatoctpc_to_pitch_ksmidi_to_pitch_ksfmidi_to_pitch_ksmidi_detune_to_pitch_ksmidi_to_pitch_sharpcluster_normal_ordercluster_normal_order_octpccluster_is_multiple_octavespell_cluster_table spell_clusterspell_cluster_octpcspell_cluster_c4spell_cluster_cspell_cluster_fspell_cluster_lefta0b0bes0ais0bis0c1d1e1f1a1b1ces1des1ees1fes1ges1aes1bes1cis1dis1eis1fis1gis1ais1bis1c2d2e2f2a2b2ces2des2ees2fes2ges2aes2bes2cis2dis2eis2fis2gis2ais2bis2cisis2disis2eisis2fisis2gisis2aisis2bisis2ceseh2deseh2eeseh2feseh2geseh2aeseh2beseh2ceh2deh2eeh2feh2geh2aeh2beh2cih2dih2eih2fih2gih2aih2bih2cisih2disih2eisih2fisih2gisih2aisih2bisih2c3d3e3f3g3a3b3ces3des3ees3fes3ges3aes3bes3cis3dis3eis3fis3gis3ais3bis3ceses3deses3eeses3feses3geses3aeses3beses3cisis3disis3eisis3fisis3gisis3aisis3bisis3ceseh3deseh3eeseh3feseh3geseh3aeseh3beseh3ceh3deh3eeh3feh3geh3aeh3beh3cih3dih3eih3fih3gih3aih3bih3cisih3disih3eisih3fisih3gisih3aisih3bisih3c4d4e4f4a4b4ces4des4ees4fes4ges4aes4bes4cis4dis4eis4fis4gis4ais4bis4ceses4deses4eeses4feses4geses4aeses4beses4cisis4disis4eisis4fisis4gisis4aisis4bisis4ceseh4deseh4eeseh4feseh4geseh4aeseh4beseh4ceh4deh4eeh4feh4geh4aeh4beh4cih4dih4eih4fih4gih4aih4bih4cisih4disih4eisih4fisih4gisih4aisih4bisih4c5d5e5f5g5a5b5ces5des5ees5fes5ges5aes5bes5cis5dis5eis5fis5gis5ais5bis5ceses5deses5eeses5feses5geses5aeses5beses5cisis5disis5eisis5fisis5gisis5aisis5bisis5ceseh5deseh5eeseh5feseh5geseh5aeseh5beseh5ceh5deh5eeh5feh5geh5aeh5beh5cih5dih5eih5fih5gih5aih5bih5cisih5disih5eisih5fisih5gisih5aisih5bisih5c6d6e6f6a6b6ces6des6ees6fes6ges6aes6bes6cis6dis6eis6fis6gis6ais6bis6ceseh6deseh6eeseh6feseh6geseh6aeseh6beseh6ceh6deh6eeh6feh6geh6aeh6beh6cih6dih6eih6fih6gih6aih6bih6cisih6disih6eisih6fisih6gisih6aisih6bisih6c7d7e7f7g7a7b7ces7des7ees7fes7ges7aes7bes7cis7dis7eis7fis7gis7ais7bis7c8cis8d8 interval_typeinterval_qualityinterval_directioninterval_octaveInterval_Quality DiminishedMinorPerfectMajor Augmented Interval_TypeUnisonSecondThirdFourthFifthSixthSeventh interval_tyinterval_q_tbl interval_qinterval_q_reverseinterval_semitonesintervalinvert_intervalquality_difference_mquality_differencepitch_transposecircle_of_fifthsparse_interval_typeparse_interval_qualityinterval_type_degreeinterval_quality_ppparse_intervalparse_interval_err interval_ppstd_interval_names $fEqInterval$fShowInterval$fEqInterval_Quality$fEnumInterval_Quality$fBoundedInterval_Quality$fOrdInterval_Quality$fShowInterval_Quality$fEqInterval_Type$fEnumInterval_Type$fBoundedInterval_Type$fOrdInterval_Type$fShowInterval_TypeMode Minor_Mode Major_Modemode_ppmode_identifier_pp mode_parallel mode_pc_seqkey_modekey_sequence_42key_sequence_30 key_parallel key_transpose key_relative key_mediant key_pc_set key_lc_pp key_lc_uc_pp key_lc_iso_ppkey_lc_tonh_ppkey_identifier_ppnote_char_to_keykey_lc_uc_parse key_fifthskey_fifths_tbl fifths_to_key implied_keyimplied_fifthsimplied_key_errimplied_fifths_err$fEqMode $fOrdMode $fShowModepcset_spell_implied_key_fpcset_spell_implied_keyoctpc_spell_implied_keymidi_spell_implied_keyspell_octpc_setspell_midi_setChord Chord_Type Diminished_7Half_Diminished Suspended_2 Suspended_4 ExtensionD7M7Pcpc_pp extension_tbl extension_dat extension_ppextension_to_pc is_suspendedchord_type_tblchord_type_dat chord_type_ppchord_type_pcset chord_pcsetbass_ppchord_ppm_errorp_pcp_mode_m p_chord_type p_extensionp_bassp_chord parse_chord $fShowChord$fEqChord_Type$fShowChord_Type $fEqExtension$fShowExtension i_to_intervalinterval_simplifyperfect_fourth perfect_fifth major_seventhClefclef_t clef_octave Clef_TypeBassTenorAltoTreble Percussion clef_range clef_suggest clef_zero clef_restrict$fEqClef $fOrdClef $fShowClef $fEqClef_Type$fOrdClef_Type$fShowClef_TypePart Voice_Rng_TblSoprano voice_abbrev voice_clefvoice_rng_tbl_stdvoice_rng_tbl_safe voice_rng voice_rng_stdvoice_rng_safein_range_inclusive in_voice_rngpossible_voicespossible_voices_stdpossible_voices_safesatb satb_name satb_abbrev ch_satb_seqch_partspart_nm k_ch_groups k_ch_groups' dbl_ch_parts mk_clef_seq $fEqVoice $fOrdVoice $fEnumVoice$fBoundedVoice $fShowVoice Table_2_Rowbarlowdisharmonicity harmonicity harmonicity_m harmonicity_rharmonicity_r_100mk_table_2_rowtable_2 table_2_ppTUNtun_sec tun_attr_txt tun_attr_int tun_attr_real tun_begintun_info tun_tuningtun_f0_defaulttun_exact_tuningtun_functional_tuningtun_endtun_from_cents_version_onetun_from_cents_version_two tun_storeEfg efg_degree efg_tones efg_collate efg_factors efg_ratiosefg_diagram_set Pitch_DetuneHS_Roctpc_to_pitch_cps_k0octpc_to_pitch_cps tbl_12et_k0tbl_12et tbl_24et_k0tbl_24etbounds_et_tablebounds_12et_tonendphs_r_pp hs_r_pitch_ppnearest_et_table_tonenearest_12et_tone_k0nearest_24et_tone_k0alteration_72et_monzo pitch_72et_k0 tbl_72et_k0nearest_72et_tone_k0hsr_to_pitch_detunenearest_pitch_detune_12et_k0nearest_pitch_detune_24et_k0ratio_to_pitch_detunepitch_detune_to_cpsratio_to_pitch_detune_12et_k0ratio_to_pitch_detune_24et_k0pitch_detune_in_octave_nearestpitch_detune_mdpitch_detune_htmlpitch_class_detune_mdpitch_class_detune_htmlGamelan Tone_GroupTone_Set Instrumentinstrument_nameinstrument_scaleinstrument_pitchesinstrument_frequencies Tone_SubsetTonetone_instrument_name tone_notetone_frequencytone_annotation note_scale note_pitch pitch_octave pitch_degree Annotation FrequencyDegreeScalePelogSlendroInstrument_Name Bonang_BarungBonang_Panerus Gambang_Kayu Gender_BarungGender_PanerusGender_Panembung Gong_Ageng Gong_SuwukanKempulKempyangKenongKetuk Saron_Barung Saron_Demung Saron_PanerusInstrument_FamilyBonangGambangGenderGongSaron fromJust_errnear_ratinstrument_family_setinstrument_familyinstrument_name_ppinstrument_name_clefinstrument_name_clef_plainpitch_pp_asciipitch_pp_duple note_degree note_comparenote_range_elemnote_gamut_elemtone_frequency_err plain_tonetone_equivalenttone_24et_pitchtone_24et_pitch'tone_24et_pitch_detunetone_24et_pitch_detune' tone_fmiditone_24et_fmiditone_12et_pitchtone_12et_pitch'tone_12et_pitch_detunetone_12et_pitch_detune'tone_12et_fmidi tone_familytone_in_family select_tones tone_subset tone_scale tone_pitch tone_degree tone_degree' tone_octave tone_classinstrument_class tone_class_ptone_family_class_ptone_set_near_frequencytone_compare_frequencymap_maybe_uniform instrument instrumentsinstrument_gamut scale_degrees degree_indextone_set_gamuttone_set_instrument $fOrdTone$fEqInstrument$fShowInstrument$fEqTone $fShowTone $fEnumScale $fEqScale $fOrdScale $fShowScale $fReadScale$fEnumInstrument_Name$fBoundedInstrument_Name$fEqInstrument_Name$fOrdInstrument_Name$fShowInstrument_Name$fReadInstrument_Name$fEnumInstrument_Family$fBoundedInstrument_Family$fEqInstrument_Family$fOrdInstrument_Family$fShowInstrument_Family$fReadInstrument_Family Euler_Plane RAT_LABEL_OPTrat_mulrat_divtun_seq all_pairseuler_align_ratcents_pp rat_labelrat_idrat_edge_labelzip_sme euler_plane_reuler_plane_mapeuler_plane_to_doteuler_plane_to_dot_ratodd_torowcolumn in_oct_mulinnermeyer_table_rckmeyer_table_indicesmeyer_table_rowst3_3elementsdegreefarey_sequenceorelateurelateitd_map map_to_tableitd_tbl k_manisrenga k_kanjutmesem k_udanriris k_pengawesari k_rarasrumk_hardjanagara k_madukentirk_surakk_setcalculate_averages k_averagesgm_1gm_2gm_3gm_4gm_5gm_6gm_7gm_8gm_set gm_averages i_categories i_categoryi_category_tablepolansky_1984_rpolansky_1984_c kanjutmesem_s kanjutmesem_pdarius_s madeleine_p lipur_sih_s lipur_sih_pidealized_et_sidealized_et_pax_r scl_ji_au pl_dissonancepl_dissonance_h local_minima atms_fig_1 atms_fig_2 atms_fig_3 rtt_fig_2Tuningtn_ratios_or_cents tn_octave tn_epsilon tn_as_ratio tn_as_cents tn_octave_deftn_octave_centstn_octave_ratio tn_divisions tn_ratiostn_limit tn_ratios_errtn_cents tn_cents_itn_cents_octavetn_fmiditn_approximate_ratiostn_approximate_ratios_cyclictn_ratios_lookuptn_approximate_ratios_lookuptn_reconstructed_ratiostn_equal_temperamenttn_equal_temperament_12tn_equal_temperament_19tn_equal_temperament_31tn_equal_temperament_53tn_equal_temperament_72tn_equal_temperament_96 $fEqTuning $fShowTuningmk_isomorphic_layoutminimal_isomorphic_note_layoutrank_two_regular_temperamentmk_syntonic_tuning syntonic_697 syntonic_702Epsilon Pitch_Type Pitch_Cents Pitch_Ratio pitch_type pitch_cents pitch_ratiopitch_representationsuniform_pitch_typepitch_type_predominant scale_namescale_description scale_degree scale_pitches pitch_non_oct scale_verifyscale_verify_err scale_octavescale_octave_errperfect_octaveis_scale_uniformis_scale_ascending scale_uniform scale_cents scale_cents_i scale_ratiosscale_ratios_uscale_ratios_reqscale_eq scale_eq_n scale_sub scale_eqv is_commentremove_eol_commentsfilter_comments parse_pitchparse_pitch_ln parse_scl scl_get_dirscl_derive_filenamescl_resolve_namescl_loadscl_load_dir_fn scl_load_dir scl_load_dbscales_dir_txt_tblscales_dir_txt_csv scale_statscale_ppscale_wr scale_wr_dir dist_get_dirload_dist_fileload_dist_file_ln scl_is_ji scl_ji_limitscl_cdiff_abs_sumscl_cdiff_abs_sum_1scl_db_query_cdiff_asc scale_cmp_ji scl_find_jiscale_to_tuningtuning_to_scalescl_load_tuning$fEqPitch_Type$fShowPitch_TypeModeNammode_starting_degreemode_intervals mode_isetmode_histogrammode_description mode_length mode_univmode_degree_seq modenam_modesmodenam_search_seqmodenam_search_seq1modenam_search_description mode_rot_eqv mode_statnon_implicit_degreeis_non_implicit_degree is_integerparse_modenam_entryjoin_long_lines parse_modenam load_modenamKbmkbm_pp kbm_in_rng kbm_is_linear kbm_lookup kbm_lookup_mF kbm_parse kbm_load_file kbm_load_distkbm_loadkbm_load_dir_fnkbm_load_dist_dir_fn kbm_formatkbm_wr kbm_d12_a440 kbm_d12_c256kbm_k0kbm_oct_key_seq kbm_mC_freq kbm_fmidi_tbl kbm_cps_tblINTNAMINTERVALintnam_search_ratiointnam_search_fratiointnam_search_ratio_name_errintnam_search_description_ciparse_intnam_entry parse_intnam load_intnam equaltemp lineartempinterval_hist_ratiosintervals_list_ratios_rintervals_list_ratiosinterval_half_matrixinterval_half_matrix_tblintervals_half_matrixintervals_half_matrix_centsintervals_half_matrix_ratiosinterval_matrix_ratiointerval_matrix_centsintervals_matrix_wrintervals_matrixintervals_matrix_centsintervals_matrix_ratios t2_to_ratio dr_tuning_oct dr_tuningdr_scaledr_scale_tbl_12etdr_scale_scaladr_scale_tbl_24et dr_chords dr_ratio_seqdr_ratio_seq_histdr_nt dr_nt_pitchr_flipr_nrmr_reliset_symrem_octr_pcset r_pcset_univ r_is_pcsetedj_rmk_graphg_to_dot mk_graph_scl scl_to_dot graph_to_fgl mk_graph_fgl ps5_jpr_rps5_jpr psaltery_r psaltery_o_r psaltery_o Mnn_Cps_TableMnn_Fmnn_TableCps_Midi_TuningD12_Midi_TuningSparse_Midi_Tuning_St_fSparse_Midi_Tuning_f Midi_Tuning_f lift_tuning_flift_sparse_tuning_fd12_midi_tuning_fcps_midi_tuning_fmnn_fmnn_table_load_csvgen_cps_tuning_tbl dtt_lookupdtt_lookup_errgen_dtt_lookup_tblgen_dtt_lookup_fdb_stat db_summariseenvcutsearch search_scale search_modestat_all stat_by_namerng_enumcps_tbl cps_tbl_d12 cps_tbl_cpscsv_mnd_retune_d12fluidsynth_tuning_d12midi_tbl_tuning_d12ratio_cents_pp intnam_lookup intnam_searchkbm_tbl nil_or_read scala_cliChoose_fLoad_Tuning_Opt load_cps_tblload_tuning_sclload_tuning_cpsload_tuning_d12load_tuning_tbldefault_choose_fload_tuning_tbl_stload_tuning_tyload_tuning_st_tyharmonic_seriesharmonic_series_cpsharmonic_series_cps_nsubharmonic_series_cpssubharmonic_series_cps_npartialharmonic_series_cps_derivedharmonic_series_folded_rharmonic_series_folded_charmonic_series_foldedharmonic_series_folded_21 lmy_wtp_rlmy_wtp_ratio_to_pclmy_wtp_ratio_to_pc_err lmy_wtp_univ lmy_wtp_uniqlmy_wtplmy_wtp_1964_r lmy_wtp_1964 lmy_wtp_eulerwerckmeister_iii_arwerckmeister_iii_ar_cwerckmeister_iiiwerckmeister_iv_arwerckmeister_iv_cwerckmeister_ivwerckmeister_v_arwerckmeister_v_cwerckmeister_vwerckmeister_vi_rwerckmeister_viriley_albion_r riley_albionpythagorean_12_rpythagorean_12five_limit_tuning_rfive_limit_tuning"septimal_tritone_just_intonation_r septimal_tritone_just_intonationseven_limit_just_intonation_rseven_limit_just_intonationkirnberger_iii_arkirnberger_iii vallotti_cvallottimayumi_tsuda_r mayumi_tsudalou_harrison_16_rlou_harrison_16 partch_43_r partch_43ben_johnston_25_rben_johnston_25pietro_aaron_1523_cpietro_aaron_1523thomas_young_1799_cthomas_young_1799zarlino_1588_r zarlino_1588ben_johnston_mtp_1977_rben_johnston_mtp_1977gann_arcana_xvi_rgann_arcana_xvigann_superparticular_rgann_superparticularharrison_ditone_rharrison_ditonealves_slendro_r alves_slendroalves_pelog_bem_ralves_pelog_bemalves_pelog_barang_ralves_pelog_barangalves_pelog_23467_ralves_pelog_23467 Named_Tuningnamed_tuning_t tuning_dbtuning_db_lookup_sclHELM3_GenM_GenSbt_NodeSBT_DIVNILLHSRHS Ew_Gr_OptRatLattice_PositionLattice_FactorsLattice_DesignV2v2_mapv2_zipv2_addv2_sumv2_scalept_set_normalise_sym ew_lc_std kg_lc_stdew_lc_tetradic lc_pos_del lc_pos_to_pt pos_pp_wslat_res rat_rem_oct rat_lift_1 rat_to_ratio rat_mediantrat_pp r_rem_oct r_verify_oct r_seq_limit r_seq_factors rat_fact_lmtbl_txttbl_wr ew_gr_opt_pos ew_gr_r_pos ew_gr_udot ew_gr_udot_wrew_gr_udot_wr_svgzz_seq_1zz_nextzz_recurzz_seq gen_coprimemos_2mos_step mos_unfold mos_verifymosmos_seq mos_cell_pp mos_row_pp mos_tbl_pp mos_tbl_wr mos_recip_seqmos_log mos_log_kseqsbt_stepsbt_rootsbt_halfsbt_from sbt_k_fromsbt_node_to_edge sbt_node_elemsbt_dot^. r_normalise m_gen_unfold m_gen_to_rm3_to_m m3_gen_unfold m3_gen_to_r r_to_scale ew_scl_find_r ew_1357_3_gen ew_1357_3_r ew_1357_3_scl ew_el12_7_r ew_el12_7_scl ew_el12_9_r ew_el12_12_rew_el12_12_scl ew_el22_2_r ew_el22_3_r ew_el22_4_r ew_el22_5_r ew_el22_6_r ew_diamond_mkew_diamond_12_genew_diamond_12_rew_diamond_13_r hel_r_aschel_1_ihel_2_ihel_3_ihel_r ew_hel_12_r ew_hel_12_sclshe_div she_div_r she_mul_rshe every_nthmerumeru_kmeru_1 meru_1_directmeru_2 meru_2_directmeru_3 meru_3_seq meru_3_directmeru_4 meru_4_directmeru_5 meru_5_seq meru_5_directmeru_6 meru_6_direct meru_7_directew_mos_13_tanabe_rew_novarotreediamond_1ew_novarotreediamond_1_rew_novarotreediamond_1_sclew_Pelogflute_2_rew_Pelogflute_2_scl xen1_fig3 xen1_fig4ew_xen3b_3_gen ew_xen3b_3_rew_xen3b_3_scl xen3b_9_i xen3b_9_r xen3b_13_i xen3b_13_rew_xen3b_apx_genew_xen3b_apx_rew_xen456_7_gen ew_xen456_7_rew_xen456_9_gen ew_xen456_9_rew_xen456_9_scl ew_poole_r ew_poole_sclew_centaur17_r ew_two_22_7_rew_two_22_7_scl ew_scl_db $fShowSBT_DIVRadialCircumferentialnormalise_stepparse_num_sign vec_expand parse_vecadd_m parse_hex_clrparse_hex_clr_int clr_normalise seq_groupiw_pc_ppu3_ix_chu3_ch_ixu3_vec_text_iwu3_vec_text_rw u3_vec_ix u3_ix_radial u3_clr_nm u3_clr_hex u3_clr_rgb u3_radial_ch u3_circ_chu3_ch_seq_to_vecdc9_circdc9_raddc9_ix dc9_clr_hex dc9_clr_rgbu11_circ u11_gen_seq u11_seq_rule ull_rad_textu11_rad u11_clr_hex u11_clr_rgbFaceF_BackF_FrontF_RightF_LeftF_BottomF_TopRelHalf_SeqLabelD2E2G2ILL2Q1Q2Q3Q4Q5Q6Q7Q8Q9Q10Q11Q12 complementfull_seqlowerl_onfib_procseq_of half_seq_ofhalf_seqlabel_of complementaryrelaterelate_l relations relations_lapply_relationapply_relationsapply_relations_lfaces viii_6_lseq viii_7_lseqviii_7 viii_6b_lseq viii_6b_p'viii_6b'viii_6bviii_6_relationsviii_6b_relations$fEqFace $fEnumFace $fBoundedFace $fOrdFace $fShowFace $fEqLabel $fOrdLabel $fEnumLabel$fBoundedLabel $fShowLabelSieveEmptyUnion Intersection Complementunion intersection∪∩sieve_ppl⋄ normalise is_normalelement i_complementbuildbuildn differentiateeuclid de_meziriacreduce_intersectionreducepsappha_flint_c psappha_flint a_r_squibbs_c a_r_squibbs $fEqSieve $fShowSieve z_modulusz_modz5z7z12z16is_z_n lift_unary_Z lift_binary_Zz_addz_subz_sub_unsignedz_mulz_negate z_fromIntegerz_signumz_absto_Zfrom_Zz_univ z_complementz_quotz_remdiv_errz_div z_quotRemz_divMod z_toIntegerintegral_to_digitis_z16 z16_to_char z16_set_pp z16_seq_pp z16_vec_pptranspose_to_zerodpcset_to_chordchord_to_dpcsetdpcset_complementis_ici_to_icis_chordivinf_cmpinfinvertz_n_univis_z4z7_univis_z7mod7sc_dbint_nall_interval_m all_intervalintpcoSrosro_rsro_Rsro_Tsro_Msro_Isro_ppp_sro sro_parse z_sro_univz_sro_Tn z_sro_TnI z_sro_RTnI z_sro_TnMI z_sro_RTnMI z_sro_apply z_sro_relz_sro_tn z_sro_invert z_sro_tniz_sro_mnz_sro_m5z_sro_t_relatedz_sro_ti_relatedz_sro_rti_relatedz_sro_tmi_relatedz_sro_rtmi_relatedz_sro_rrtmi_related z_sro_tn_toz_sro_invert_ix z_tmatrix$fEqSro $fShowSro Bit_ArrayCodecode_lenbit_array_complement bit_array_ppbit_array_parsebit_array_to_codecode_to_bit_arraybit_array_to_setset_to_bit_array set_to_codebit_array_is_primebit_array_augmentenumerate_halfset_coding_validate set_encode set_decodeset_encode_primeSC_TableSC_Name z_t_rotationsz_ti_rotations z_t_cmp_primez_ti_cmp_prime forte_cmp z_forte_prime z_t_primez_icz_icvz_bip z_sc_univsc_tablesc_table_unicodeforte_prime_name sc_tbl_lookupsc_tbl_lookup_err sc_name_tblsc_name sc_name_longsc_name_unicodescscsscs_ntics z_relation_ofrahn_cmp z_rahn_primerahn_forte_diffsimasimSATVMINMAXof_c sc_table_n icv_minmaxr_ppsatv_f satv_e_ppsatv_ppsatv_asatv_bsatv satv_minmaxabs_dif satv_n_sumtwo_part_difference_vectortwo_part_difference_vector_setsatsim satsim_tablesatsim_table_histogram$fEqR$fShowRZ12inv_symsc_t_ti t_sc_table t_sc_namet_sct_scst_scs_n t_subsets ti_subsetsrle rle_decode rle_lengtht_n_class_vectorti_n_class_vectordyad_class_percentage_vectorrelt_relti_reltto_Ttto_Mtto_I tto_identitytto_ppp_tto tto_parse tto_M_set z_tto_univz_tto_f z_tto_apply z_tto_relz_pcsetz_tto_tn z_tto_invert z_tto_tniz_tto_mnz_tto_m5z_tto_t_related_seqz_tto_t_relatedz_tto_ti_related_seqz_tto_ti_related$fEqTto $fShowTtoSicfcggcgcg_rchn_t0cisegcmplcycd_nmdimdim_nmdoiessfnfrg_cycfrgfrg_hdrfrg_pp has_sc_pfhas_scic_cycle_vectoric_cycle_vector_ppicficiici_cisegimbissbmxsnrmnrm_rpcirsrsgsbsccsi_hdrsi_calc si_rhs_ppsispscsrasrotmatrixtrstrs_mCMD z16_seq_parse pco_parsepco_pp cset_parsemk_cmd mk_cmd_manyess_cmd z12_sc_namefl_c_cmdfrg_cmdpi_cmdscc_cmdsi_cmdz12_sc_name_longspsc_cmdsra_cmdsro_cmd tmatrix_cmdtrs_cmd interact_lnpct_cliGrScPcsetsingularset_eq tto_tni_univall_tnall_tniuniq_tni pcset_trs trichordsself_invpcset_pp pcset_pp_hexathis_athath_univath_tniath_pp ath_trichordsath_complementath_completionsrealise_ath_seq ath_gr_extendgr_trstable_3pp_tbl table_3_mdtable_4 table_4_mdtable_5 table_5_mdtable_6 table_6_mdfig_1fig_1_grfig_2fig_3fig_3_grfig_4fig_5 uedge_set set_shapegr_pp'gr_ppd_fig_1 d_fig_3_gd_fig_3d_fig_3' d_fig_4_gd_fig_4 d_fig_5_gd_fig_5 d_fig_5_e d_fig_5_g'd_fig_5'SETIDPCSETSCdifabsdifp2_anddoi_ofloc_dif loc_dif_of loc_dif_in loc_dif_n loc_dif_n_ofmin_vl min_vl_of min_vl_in combinations2set_pp tto_rel_toset_pp_tto_relm_getm_doi_ofe_add_id gen_edges gen_u_edges oh_def_optgen_graph_ul_tygen_flt_graph_pp gen_flt_graphcirc_5adjadj_cyc p12_c5_eset e_add_label p12_c5_grp12_euler_planep12_euler_plane_grp14_esetp14_mk_e p14_edges_u p14_edges p14_mk_grp14_gr_up14_grp14_gen_tonnetz_np14_gen_tonnetz_e p14_nrt_gr p31_f_4_22 p31_e_setp31_gr p114_f_3_7 p114_mk_o p114_mk_grp114_f37_sc_ppp114_g0p114_g1 p114_gr_setp125_grp131_gr p148_mk_gr p148_gr_setp162_chp162_ep162_gr p172_nd_map p172_nd_e_setp172_nd_e_set_altp172_gr p172_set_pp p172_all_cyc p172_cyc0p172_g1p172_g2p172_g3tto_tntto_tnigen_tto_alt_seq gen_tni_seqp172_c4 tto_seq_edgesp172_g4 p172_gr_set partition_ic p177_gr_setait mk_bridge mk_bridge_setmk_bridge_set_seq p178_i6_seqp178_chp178_e p178_gr_1 p178_gr_2p196_gr bd_9_3_2_12 p201_mk_ep201_ep201_o p201_gr_set p201_gr_join bd_9_3_2_34 p205_mk_ep205_gr wr_graphs$hmt-base-0.20-KWCMT0MACddIjD7Vf7fWbmMusic.Theory.List rotate_rightghc-prim GHC.TypesTrueCharbase Data.OldListlines histogram GHC.Classes== GHC.MaybeNothingGHC.ErrerrorGHC.IOFilePathOrdcompareGHC.Real denominator numeratorcontainers-0.6.5.1 Data.TreeTreeJustGHC.ListbreakzipzipWith Data.Foldable concatMapMusic.Theory.Graph.TypeLbl!fgl-5.8.0.0-e7EofKizVZHtE9cwUa7y8Data.Graph.Inductive.GraphnoNodessubgraphData.Graph.Inductive.Query.DFS componentsmsumGHC.Base.mapreturnpre neighbors System.IO writeFile$logict-0.8.0.0-2F7o9vLwpfJsoGlZ1kTQ3Control.Monad.Logic.Class MonadLogicControl.Monad.Logic observeAll fromIntegral%primes-0.2.1.0-25UIgMuOUFIAk2kAwwZAlLData.Numbers.Primesprimes Data.Maybemaybemaximum primeFactorsRatio isPrefixOf GHC.FloatFloatingGHC.Num*+foldl1length transposeData.Map.Internal! genericIndexmoddivquotremIntegralconcatGHC.ShowshowGHC.Enum enumFromToreverse_lookupanysortnub^,multiset-comb-0.2.4.1-G3N7z8bFRVK6zLMOMksX3MMath.Combinatorics.Multisetunfoldr-ShowEQIntNum FractionalReal realToFracabssqrtd_dx_byflipOrderingminelemFalse Data.Tuplesnd Data.FunctiononputStrLn replicateid ghc-bignumGHC.Num.IntegerIntegerRationalDouble>++filterfindmapMaybe catMaybesmappendconstgroupByfstsum/<<= fromRationalroundLTGTMusic.Theory.Ord ord_invert>=StringfromJust Data.RatioapproxRational Data.EitherEitherMaybe intersectfmapdx_dreadFiletakecurry intToDigitd_dx\\