From 8e1e114af6e32c52d82a9f3979dd8fca6281ae3a Mon Sep 17 00:00:00 2001
From: Lorenz Lehmann <lorenz.lehmann@students.muho-mannheim.de>
Date: Sun, 10 Dec 2023 16:58:12 +0100
Subject: [PATCH] fix(sources): allot pitches to empty instruments

---
 sources/gen-harmonies.lisp |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/sources/gen-harmonies.lisp b/sources/gen-harmonies.lisp
index 5798601..b66df42 100644
--- a/sources/gen-harmonies.lisp
+++ b/sources/gen-harmonies.lisp
@@ -159,16 +159,17 @@
                                                           (loop for reg in (variations_oml register-list (length a))
                                                                 collect (mapcar #'(lambda (r p) (+ r p)) reg a))) 1) :test 'equal))
        (instr-list2  (remove nil (list instr1 instr2 instr3 instr4)))
-       (harmon-database (loop for a in harmon-database
+       (instr-list2  (list instr1 instr2 instr3 instr4))
+       (harmon-database (remove -1 (loop for a in harmon-database
                               collect (loop for p in a
-                                            for count to (1- (length instr-list2))
+                                            for c to (1- (length instr-list2))
 
-                                            collect (if (or (< p  (car (nth count instr-list2)))
-                                                            (> p (cadr (nth count instr-list2)))) nil p))))
+                                            collect (if (nth c instr-list2) (if (or (< p  (car (nth c instr-list2)))
+                                                            (> p (cadr (nth c instr-list2)))) nil p) -1)) )))
        (harmon-database (remove nil (loop for a in harmon-database
-                                          collect (if (> (count nil a) 0) nil a)))))
-harmon-database))
+                                          collect (if (> (count nil a) 0) nil a))))
 
+harmon-database))
 
 
 

--
Gitblit v1.9.1