[This example assumes you have imported "noodle.midi" as in the previous chapter and renamed the thread to Nood]
Stella [Top-Level]: map nood highest note and average rhythm CLAUSE COUNT VALUE highest note 180 GS6 average rhythm 180 0.10138889 Stella [Top-Level]:Map examined the data in Nood and returned information in a table. Each table entry shows the relevant command clause, the number of times it was processed and the value that the clause returned. The first entry says that the highest note in Nood is GS6 and that the clause was processed 180 times. This number might be less than the total number of elements mapped if the clause were conditional.
Stella [Top-Level]: map nood sum rhythm CLAUSE COUNT VALUE sum rhythm 180 18.25To count the number of frequencies above fs5:
Stella [Top-Level]: map nood count (scale> note fs5) CLAUSE COUNT VALUE count (scale> note 'fs5) 180 81To collect every 20th frequency in a list:
Stella [Top-Level]: map nood[1:*:20] collect note CLAUSE COUNT VALUE collect note 9 (C4 GS4 F4 C4 C6 GS4 DS6 C6 DS6)
Stella [Top-Level]: map nood when (scale> note 'fs5) sum rhythm CLAUSE COUNT VALUE sum rhythm 81 8.625More than one clause may be conditional on a single test, and mixtures of conditional and independent clauses may also be expressed. The next example counts the note and sum the rhythms of frequencies higher than fs5, but sums all duration.
Stella [Top-Level]: map nood when (scale> note fs5) count note and sum rhythm sum duration CLAUSE COUNT VALUE count note 81 81 sum rhythm 81 8.625 sum duration 180 49.875In this final example, material is scaled if the frequency is either c4, fs4, or c5:
Stella [Top-Level]: map nood when (member note '(c4 fs4 c5)) scale amplitude 1.5 Stella [Top-Level]: mix nood Start time offset: (<cr>=None) <cr> Stella [Top-Level]:
Next Chapter
Previous Chapter
Table of Contents
Last Modified: 6-Mar-1998