diff --git a/SP_FYP.maxproj b/SP_FYP.maxproj index 6b160c7..3203df4 100644 --- a/SP_FYP.maxproj +++ b/SP_FYP.maxproj @@ -2,9 +2,9 @@ "name" : "SP_FYP", "version" : 1, "creationdate" : -771589673, - "modificationdate" : -771270425, + "modificationdate" : -770484043, "viewrect" : [ 25.0, 70.0, 300.0, 500.0 ], - "autoorganize" : 1, + "autoorganize" : 0, "hideprojectwindow" : 0, "showdependencies" : 1, "autolocalize" : 0, @@ -73,5 +73,9 @@ } , - "detailsvisible" : 0 + "detailsvisible" : 0, + "amxdtype" : 0, + "readonly" : 1, + "devpathtype" : 0, + "devpath" : "." } diff --git a/other/full_restart_project.sh b/other/full_restart_project.sh deleted file mode 100755 index c036a1c..0000000 --- a/other/full_restart_project.sh +++ /dev/null @@ -1,4 +0,0 @@ -osascript -e 'quit app "Max"' -while pgrep -u sam Max > /dev/null; do sleep 1; done -open -a /Applications/Max.app "/Users/sam/Documents/Projects/SP_FYP_MAX7/SP_FYP.maxproj" - diff --git a/other/synthesize_grains.py b/other/synthesize_grains.py index 011ee7a..170cb5a 100644 --- a/other/synthesize_grains.py +++ b/other/synthesize_grains.py @@ -1,23 +1,23 @@ -import scipy.signal as signal - +import sys +print sys.path try: import pyext except: print "ERROR: This script must be loaded by the PD/Max py/pyext external" +import scipy.signal as signal +import numpy as np +from pysound import AudioFile class SynthGrains(pyext._class): _inlets = 1 _outlets = 1 #def add_grain(targetBuffer, sourceBuffer, start, end): - def add_grain_1(self, buf1, buf2, src_start, src_end, tar_start, tar_end): + def add_grain_1(self, src_path, tar_path, src_start, src_end, tar_start, tar_end): """ Windows a grain of audio and adds to target buffer. """ - window = signal.hann(end - start) - - targetBuffer = pyext.Buffer(buf1) - sourceBuffer = pyext.Buffer(buf2) - print "done" + window = signal.hann(src_end - src_start) + print window.shape diff --git a/other/synthesize_grains.pyo b/other/synthesize_grains.pyo index 245a938..cb8218f 100644 Binary files a/other/synthesize_grains.pyo and b/other/synthesize_grains.pyo differ diff --git a/patchers/main.maxpat b/patchers/main.maxpat index 2c312b4..15edb26 100644 --- a/patchers/main.maxpat +++ b/patchers/main.maxpat @@ -9,7 +9,7 @@ "modernui" : 1 } , - "rect" : [ 34.0, 79.0, 1446.0, 902.0 ], + "rect" : [ 34.0, 79.0, 1312.0, 902.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -38,14 +38,180 @@ "subpatcher_template" : "", "boxes" : [ { "box" : { - "id" : "obj-152", + "id" : "obj-185", + "linecount" : 15, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 695.0, 1991.0, 165.0, 22.0 ], + "patching_rect" : [ 149.0, 2353.0, 50.0, 210.0 ], "style" : "", - "text" : "add_grain buffer1 buffer2 2 3" + "text" : "/Users/sam/.pyenv/shims/python /Users/sam/Documents/Projects/SP_FYP_MAX7/code/test.py 2>&1" + } + + } +, { + "box" : { + "id" : "obj-183", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 365.25, 2310.0, 82.0, 22.0 ], + "style" : "", + "text" : "append 2>&1" + } + + } +, { + "box" : { + "id" : "obj-182", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 381.25, 2400.0, 47.0, 22.0 ], + "style" : "", + "text" : "print te" + } + + } +, { + "box" : { + "id" : "obj-181", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "", "int" ], + "patching_rect" : [ 365.25, 2250.0, 135.0, 22.0 ], + "style" : "", + "text" : "conformpath slash boot" + } + + } +, { + "box" : { + "id" : "obj-180", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 365.25, 2280.0, 231.0, 22.0 ], + "style" : "", + "text" : "prepend /Users/sam/.pyenv/shims/python" + } + + } +, { + "box" : { + "annotation" : "Find the python file to run in the project", + "fontface" : 0, + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-179", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 5, + "outlettype" : [ "", "", "", "", "" ], + "patching_rect" : [ 326.25, 2220.0, 97.0, 21.0 ], + "style" : "", + "text" : "regexp .+/test.py" + } + + } +, { + "box" : { + "id" : "obj-178", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 330.0, 2400.0, 34.0, 22.0 ], + "style" : "", + "text" : "print" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-177", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 249.25, 2190.0, 96.0, 22.0 ], + "style" : "", + "text" : "route folder" + } + + } +, { + "box" : { + "id" : "obj-176", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "", "int" ], + "patching_rect" : [ 249.25, 2160.0, 89.0, 22.0 ], + "style" : "", + "text" : "recursivefolder" + } + + } +, { + "box" : { + "annotation" : "Get project path from this patcher's path (assumes this patcher is the main match in a subfolder or the project)", + "fontface" : 0, + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-175", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 5, + "outlettype" : [ "", "", "", "", "" ], + "patching_rect" : [ 234.0, 2130.0, 80.0, 21.0 ], + "style" : "", + "text" : "regexp (.+)/.+" + } + + } +, { + "box" : { + "id" : "obj-160", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 184.0, 2070.0, 34.0, 22.0 ], + "style" : "", + "text" : "path" + } + + } +, { + "box" : { + "id" : "obj-157", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 184.0, 2100.0, 69.0, 22.0 ], + "save" : [ "#N", "thispatcher", ";", "#Q", "end", ";" ], + "style" : "", + "text" : "thispatcher" + } + + } +, { + "box" : { + "id" : "obj-92", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 918.5, 443.5, 24.0, 24.0 ], + "style" : "" } } @@ -60,7 +226,7 @@ "numinlets" : 5, "numoutlets" : 6, "outlettype" : [ "float", "float", "float", "float", "list", "" ], - "patching_rect" : [ 1135.0, 2072.906006, 134.0, 48.594055 ], + "patching_rect" : [ 1520.0, 2189.203125, 134.0, 48.594055 ], "selectioncolor" : [ 0.313726, 0.498039, 0.807843, 0.0 ], "setunit" : 1, "style" : "", @@ -73,13 +239,14 @@ "fontname" : "Arial", "fontsize" : 13.0, "id" : "obj-102", + "linecount" : 3, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 1135.0, 2018.906006, 105.0, 23.0 ], + "patching_rect" : [ 1520.0, 2087.0, 383.0, 52.0 ], "style" : "", - "text" : "read rainstick.aif" + "text" : "read OSX:/Users/sam/AudioDatabases/IRCAMSamples_mono/scello.mono.aiff" } } @@ -92,7 +259,7 @@ "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "float", "bang" ], - "patching_rect" : [ 1135.0, 2043.202881, 88.0, 22.0 ], + "patching_rect" : [ 1520.0, 2159.5, 88.0, 22.0 ], "style" : "", "text" : "buffer~ buffer2" } @@ -107,9 +274,9 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 990.0, 2018.906006, 119.0, 23.0 ], + "patching_rect" : [ 1375.0, 2033.0, 488.0, 23.0 ], "style" : "", - "text" : "read drumLoop.aif" + "text" : "read OSX:/Users/sam/AudioDatabases/IRCAMSamples_mono/sbassoon.mono.aiff" } } @@ -124,7 +291,7 @@ "numinlets" : 5, "numoutlets" : 6, "outlettype" : [ "float", "float", "float", "float", "list", "" ], - "patching_rect" : [ 990.0, 2072.906006, 134.0, 48.594055 ], + "patching_rect" : [ 1375.0, 2189.203125, 134.0, 48.594055 ], "selectioncolor" : [ 0.313726, 0.498039, 0.807843, 0.0 ], "setunit" : 1, "style" : "", @@ -141,140 +308,11 @@ "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "float", "bang" ], - "patching_rect" : [ 990.0, 2043.202881, 88.0, 22.0 ], + "patching_rect" : [ 1375.0, 2159.5, 88.0, 22.0 ], "style" : "", "text" : "buffer~ buffer1" } - } -, { - "box" : { - "id" : "obj-97", - "maxclass" : "message", - "numinlets" : 2, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 328.445099, 2001.0, 47.0, 22.0 ], - "style" : "", - "text" : "reload." - } - - } -, { - "box" : { - "id" : "obj-76", - "maxclass" : "newobj", - "numinlets" : 2, - "numoutlets" : 2, - "outlettype" : [ "", "" ], - "patching_rect" : [ 217.872604, 2046.0, 29.5, 22.0 ], - "style" : "", - "text" : "py" - } - - } -, { - "box" : { - "fontname" : "Arial", - "fontsize" : 12.0, - "id" : "obj-145", - "linecount" : 2, - "maxclass" : "message", - "numinlets" : 2, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 658.445068, 2086.5, 50.0, 35.0 ], - "style" : "", - "text" : "response 1" - } - - } -, { - "box" : { - "fontname" : "Arial", - "fontsize" : 12.0, - "id" : "obj-142", - "maxclass" : "message", - "numinlets" : 2, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 340.445099, 2117.5, 50.0, 22.0 ], - "style" : "", - "text" : "240" - } - - } -, { - "box" : { - "fontface" : 0, - "fontname" : "Arial", - "fontsize" : 12.0, - "id" : "obj-4", - "maxclass" : "newobj", - "numinlets" : 2, - "numoutlets" : 2, - "outlettype" : [ "", "" ], - "patching_rect" : [ 407.945099, 2060.0, 208.0, 22.0 ], - "style" : "", - "text" : "pyext synthesize_grains SynthGrains" - } - - } -, { - "box" : { - "fontname" : "Arial", - "fontsize" : 12.0, - "id" : "obj-104", - "maxclass" : "message", - "numinlets" : 2, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 750.0, 1911.0, 33.0, 22.0 ], - "style" : "", - "text" : "pwd" - } - - } -, { - "box" : { - "fontname" : "Arial", - "fontsize" : 12.0, - "id" : "obj-101", - "maxclass" : "newobj", - "numinlets" : 1, - "numoutlets" : 0, - "patching_rect" : [ 785.0, 2060.0, 34.0, 22.0 ], - "style" : "", - "text" : "print" - } - - } -, { - "box" : { - "id" : "obj-100", - "maxclass" : "button", - "numinlets" : 1, - "numoutlets" : 1, - "outlettype" : [ "bang" ], - "patching_rect" : [ 871.0, 2024.0, 20.0, 20.0 ], - "style" : "" - } - - } -, { - "box" : { - "fontname" : "Arial", - "fontsize" : 12.0, - "id" : "obj-87", - "maxclass" : "message", - "numinlets" : 2, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 811.0, 1909.0, 337.0, 22.0 ], - "style" : "", - "text" : "python /Users/sam/Documents/Projects/SP_FYP/code/run.py" - } - } , { "box" : { @@ -285,7 +323,7 @@ "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], - "patching_rect" : [ 811.0, 1949.0, 35.0, 22.0 ], + "patching_rect" : [ 365.25, 2340.0, 35.0, 22.0 ], "style" : "", "text" : "shell" } @@ -1219,7 +1257,7 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 934.945068, 1505.400879, 139.0, 22.0 ], + "patching_rect" : [ 932.945068, 1505.400879, 139.0, 22.0 ], "style" : "", "text" : "print source_descriptors" } @@ -2553,15 +2591,6 @@ "source" : [ "obj-103", 1 ] } - } -, { - "patchline" : { - "destination" : [ "obj-35", 0 ], - "disabled" : 0, - "hidden" : 0, - "source" : [ "obj-104", 0 ] - } - } , { "patchline" : { @@ -3016,15 +3045,6 @@ "source" : [ "obj-148", 0 ] } - } -, { - "patchline" : { - "destination" : [ "obj-4", 1 ], - "disabled" : 0, - "hidden" : 0, - "source" : [ "obj-152", 0 ] - } - } , { "patchline" : { @@ -3044,6 +3064,15 @@ "source" : [ "obj-156", 1 ] } + } +, { + "patchline" : { + "destination" : [ "obj-175", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-157", 1 ] + } + } , { "patchline" : { @@ -3062,6 +3091,51 @@ "source" : [ "obj-16", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-157", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-160", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-176", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-175", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-177", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-176", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-179", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-177", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-181", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-179", 2 ] + } + } , { "patchline" : { @@ -3071,6 +3145,42 @@ "source" : [ "obj-18", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-183", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-180", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-180", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-181", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-185", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-183", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-35", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-183", 0 ] + } + } , { "patchline" : { @@ -3307,19 +3417,19 @@ } , { "patchline" : { - "destination" : [ "obj-100", 0 ], + "destination" : [ "obj-178", 0 ], "disabled" : 0, "hidden" : 0, - "source" : [ "obj-35", 1 ] + "source" : [ "obj-35", 0 ] } } , { "patchline" : { - "destination" : [ "obj-101", 0 ], + "destination" : [ "obj-182", 0 ], "disabled" : 0, "hidden" : 0, - "source" : [ "obj-35", 0 ] + "source" : [ "obj-35", 1 ] } } @@ -3342,15 +3452,6 @@ "source" : [ "obj-38", 0 ] } - } -, { - "patchline" : { - "destination" : [ "obj-142", 1 ], - "disabled" : 0, - "hidden" : 0, - "source" : [ "obj-4", 0 ] - } - } , { "patchline" : { @@ -3749,15 +3850,6 @@ "source" : [ "obj-86", 1 ] } - } -, { - "patchline" : { - "destination" : [ "obj-35", 0 ], - "disabled" : 0, - "hidden" : 0, - "source" : [ "obj-87", 0 ] - } - } , { "patchline" : { @@ -3913,15 +4005,6 @@ "source" : [ "obj-95", 2 ] } - } -, { - "patchline" : { - "destination" : [ "obj-4", 0 ], - "disabled" : 0, - "hidden" : 0, - "source" : [ "obj-97", 0 ] - } - } , { "patchline" : { @@ -4020,10 +4103,6 @@ "name" : "shell.mxo", "type" : "iLaX" } -, { - "name" : "py.mxo", - "type" : "iLaX" - } ], "embedsnapshot" : 0 }