Jump to content

Featured Replies

Posted

Hi again!  :)

 

I am setting these pitches:

(setf pitchOnlyFirstCall '(bb5 bb5 bb5 bb5 gb5 db6 f6 eb6 bb5 eb5 ab5 gb5 db6 f6 eb6 bb5 eb5 ab5 eb5 eb5 eb5 eb5))

then I want to reverse and transpose down so I do this:

 

(setf leftHand   (pitch-transpose  'c0 (nreverse pitchOnlyFirstCall)) )

 

and the first time I evaluate the snippet I get what I want, the second time I evaluate the snippet I only get one note...

 

So, The helpfile says that nreverse 'destroys the argument', does that mean that the variable I just passed becomes unassigned and this is why I get only one note on second eval?

 

Is there a way to reverse a list without losing the original assignment? I guess I will have to have an intermediary assignment so I don't lose my original list?

 

Thanks!

Julio

 

 

 

 

 

The NREVERSE is destructive Lisp function and for other use.

What you are looking for is REVERSE or even bette (safer) the GEN-RETROGRADE function.

(setf leftHand (pitch-transpose 'c0 (gen-retrograde pitchOnlyFirstCall)))

 

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