julio d'escrivan Posted March 11, 2016 Posted March 11, 2016 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 Quote
opmo Posted March 11, 2016 Posted March 11, 2016 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))) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.