{ "patcher" : { "fileversion" : 1, "appversion" : { "major" : 6, "minor" : 0, "revision" : 8 } , "rect" : [ 946.0, 240.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-55", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 480.0, 255.0, 315.0, 60.0 ], "text" : "Try setting the two frequencies that are being summed very close together (e.g., 440 and 442). As the two waves interfere with one another, the amplitude of the output fluctuates, resulting in perceptible \"beats.\"" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-53", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 405.0, 510.0, 390.0, 47.0 ], "text" : "Displaying the frequency axis with a linear scale in the spectrogram makes it easier to see the frequencies of the different signals that make up the sound that we hear." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-51", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 465.0, 330.0, 56.0, 18.0 ], "text" : "logfreq 1" } } , { "box" : { "id" : "obj-50", "logfreq" : 1, "maxclass" : "spectroscope~", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 405.0, 360.0, 390.0, 130.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-49", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "signal" ], "patching_rect" : [ 405.0, 285.0, 42.0, 20.0 ], "text" : "*~ 0.5" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-48", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "signal" ], "patching_rect" : [ 405.0, 255.0, 32.5, 20.0 ], "text" : "+~" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-47", "maxclass" : "flonum", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "float", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 465.0, 180.0, 50.0, 20.0 ], "presentation_rect" : [ 451.0, 181.0, 0.0, 0.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-46", "maxclass" : "flonum", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "float", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 405.0, 180.0, 50.0, 20.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-44", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "signal" ], "patching_rect" : [ 465.0, 220.0, 45.0, 20.0 ], "presentation_rect" : [ 453.0, 221.0, 0.0, 0.0 ], "text" : "cycle~" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-43", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "signal" ], "patching_rect" : [ 405.0, 220.0, 45.0, 20.0 ], "text" : "cycle~" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-42", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 525.0, 166.5, 270.0, 74.0 ], "text" : "MSP has a number of operators that let us combine multiple signals in various ways. Here we add two signals together, then divide the output by two (to bring it back into an appropriate range)." } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-40", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 45.0, 240.0, 90.0, 47.0 ], "text" : " Off\n Single Wave\nSummed Wave" } } , { "box" : { "disabled" : [ 0, 0, 0 ], "id" : "obj-38", "itemtype" : 0, "maxclass" : "radiogroup", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], "parameter_enable" : 0, "patching_rect" : [ 135.0, 240.0, 18.0, 50.0 ], "size" : 3, "value" : 2 } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-37", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 212.375, 270.0, 127.25, 47.0 ], "text" : "The selector~ object lets us choose among input signals" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-35", "maxclass" : "newobj", "numinlets" : 3, "numoutlets" : 1, "outlettype" : [ "signal" ], "patching_rect" : [ 135.0, 300.0, 70.0, 20.0 ], "text" : "selector~ 2" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-32", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 507.0, 90.0, 47.0 ], "text" : "Turn sound on and off with ezdac~ button" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-30", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 135.0, 345.0, 33.0 ], "text" : "440 Hz (also known as A440) is the note A above middle C. It is a standard for tuning instruments." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-28", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 180.0, 195.0, 47.0 ], "text" : "The cycle~ object is a sinusoidal oscillator. It creates a periodic wave of a given frequency." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-26", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 197.5, 507.0, 142.125, 47.0 ], "text" : "The scope~ parameters allow us to see the wave form" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-24", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 405.0, 90.0, 390.0, 60.0 ], "text" : "People can hear sounds with frequencies between about 20 and 20000 Hz (cycles per second). We are most sensitive to frequencies in the middle of that range (note that the volume on the gain~ slider has to be turned for 110 Hz than for 440 Hz to get the same subjective intensity)." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-22", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 341.0, 180.0, 34.0, 18.0 ], "presentation_rect" : [ 128.0, 149.0, 0.0, 0.0 ], "text" : "880." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-21", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 307.0, 180.0, 34.0, 18.0 ], "presentation_rect" : [ 99.0, 151.0, 0.0, 0.0 ], "text" : "440." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-20", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 273.0, 180.0, 34.0, 18.0 ], "presentation_rect" : [ 63.0, 149.0, 0.0, 0.0 ], "text" : "220." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-19", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 240.0, 180.0, 33.0, 18.0 ], "text" : "110." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-15", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 287.0, 330.0, 32.5, 18.0 ], "text" : "5" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-13", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 319.5, 330.0, 32.5, 18.0 ], "text" : "128" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-11", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 202.0, 330.0, 85.0, 18.0 ], "text" : "range -1.5 1.5" } } , { "box" : { "calccount" : 5, "id" : "obj-9", "maxclass" : "scope~", "numinlets" : 2, "numoutlets" : 0, "patching_rect" : [ 197.5, 360.0, 130.0, 130.0 ], "range" : [ -1.5, 1.5 ] } } , { "box" : { "id" : "obj-8", "maxclass" : "ezdac~", "numinlets" : 2, "numoutlets" : 0, "patching_rect" : [ 135.0, 507.0, 45.0, 45.0 ] } } , { "box" : { "id" : "obj-7", "maxclass" : "gain~", "numinlets" : 2, "numoutlets" : 2, "outlettype" : [ "signal", "int" ], "parameter_enable" : 0, "patching_rect" : [ 135.0, 360.0, 30.0, 130.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-1", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "signal" ], "patching_rect" : [ 240.0, 220.0, 72.0, 20.0 ], "text" : "cycle~ 440." } } , { "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, 345.0, 33.0 ], "text" : "We hear sinusoidal waves as tones. The higher the frequency of the wave, the higher pitched it sounds." } } , { "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, 360.0, 51.0 ], "text" : "Patch 062. Sinusoidal Waves\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, 75.0, 810.0, 495.0 ], "rounded" : 20 } } ], "lines" : [ { "patchline" : { "destination" : [ "obj-35", 1 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 249.5, 248.0, 170.0, 248.0 ], "source" : [ "obj-1", 0 ] } } , { "patchline" : { "destination" : [ "obj-9", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-11", 0 ] } } , { "patchline" : { "destination" : [ "obj-9", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 0 ] } } , { "patchline" : { "destination" : [ "obj-9", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-15", 0 ] } } , { "patchline" : { "destination" : [ "obj-1", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-19", 0 ] } } , { "patchline" : { "destination" : [ "obj-1", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-20", 0 ] } } , { "patchline" : { "destination" : [ "obj-1", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-21", 0 ] } } , { "patchline" : { "destination" : [ "obj-1", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-22", 0 ] } } , { "patchline" : { "destination" : [ "obj-50", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 144.5, 330.0, 198.0, 330.0, 198.0, 323.0, 414.5, 323.0 ], "source" : [ "obj-35", 0 ] } } , { "patchline" : { "destination" : [ "obj-7", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-35", 0 ] } } , { "patchline" : { "destination" : [ "obj-9", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 144.5, 345.0, 183.0, 345.0, 183.0, 357.0, 207.0, 357.0 ], "source" : [ "obj-35", 0 ] } } , { "patchline" : { "destination" : [ "obj-35", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-38", 0 ] } } , { "patchline" : { "destination" : [ "obj-48", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-43", 0 ] } } , { "patchline" : { "destination" : [ "obj-48", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-44", 0 ] } } , { "patchline" : { "destination" : [ "obj-43", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-46", 0 ] } } , { "patchline" : { "destination" : [ "obj-44", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-47", 0 ] } } , { "patchline" : { "destination" : [ "obj-49", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-48", 0 ] } } , { "patchline" : { "destination" : [ "obj-35", 2 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 414.5, 313.0, 351.0, 313.0, 351.0, 255.0, 195.5, 255.0 ], "source" : [ "obj-49", 0 ] } } , { "patchline" : { "destination" : [ "obj-50", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-51", 0 ] } } , { "patchline" : { "destination" : [ "obj-8", 1 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 144.5, 501.0, 170.5, 501.0 ], "source" : [ "obj-7", 0 ] } } , { "patchline" : { "destination" : [ "obj-8", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-7", 0 ] } } ], "dependency_cache" : [ ] } }