Jump to content

Search the Community

Showing results for tags 'attributes'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to Opusmodus
    • Announcements
    • Pre-Sales Questions
  • Support Forum
    • Support & Troubleshooting
    • OMN Lingo
    • Function examples
    • Score & Methods
    • Notation & Layout
    • Live Coding Instrument
    • Library & Sound Sets
    • MIDI Setup
    • Programming (Common Lisp)
  • Sharing
    • Made in Opusmodus
    • Templates & Customisation
  • Feedback
    • Suggestions & Ideas

Blogs

  • Stephane Boussuge's Blog
  • Deb76's Blog
  • Janusz Podrazik

Calendars

  • Community Calendar

Categories

  • Howto
  • Getting Started
  • Live Coding
  • Music Theory and Analysis

Marker Groups

  • Members

Found 3 results

  1. Opusmodus 1.2.22418

    New: POSITION-ATTRIBUTE ATTRIBUTE-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
  2. It is great that we meanwhile have user-defined attributes, but I sometimes like to add some ad-hoc text to the score without the need to first define them -- without any impact on the playback. This can be useful, e.g., to add rehearsal marks, various expressions and playing techniques, chord symbols, fingerings, or details for live electronics control. Beyond that, I like adding analytical information to the resulting score to inform later manual revisions, e.g., labelling motifs and perhaps even their transformation, adding custom chord and scale names etc. Doing this with user-defined attributes is kind of OK, but it could be more convenient to add certain texts to single notes, without announcing it to the system in general first. Therefore, I defined a little function that does just that. However, this function currently works only in a few cases. We can add multiple integers or floats above a note, without registering them first (useful, e.g., as parameters for live electronics). `(q ,(text-attribute -7 2 3.14 1000)) ; try notating this note => (q -7+2+3.14+1000) Here is the actual definition. (defun text-attribute (&rest args) "Convenient addition of arbitrary text directly the the score. Function transforms an arbitrary symbol, number or string or a list of symbols, numbers and strings into a an articulation symbol that is implicitly registered and can directly be added to an OMN note." (flet ((text-attr (x) (let ((s (format nil "~A" x))) (list (intern s) s)))) (merge-articulations (apply #'add-text-attributes (mapcar #'text-attr args))))) The definition depends on some other function I shared here before, but include again for convenience. (defun merge-articulations (arts &key (empty-articulations '(- default))) "Merges list of OMN articulations to a combined attribute. Args: arts: a list of OMN articulations empty-attributes: articulations to ignore in a combination. Examples: (merge-articulations '(ten ponte ubow)) => ten+ponte+ubow (merge-articulations '(- stacc)) => stacc" (intern (reduce #'(lambda (a1 a2) (format nil "~A+~A" a1 a2)) (mappend #'(lambda (art) (unless (some #'(lambda (a) (eq art a)) empty-articulations) (list (symbol-name art)))) arts)))) I would like to use the above scheme more generally, but that does not work yet. Here are a few examples that cause problems, but that I would like to see work. These examples are correctly translated into the corresponding symbols, but when trying to notate them OMN parse fails. ;; Works when symbol is registered separately, but seemingly cannot be registered "behind the scene" `(q ,(text-attribute 'espressivo)) ;; With a single expression like above, it could be argued that they can be registered explicitly with add-text-attributes, but for more specific texts this does not necessarily make sense, as they may be used only once `(q ,(text-attribute "like a whisper")) ;; Rehearsal mark (NOTE: individual letter symbols can cause confusion and should likely be avoided, e.g., "F" is understandably misunderstood by systemas dynamic mark) `(q ,(text-attribute "A")) `(q ,(text-attribute "r A")) ; rehearsal mark trying to avoid confusion with dynamic marks ;; Indications for live electronics -- using purely numbers might be OK to a certain degree `(q ,(text-attribute "delay 100ms")) `(q ,(text-attribute 'delay 100)) ;; Chord symbols need to be distinguishable from note names, hence the underscore here (could also be a space perhaps) `(q ,(text-attribute "C_7")) Strangely, on my system the following is turned into a second quarter note, even though the symbol test is unbound and not registered as a user attribute. `(q ,(text-attribute 'test)) Other applications might cause principle problems with what OMN expressions the system can parse. For example, if we use single numbers (useful, e.g., for fingering instructions) then these are misinterpreted as note durations. `(q ,(text-attribute 1)) `(q ,(text-attribute 1/4)) Single floats cause errors again. `(q ,(text-attribute 3.14)) Janusz: Is there perhaps a way to make some more of the examples above working? Also, I hope that there is no problem in calling add-text-attributes several times with the same symbol? I guess you store the total of all symbols in some data structure (e.g., a hash table) that prevents having them added multiple times? Thanks! Best, Torsten
  3. Hi, Don't know if this is a known issue: (setf one '((q g3 = = tie)(q g3 = =))) (setf two '((q g3 g3 g3 tie)(q g3 = =))) (get-time-signature one) -->((4 4 1) (3 4 1)) ;wrong (get-time-signature two) -->((3 4 2)) ;correct best ole
×