{ "patcher" : { "fileversion" : 1, "appversion" : { "major" : 6, "minor" : 0, "revision" : 8 } , "rect" : [ 915.0, 438.0, 838.0, 588.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, "default_fontface" : 0, "default_fontname" : "Arial", "gridonopen" : 0, "gridsize" : [ 15.0, 15.0 ], "gridsnaponopen" : 0, "statusbarvisible" : 2, "toolbarvisible" : 1, "boxanimatetime" : 200, "imprint" : 0, "enablehscroll" : 1, "enablevscroll" : 1, "devicewidth" : 0.0, "description" : "", "digest" : "", "tags" : "", "boxes" : [ { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-80", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 632.5, 329.5, 145.0, 74.0 ], "text" : "(Note that nothing in this patch allows us to hear this signal or equivalent MIDI notes, unlike the code on the left)" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-78", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 632.5, 259.5, 125.0, 33.0 ], "text" : "We use scope~ to visualize the signal" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-76", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 230.0, 285.0, 75.0, 20.0 ], "presentation_rect" : [ 258.5, 285.0, 0.0, 0.0 ], "text" : "MIDI note" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-75", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 85.0, 285.0, 90.0, 20.0 ], "presentation_rect" : [ 84.0, 289.0, 0.0, 0.0 ], "text" : "Note number" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-74", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 98.0, 225.0, 37.0, 33.0 ], "text" : "Turn\noff" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-72", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 60.0, 240.0, 32.5, 18.0 ], "text" : "0." } } , { "box" : { "id" : "obj-66", "maxclass" : "kslider", "numinlets" : 2, "numoutlets" : 2, "outlettype" : [ "int", "int" ], "parameter_enable" : 0, "patching_rect" : [ 435.0, 502.0, 336.0, 53.0 ], "presentation_rect" : [ 0.0, 0.0, 336.0, 53.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-65", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], "patching_rect" : [ 540.0, 184.5, 60.0, 20.0 ], "text" : "loadbang" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-64", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 675.0, 214.5, 32.5, 18.0 ], "text" : "128" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-62", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 625.0, 214.5, 32.5, 18.0 ], "text" : "5" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-60", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 540.0, 214.5, 85.0, 18.0 ], "text" : "range -1.5 1.5" } } , { "box" : { "calccount" : 5, "id" : "obj-58", "maxclass" : "scope~", "numinlets" : 2, "numoutlets" : 0, "patching_rect" : [ 480.0, 259.5, 130.0, 130.0 ], "range" : [ -1.5, 1.5 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-57", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 85.0, 510.0, 185.0, 47.0 ], "text" : "Remember that this has to be turned on for MSP commands anywhere in the patch to work" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-55", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 485.0, 135.0, 75.0, 20.0 ], "text" : "Frequency" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-53", "maxclass" : "flonum", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "float", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 435.0, 135.0, 50.0, 20.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-52", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "signal" ], "patching_rect" : [ 480.0, 184.5, 45.0, 20.0 ], "text" : "cycle~" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "format" : 4, "id" : "obj-50", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "int", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 632.5, 465.0, 50.0, 20.0 ], "presentation_rect" : [ 571.0, 405.0, 0.0, 0.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-49", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "int", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 480.0, 465.0, 50.0, 20.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-48", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 435.0, 420.0, 34.0, 20.0 ], "text" : "ftom" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-45", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 435.0, 90.0, 285.0, 33.0 ], "text" : "We can convert a signal frequency to a MIDI note number with the ftom object" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-43", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 173.5, 370.5, 87.0, 47.0 ], "text" : "Frequency that is used for cycle~ object" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-41", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 682.5, 465.0, 75.0, 20.0 ], "text" : "MIDI note" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-38", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 530.0, 465.0, 90.0, 20.0 ], "text" : "Note number" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "format" : 4, "id" : "obj-36", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "int", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 180.0, 285.0, 50.0, 20.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 11.595187, "id" : "obj-1", "maxclass" : "number~", "mode" : 2, "numinlets" : 2, "numoutlets" : 2, "outlettype" : [ "signal", "float" ], "patching_rect" : [ 90.0, 370.5, 82.0, 19.0 ], "sig" : 0.0 } } , { "box" : { "fontname" : "Arial", "fontsize" : 11.595187, "id" : "obj-5", "maxclass" : "number~", "mode" : 1, "numinlets" : 2, "numoutlets" : 2, "outlettype" : [ "signal", "float" ], "patching_rect" : [ 30.0, 285.0, 56.0, 19.0 ], "sig" : 50.0 } } , { "box" : { "hkeycolor" : [ 0.501961, 0.501961, 0.501961, 1.0 ], "id" : "obj-7", "maxclass" : "kslider", "numinlets" : 2, "numoutlets" : 2, "outlettype" : [ "int", "int" ], "parameter_enable" : 0, "patching_rect" : [ 30.0, 135.0, 336.0, 53.0 ], "presentation_rect" : [ 45.0, 45.0, 336.0, 53.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 11.595187, "id" : "obj-9", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "signal" ], "patching_rect" : [ 30.0, 315.0, 40.0, 19.0 ], "text" : "mtof~" } } , { "box" : { "fontname" : "Arial", "fontsize" : 11.595187, "id" : "obj-31", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "signal" ], "patching_rect" : [ 30.0, 370.5, 44.0, 19.0 ], "text" : "cycle~" } } , { "box" : { "fontname" : "Arial", "fontsize" : 11.595187, "id" : "obj-33", "maxclass" : "flonum", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "float", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 85.0, 437.0, 50.0, 19.0 ] } } , { "box" : { "id" : "obj-34", "local" : 1, "maxclass" : "ezdac~", "numinlets" : 2, "numoutlets" : 0, "patching_rect" : [ 30.0, 510.0, 45.0, 45.0 ], "varname" : "autohelp_dac" } } , { "box" : { "fontname" : "Arial", "fontsize" : 11.595187, "id" : "obj-35", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "signal" ], "patching_rect" : [ 30.0, 467.0, 74.0, 19.0 ], "text" : "*~ 0.2" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-4", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 90.0, 240.0, 33.0 ], "text" : "We can convert a MIDI pitch to a frequency at signal rate with the mtof~ object" } } , { "box" : { "bubble" : 1, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-2", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 15.0, 15.0, 315.0, 51.0 ], "text" : "Patch 065. Converting between MIDI and Audio\nWilliam J Turkel\nhttp://williamjturkel.net/code/#programming" } } , { "box" : { "bgcolor" : [ 1.0, 1.0, 1.0, 0.0 ], "border" : 1, "id" : "obj-3", "maxclass" : "panel", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 15.0, 77.0, 810.0, 495.0 ], "rounded" : 20 } } ], "lines" : [ { "patchline" : { "destination" : [ "obj-35", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-31", 0 ] } } , { "patchline" : { "destination" : [ "obj-35", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-33", 0 ] } } , { "patchline" : { "destination" : [ "obj-34", 1 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 39.5, 500.0, 65.5, 500.0 ], "source" : [ "obj-35", 0 ] } } , { "patchline" : { "destination" : [ "obj-34", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-35", 0 ] } } , { "patchline" : { "destination" : [ "obj-49", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 444.5, 450.0, 489.5, 450.0 ], "source" : [ "obj-48", 0 ] } } , { "patchline" : { "destination" : [ "obj-50", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 444.5, 445.0, 642.0, 445.0 ], "source" : [ "obj-48", 0 ] } } , { "patchline" : { "destination" : [ "obj-66", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-48", 0 ] } } , { "patchline" : { "destination" : [ "obj-9", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-5", 0 ] } } , { "patchline" : { "destination" : [ "obj-58", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-52", 0 ] } } , { "patchline" : { "destination" : [ "obj-48", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-53", 0 ] } } , { "patchline" : { "destination" : [ "obj-52", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-53", 0 ] } } , { "patchline" : { "destination" : [ "obj-58", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-60", 0 ] } } , { "patchline" : { "destination" : [ "obj-58", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-62", 0 ] } } , { "patchline" : { "destination" : [ "obj-58", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-64", 0 ] } } , { "patchline" : { "destination" : [ "obj-60", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-65", 0 ] } } , { "patchline" : { "destination" : [ "obj-62", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-65", 0 ] } } , { "patchline" : { "destination" : [ "obj-64", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-65", 0 ] } } , { "patchline" : { "destination" : [ "obj-36", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 39.5, 212.0, 189.5, 212.0 ], "source" : [ "obj-7", 0 ] } } , { "patchline" : { "destination" : [ "obj-5", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-7", 0 ] } } , { "patchline" : { "destination" : [ "obj-5", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-72", 0 ] } } , { "patchline" : { "destination" : [ "obj-1", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 39.5, 345.0, 99.5, 345.0 ], "source" : [ "obj-9", 0 ] } } , { "patchline" : { "destination" : [ "obj-31", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-9", 0 ] } } ], "dependency_cache" : [ ] } }