Jump to content
Sign in to follow this  


Recommended Posts

...how ti filter all "unused/complementary" pitches inside a sieve (if you like to extend the function... could be interesting if it works also with chords)


(defun neg-sieve (pitchlist)
  (let ((pitchlist (pitch-to-midi pitchlist)))
     (loop for i from (car pitchlist) to (car (last pitchlist))
       when (null (member i pitchlist))
       collect i))))

(setf sieve '(fs3 g3 as3 b3 c4 cs4 ds4 e4 f4 gs4 a4 d5 eb5 fs5 g5 gs5 bb5 b5 c6 cs6 e6 f6))

(neg-sieve sieve) 
=> (gs3 a3 d4 fs4 g4 bb4 b4 c5 cs5 e5 f5 a5 d6 eb6)

(neg-sieve '(c4 d4 e4 fs4 gs4 as4 c5))
=> (cs4 eb4 f4 g4 a4 b4)




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this