Browse Source

add randomness in sequenz function + add build cleaning script

Noah Vogt 4 years ago
parent
commit
e9a43a0377
3 changed files with 8 additions and 3 deletions
  1. 5 0
      src/clean
  2. 2 2
      src/thema-extender
  3. 1 1
      src/thema-gen

+ 5 - 0
src/clean

@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# script to clean the temporary files generated by song-gen
+
+rm ./motiv-A ./motiv-B ./temp-file-1 temp-file-2 || exit 1

+ 2 - 2
src/thema-extender

@@ -27,7 +27,7 @@ try:
         raise ValueError("Number was too small (below 1)")
 except (IndexError, ValueError):
     # set fallback value if no or wrong arguments given
-    length = 2
+    length = 1
 
 gizmo_write2file(motiv_list, 'temp-file-1')
 os.system("python src/thema-gen < temp-file-1")
@@ -39,7 +39,7 @@ for j in range (length):
         function_list = [
             "verkleinerung(motiv_list)",
             "krebs(motiv_list)",
-            "sequenz(motiv_list, 5)",
+            "sequenz(motiv_list, {})".format(random.randint(3,12)),
             "mirror_pitch(motiv_list)",
             "mirror_rythm(motiv_list)",
             ]

+ 1 - 1
src/thema-gen

@@ -72,7 +72,7 @@ function_list = [
     "krebs(motiv_list)",
     "vergrösserung(motiv_list)",
     "motiv_list",
-    "sequenz(motiv_list, 5)",
+    "sequenz(motiv_list, {})".format(random.randint(3,12)),
     "mirror_pitch(motiv_list)",
     "mirror_rythm(motiv_list)"
     ]