Jump to content

Featured Replies

Posted

I’m writing a piece for flute, oboe clarinet using infinity series and I get the following error:

<<automatic abort>>

OM 6 > infinity-series

gen-repeat

gen-repeat

flatten

infinity-series

gen-repeat

gen-repeat

flatten

infinity-series

gen-repeat

gen-repeat

flatten

ps

Error: OMN Parse Error: fail

1 (abort) Return to top loop level 0.

Type :b for backtrace or :c <option number> to proceed.

Type :bug-form "<subject>" for a bug report template or :? for other options.

OM 7 : 1 >

What am I doing wrong?

My code (with the help of Chat GPT) is:

;; --------- Helper Functions ---------

(defun make-crescendo (start end steps)

(let* ((dynamic-scale '(pp p mp mf f ff))

(start-index (position start dynamic-scale))

(end-index (position end dynamic-scale))

(range (if (< start-index end-index)

(subseq dynamic-scale start-index (1+ end-index))

(reverse (subseq dynamic-scale end-index (1+ start-index)))))

(expanded (loop for i from 0 below steps

collect (nth (floor (* (/ i steps) (length range))) range))))

expanded))

(defun build-omn-with-rests (pitches rhythms velocities articulations)

(flatten

(loop for p in pitches

for r in rhythms

for v in velocities

for a in articulations

collect (cond

((and (eq p 'r) r) (list r 'r))

((and p r v a) (list r p v a))))))

(defun introduce-rests (pitch-list probability)

(loop for p in pitch-list

collect (if (< (random 1.0) probability)

'r

p)))

;; --------- Common Settings ---------

(defparameter tempo 72)

(defparameter time-signature '(4 4))

(defparameter rest-probability 0.3)

;; --------- Flute Material ---------

(setf flute-pitches

(introduce-rests

(infinity-series 100 '(c4 cs4) :ambitus '(c4 c6))

rest-probability))

(setf flute-rhythms

(gen-repeat 25 '(q e e s)))

(setf flute-velocities

(make-crescendo 'pp 'ff 100))

(setf flute-articulations

(gen-repeat 25 '(stacc leg marc ten)))

(setf flute-omn

(build-omn-with-rests

flute-pitches

flute-rhythms

flute-velocities

flute-articulations))

;; --------- Oboe Material ---------

(setf oboe-pitches

(introduce-rests

(infinity-series 100 '(d4 ds4) :ambitus '(d4 d6))

rest-probability))

(setf oboe-rhythms

(gen-repeat 25 '(e e s q)))

(setf oboe-velocities

(make-crescendo 'pp 'ff 100))

(setf oboe-articulations

(gen-repeat 25 '(leg marc ten stacc)))

(setf oboe-omn

(build-omn-with-rests

oboe-pitches

oboe-rhythms

oboe-velocities

oboe-articulations))

;; --------- Clarinet Material ---------

(setf clarinet-pitches

(introduce-rests

(infinity-series 100 '(e4 f4) :ambitus '(e4 e6))

rest-probability))

(setf clarinet-rhythms

(gen-repeat 25 '(s q e e)))

(setf clarinet-velocities

(make-crescendo 'pp 'ff 100))

(setf clarinet-articulations

(gen-repeat 25 '(marc ten stacc leg)))

(setf clarinet-omn

(build-omn-with-rests

clarinet-pitches

clarinet-rhythms

clarinet-velocities

clarinet-articulations))

;; --------- Final Score (Playback + Export) ---------

(ps 'gm

:title "Infinity Series Trio - Final Version with Rests"

:time-signature time-signature

:tempo tempo

:inst '(flute oboe clarinet)

:fl (list flute-omn)

:ob (list oboe-omn)

:cl (list clarinet-omn))

There is a variable 'r inside your OMN — but what is it bound to? Within the OMN format, r doesn’t work as a proper length value; must be e replaced by a negative length value, otherwise you get an error...

=> (1/4 c4 pp stacc 1/8 r 1/8 c6 pp marc 1/16 d4 pp ten 1/4 cs4 pp stacc 1/8 c4 pp leg 1/8 b5 pp marc 1/16 eb4 pp ten 1/4 c6 pp stacc 1/8 r 1/8 r ...

When i replace the variable 'r by -1/4 it works...

=> (1/4 c4 pp stacc 1/8 -1/4 1/8 c6 pp marc 1/16 d4 pp ten 1/4 cs4 pp stacc 1/8 c4 pp leg 1/8 b5 pp marc 1/16 eb4 pp ten 1/4 c6 pp stacc 1/8 -1/4 1/8 -1/4 ...

(setf flute-omn
      (replace-map '((r -1/4))
                   (build-omn-with-rests
                    flute-pitches
                    flute-rhythms
                    flute-velocities
                    flute-articulations))

Personally, I wouldn’t use the variable "p", beause in the system it’s used for “piano” (which is why it’s highlighted in red). Also, it’s probably clearer and easier not to generate the OMN using a LOOP, but instead to use "make-omn". That way, you can also replace specific variables (like your 'r) more easily/more organized.

(make-omn :pitch
          :length
          :velocities
          :articulation 

greetings

andré

Create an account or sign in to comment


Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy