opmo Posted June 18 Share Posted June 18 Additions and improvement to DECHORD function: Extracts the root pitch from each chord by default: (dechord '(q c4 f4a4d5 e fs5)) => (q c4 mf f4 e fs5) Extracts the root pitch but returns it in normal-order (Pitch Class Set): (dechord '(q c4 f4a4d5 e fs5) :type 'pcs) => (q c4 mf d5 e fs5) Selects the 2nd pitch from each chord: (dechord '(q c4 f4a4d5 e fs5) :pitch 2) => (q c4 mf a4 e fs5) Selects the 2nd pitch and returns it in normal-order: (dechord '(q c4 f4a4d5 e fs5) :pitch 2 :type 'pcs) => (q c4 mf f4 e fs5) Applies the default pitch selection to a sequence of chords: (dechord '((q c4 f4a4d5 e fs5) (s cs4 d4 fs4 q c4e4gs4))) => ((q c4 mf f4 e fs5) (s cs4 mf d4 fs4 q c4)) Selects the highest pitch from each chord and returns it in normal-order: (dechord '((q c4 f4a4d5 e fs5) (s cs4 d4 fs4 q c4e4gs4)) :pitch 'top :type 'pcs) => ((q c4 mf a4 e fs5) (s cs4 mf d4 fs4 q gs4)) Selects the lowest pitch from each chord: (dechord '((q c4 f4a4d5 e fs5) (s cs4 d4 fs4 q c4e4gs4)) :pitch 'low) => ((q c4 mf f4 e fs5) (s cs4 mf d4 fs4 q c4)) Selects the highest pitch from each chord: (dechord '((q c4 f4a4d5 e fs5) (s cs4 d4 fs4 q c4e4gs4)) :pitch 'high) => ((q c4 mf d5 e fs5) (s cs4 mf d4 fs4 q gs4)) Each example demonstrates a specific use case of the DECHORD function, highlighting how to select various pitches from chords in a sequence. New Function: The SELECT-MEASURE function is used to extract specific bars and beats from a omn-form sequence. It allows for precise selection and transformation of musical measures based on given criteria, such as measure range and time signature. Define a Sequence: (setf seq '((q c4 db4 ab4 f4 g4 bb4) (e a4 eb4 b4 e4 d4 gb4) (q db4 ab4 f4 g4 bb4 a4) (q eb4 b4 e4 d4 gb4 c4))) The sequence is converted to a 4/4 time signature to standardise the format, which is required for the function: (setf mat (omn-to-time-signature seq '(4 4))) => ((q c4 mf db4 ab4 f4) (q g4 mf bb4 e a4 eb4 b4 e4) (e d4 mf gb4 q db4 ab4 f4) (q g4 mf bb4 a4 eb4) (q b4 mf e4 d4 gb4) (q c4 mf)) Select Specific Measures and Beats: (select-measure '((2.2 3) (4.2 5)) mat :ratio 1/4 :time-signature '(2 4)) => ((e a4 mf eb4 b4 e4) (q a4 mf eb4)) In this example, the function extracts notes from the second beat of the second measure to the end of the third measure, and from the second beat of the fourth measure to the end of the fifth measure. The result is transformed into a sequence with a 2/4 time signature. Stephane Boussuge, Cliff, jesele and 1 other 3 1 Link to comment Share on other sites More sharing options...
Recommended Posts