opmo Posted June 10, 2017 Share Posted June 10, 2017 New: POSITION-ATTRIBUTEATTRIBUTE-MAP EVENTS-ANALYSIS OM Developer/Predicates: 12TONEP CONTAIN-ATTRIBUTEP ATTRIBUTE-SYMBOLP EVENT-RESTP POSITION-ATTRIBUTE: The function POSITION-ATTRIBUTE returns a lists of bar numbers and positions values of a given attribute in a sequence. This function is a companion to the ATTRIBUTE-MAP function. Examples: (setf mat '((h. f6 mp stacc) (-q h a4d2 p fermata e fermata) (e. a4d2 p - h e4g3 mf s fs6 p e c6 mp ten e. cs4 p tie) (e cs4 p q gs5eb6 h b2 p stacc e stacc) (q b2 p tie s q f6a4 mf -e q. d2 p ten) (h d2 p tie s q e4 mp tr2 s tr2 -q. q f4 stacc) (s f4 h. a3gs5 p fermata -e. -s))) (position-attribute 'fermata mat) => ((2 (1/4 3/4)) (7 (1/16))) (position-attribute '(fermata stacc) mat) => (((2 (1/4 3/4)) (7 (1/16))) ((1 (0)) (4 (3/8 7/8)) (6 (5/4)))) ATTRIBUTE-MAP: The function ATTRIBUTE-MAP aligns attributes of one sequence (instrument) to another sequence. It is especially useful when aligning attributes like fermatas. Examples: (setf inst1 '((5h fs6 mp stacc 5q f6 ten - fs6 fermata) (3h bb6 p stacc -3q) (5q gs6 f stacc a6 ten - gs6 fs6 fermata) (5e gs6 mf stacc fs6 stacc 5q g6 ten - gs6 fermata g6) (s bb6 mp stacc b6 ten bb6 -) (5q f6 p stacc 5h fs6 ten 5q f6 -) (5q eb6 f stacc - 5h e6 ten 5q eb6))) (setf inst2 '((3q c6 mf -3h) (-5q gs5 p 5h g5 5e gs5 g5) (-3q 3h bb5 p) (-3h 3e bb5 mf a5) (-3q 3h a5 mp) (5e bb5 p c6 -5q 5h b5 5e 5e cs6) (-s c6 f d6 e6))) Inserting fermata attribute into the inst2 sequence: (setf map (position-attribute 'fermata inst1)) => ((1 (1/5)) (3 (1/5)) (4 (3/20))) (attribute-map 'fermata map inst2) => ((3q c6 mp -3h fermata) (-5q gs5 p 5h g5 5e gs5 g5) (-3q 3h bb5 f fermata) (-3h 3e bb5 mf fermata a5) (-3q 3h a5 mp) (5e bb5 p c6 -5q 5h b5 5e 5e cs6) (-s c6 f d6 e6)) Inserting fermata and stacc attributes into the inst2 sequence: (setf map2 (position-attribute '(fermata stacc) inst1)) => (((1 (1/5)) (3 (1/5)) (4 (3/20))) ((1 (0)) (2 (0)) (3 (0)) (4 (0 1/40)) (5 (0)) (6 (0)) (7 (0)))) (attribute-map '(fermata stacc) map2 inst2) => ((3q c6 mf stacc -3h fermata) (-5q gs5 mf 5h g5 5e gs5 g5) (-3q 3h bb5 mf fermata) (-3h 3e bb5 mf stacc+fermata a5) (-3q 3h a5 mp) (5e bb5 p stacc c6 -5q 5h b5 5e 5e cs6) (-s c6 f d6 e6)) EVENTS-ANALYSIS: The function EVENTS-ANALYSIS analyses a list of events of a given bar in a sequence. Examples: (setf mat '((5h fs6 mp stacc 5q f6 ten - fs6 fermata) (3h bb6 p stacc -3q) (5q gs6 f stacc a6 ten - gs6 fs6 fermata) (5e gs6 mf stacc fs6 stacc 5q g6 ten - gs6 fermata g6) (s bb6 mp fermata-l b6 ten bb6 -) (5q f6 p stacc 5h fs6 ten 5q f6 -) (5q eb6 f stacc - 5h e6 ten 5q eb6))) (events-analysis 2 mat) => Bar: 2 Time Signature: (1 4 1) Events: ((3h bb6 p stacc) (-3q)) Span: (1/6 1/12) Pitch: (bb4) Prime Form: nil Normal Order: nil Velocity: (p) Ambitus: (bb6 bb6) Interval Ambitus: 0 (events-analysis 4 mat) => Bar: 4 Time Signature: (1 4 1) Events: ((5e gs6 mf stacc) (5e fs6 mf stacc) (5q g6 mf ten) (-5q) (5q gs6 mf fermata) (5q g6 mf)) Span: (1/40 1/40 1/20 1/20 1/20 1/20) Pitch: (gs4 fs4 g4) Prime Form: (0 1 2) Normal Order: (6 7 8) Velocity: (mf) Ambitus: (fs6 gs6) Interval Ambitus: 2 (setf mat2 '((h. f6 mp stacc) (-q h a4d2 p fermata e fermata) (e. a4d2 p - h e4g3 mf s fs6 p e c6 mp ten e. cs4 p tie) (e cs4 p q gs5eb6 h b2 p stacc e stacc) (q b2 p tie s q f6a4 mf -e q. d2 p ten) (h d2 p tie s q e4 mp tr2 s tr2 -q. q f4 stacc) (s f4 h. a3gs5 p fermata -e. -s))) (events-analysis 5 mat2) => Bar: 5 Time Signature: (17 16 1) Events: ((q b2 p tie) (s b2 p) (q f6a4 mf) (-e) (q. d2 p ten)) Span: (1/4 1/16 1/4 1/8 3/8) Pitch: (b4 f4 a4 d4) Prime Form: (0 2 5 8) Normal Order: (9 11 2 5) Velocity: (p mf) Ambitus: (d2 f6) Interval Ambitus: 51 12tonep: Returns true if list is a 12-tone scale, and NIL otherwise. Examples: (12tonep '(4 10 1 3 5 2 6 8 9 11 7 0)) => t (12tonep '(e4 as4 cs4 ds4 f4 d4 fs4 gs4 a4 b4 g4 c4)) => t (12tonep '(e4 as4 cs4 ds4 f4 d4 fs4 gs4 a4 b4 f4 c4)) => nil CONTAIN-ATTRIBUTEP: Returns true if attribute is found in the sequence, and NIL otherwise. Examples: (contain-attributep 'fermata '(-h fermata)) => t (contain-attributep 'stacc '(-e a4 fermata+stacc d4 p fermata)) => t ATTRIBUTE-SYMBOLP: Returns true if object is a attribute, and NIL otherwise. Examples: (attribute-symbolp 'tie) => t (attribute-symbolp 'ponte+ten) => t EVENT-RESTP: Returns true if event is a rest, and NIL otherwise. Examples: (event-restp '(-q)) => t (event-restp '(-q fermata)) => t Best wishes, JP Stephane Boussuge and Deb76 2 Link to comment Share on other sites More sharing options...
Recommended Posts