Reading from buffer~ and DSP question about sample rate/vector size
Greetings! (my first post in here,...)
Some confusion with how the buffer~ object works as well as the relationship between sample rate, vector size etc:
If I write in exactly 512 values into a stereo.aiff file and want to read it back via wave~ plus phasor~ , how can I calculate the length in milliseconds (or samples) of this buffer? For example if phasor~ is going at 1Hz this should mean the buffer of 512 plays through once in a second? But in fact when I do this I only hear the sound at the beginning of the second as a click. The wave~ object allows one to set the start and end point of what should be read - at the moment I have that set as reading from 0. to 12. simply because the visual wave looks correct but I wish I knew how to calculate this. Does the vector size, sampling rate or other factors have anything to do with it? Are these 512 values actually one sample each?
Also is there a way that I can convert the signal back to numbers and 'draw' the signal (similar to building my own oscilloscope without using scope~). [In the long run I'd like to research a microscopic relationship between sound and visual].
Thanks for clarifying any part of the question!
----------begin_max5_patcher----------
{
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 5,
"minor" : 1,
"revision" : 9
}
,
"rect" : [ 97.0, 44.0, 862.0, 779.0 ],
"bglocked" : 0,
"defrect" : [ 97.0, 44.0, 862.0, 779.0 ],
"openrect" : [ 0.0, 0.0, 0.0, 0.0 ],
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 0,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 0,
"toolbarvisible" : 1,
"boxanimatetime" : 200,
"imprint" : 0,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"boxes" : [ {
"box" : {
"maxclass" : "number",
"numinlets" : 1,
"fontname" : "Palatino Linotype",
"patching_rect" : [ 90.089966, 237.209961, 50.0, 23.0 ],
"numoutlets" : 2,
"id" : "obj-5",
"outlettype" : [ "int", "bang" ],
"fontsize" : 12.0,
"presentation_rect" : [ 90.089966, 237.209961, 0.0, 0.0 ]
}
}
, {
"box" : {
"maxclass" : "flonum",
"numinlets" : 1,
"fontname" : "Arial",
"patching_rect" : [ 181.0, 321.0, 50.0, 20.0 ],
"numoutlets" : 2,
"id" : "obj-4",
"outlettype" : [ "float", "bang" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "number~",
"mode" : 2,
"numinlets" : 2,
"fontname" : "Arial",
"patching_rect" : [ 418.0, 374.0, 116.0, 20.0 ],
"numoutlets" : 2,
"id" : "obj-22",
"interval" : 250.0,
"outlettype" : [ "signal", "float" ],
"fontsize" : 11.595187,
"sig" : 0.0
}
}
, {
"box" : {
"maxclass" : "number~",
"mode" : 2,
"numinlets" : 2,
"fontname" : "Arial",
"patching_rect" : [ 271.0, 375.0, 113.0, 20.0 ],
"numoutlets" : 2,
"id" : "obj-14",
"interval" : 250.0,
"outlettype" : [ "signal", "float" ],
"fontsize" : 11.595187,
"sig" : 0.0
}
}
, {
"box" : {
"maxclass" : "ezdac~",
"numinlets" : 2,
"patching_rect" : [ 215.799988, 646.099976, 45.0, 45.0 ],
"numoutlets" : 0,
"id" : "obj-55"
}
}
, {
"box" : {
"maxclass" : "number",
"numinlets" : 1,
"fontname" : "Palatino Linotype",
"patching_rect" : [ 353.089966, 273.209961, 50.0, 23.0 ],
"numoutlets" : 2,
"id" : "obj-13",
"outlettype" : [ "int", "bang" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "gain~",
"numinlets" : 2,
"patching_rect" : [ 223.539978, 458.71994, 39.0, 122.0 ],
"numoutlets" : 2,
"id" : "obj-12",
"outlettype" : [ "signal", "int" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "wave~ stereocontrol 0. 12. 2",
"numinlets" : 3,
"fontname" : "Palatino Linotype",
"patching_rect" : [ 343.76001, 336.749969, 180.0, 25.0 ],
"numoutlets" : 2,
"id" : "obj-11",
"outlettype" : [ "signal", "signal" ],
"fontsize" : 14.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "phasor~ 1.",
"numinlets" : 2,
"fontname" : "Palatino Linotype",
"patching_rect" : [ 354.299988, 302.849976, 74.0, 25.0 ],
"numoutlets" : 1,
"id" : "obj-10",
"outlettype" : [ "signal" ],
"fontsize" : 14.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "scale 0. 1 -1. 1.",
"numinlets" : 6,
"fontname" : "Arial",
"patching_rect" : [ 478.950012, 206.880005, 93.0, 20.0 ],
"numoutlets" : 1,
"id" : "obj-70",
"outlettype" : [ "" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "peek~ stereocontrol 2",
"numinlets" : 3,
"fontname" : "Palatino Linotype",
"patching_rect" : [ 480.160034, 281.490021, 142.0, 25.0 ],
"numoutlets" : 1,
"id" : "obj-15",
"outlettype" : [ "float" ],
"fontsize" : 14.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "unpack 0 0.",
"numinlets" : 1,
"fontname" : "Palatino Linotype",
"patching_rect" : [ 480.160034, 255.220001, 82.0, 25.0 ],
"numoutlets" : 2,
"id" : "obj-16",
"outlettype" : [ "int", "float" ],
"fontsize" : 14.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "listfunnel",
"numinlets" : 1,
"fontname" : "Palatino Linotype",
"patching_rect" : [ 480.160034, 230.319992, 70.0, 25.0 ],
"numoutlets" : 1,
"id" : "obj-18",
"outlettype" : [ "list" ],
"fontsize" : 14.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "scale 0. 1 -1. 1.",
"numinlets" : 6,
"fontname" : "Arial",
"patching_rect" : [ 185.0, 207.720001, 93.0, 20.0 ],
"numoutlets" : 1,
"id" : "obj-69",
"outlettype" : [ "" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "peek~ stereocontrol",
"numinlets" : 3,
"fontname" : "Palatino Linotype",
"patching_rect" : [ 186.842957, 285.136017, 132.0, 25.0 ],
"numoutlets" : 1,
"id" : "obj-7",
"outlettype" : [ "float" ],
"fontsize" : 14.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "unpack 0 0.",
"numinlets" : 1,
"fontname" : "Palatino Linotype",
"patching_rect" : [ 186.842957, 254.350037, 82.0, 25.0 ],
"numoutlets" : 2,
"id" : "obj-6",
"outlettype" : [ "int", "float" ],
"fontsize" : 14.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "listfunnel",
"numinlets" : 1,
"fontname" : "Palatino Linotype",
"patching_rect" : [ 186.842957, 230.660004, 70.0, 25.0 ],
"numoutlets" : 1,
"id" : "obj-1",
"outlettype" : [ "list" ],
"fontsize" : 14.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "loadbang",
"numinlets" : 1,
"fontname" : "Arial",
"patching_rect" : [ 28.0, -307.0, 56.0, 20.0 ],
"numoutlets" : 1,
"id" : "obj-3",
"outlettype" : [ "bang" ],
"fontsize" : 11.595187,
"hidden" : 1
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "BUFFER LEFT CHANNEL",
"numinlets" : 1,
"fontname" : "Arial",
"patching_rect" : [ 211.23999, 46.209999, 189.929993, 20.0 ],
"numoutlets" : 0,
"id" : "obj-73",
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "BUFFER RIGHT CHANNEL",
"numinlets" : 1,
"fontname" : "Arial",
"patching_rect" : [ 504.059937, 46.209999, 189.929993, 20.0 ],
"numoutlets" : 0,
"id" : "obj-72",
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.007812 0.015625 0.023438 0.03125 0.039062 0.046875 0.054688 0.0625 0.070312 0.078125 0.085938 0.09375 0.101562 0.109375 0.117188 0.125 0.132812 0.140625 0.148438 0.15625 0.164062 0.171875 0.179688 0.1875 0.195312 0.203125 0.210938 0.21875 0.226562 0.234375 0.242188 0.25 0.257812 0.265625 0.273438 0.28125 0.289062 0.296875 0.304688 0.3125 0.320312 0.328125 0.335938 0.34375 0.351562 0.359375 0.367188 0.375 0.382812 0.390625 0.398438 0.40625 0.414062 0.421875 0.429688 0.4375 0.445312 0.453125 0.460938 0.46875 0.476562 0.484375 0.492188 0.5 0.507812 0.515625 0.523438 0.53125 0.539062 0.546875 0.554688 0.5625 0.570312 0.578125 0.585938 0.59375 0.601562 0.609375 0.617188 0.625 0.632812 0.640625 0.648438 0.65625 0.664062 0.671875 0.679688 0.6875 0.695312 0.703125 0.710938 0.71875 0.726562 0.734375 0.742188 0.75 0.757812 0.765625 0.773438 0.78125 0.789062 0.796875 0.804688 0.8125 0.820312 0.828125 0.835938 0.84375 0.851562 0.859375 0.867188 0.875 0.882812 0.890625 0.898438 0.90625 0.914062 0.921875 0.929688 0.9375 0.945312 0.953125 0.960938 0.96875 0.976562 0.984375 0.992188 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 0.992188 0.984376 0.976564 0.968752 0.96094 0.953128 0.945316 0.937504 0.929692 0.92188 0.914068 0.906256 0.898444 0.890632 0.88282 0.875008 0.867196 0.859384 0.851572 0.84376 0.835948 0.828136 0.820324 0.812512 0.8047 0.796888 0.789076 0.781264 0.773452 0.76564 0.757828 0.750016 0.742204 0.734392 0.72658 0.718768 0.710956 0.703144 0.695332 0.68752 0.679708 0.671896 0.664084 0.656272 0.64846 0.640648 0.632836 0.625024 0.617212 0.6094 0.601588 0.593776 0.585964 0.578152 0.57034 0.562528 0.554716 0.546904 0.539092 0.53128 0.523468 0.515656 0.507844 0.500032 0.49222 0.484408 0.476596 0.468784 0.460972 0.45316 0.445348 0.437536 0.429724 0.421912 0.4141 0.406288 0.398476 0.390664 0.382852 0.37504 0.367228 0.359416 0.351604 0.343792 0.33598 0.328168 0.320356 0.312544 0.304732 0.29692 0.289108 0.281296 0.273484 0.265672 0.25786 0.250048 0.242236 0.234424 0.226611 0.218799 0.210987 0.203175 0.195363 0.187551 0.179739 0.171927 0.164115 0.156303 0.148491 0.140679 0.132867 0.125055 0.117243 0.109431 0.101619 0.093807 0.085995 0.078183 0.070371 0.062559 0.054747 0.046935 0.039123 0.031311 0.023499 0.015687 0.007875 0.000063",
"linecount" : 34,
"numinlets" : 2,
"fontname" : "Arial",
"patching_rect" : [ 445.7901, -284.329956, 352.0, 317.0 ],
"numoutlets" : 1,
"id" : "obj-66",
"outlettype" : [ "" ],
"fontsize" : 8.0,
"hidden" : 1
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "0.007812 0.015625 0.023438 0.03125 0.039062 0.046875 0.054688 0.0625 0.070312 0.078125 0.085938 0.09375 0.101562 0.109375 0.117188 0.125 0.132812 0.140625 0.148438 0.15625 0.164062 0.171875 0.179688 0.1875 0.195312 0.203125 0.210938 0.21875 0.226562 0.234375 0.242188 0.25 0.257812 0.265625 0.273438 0.28125 0.289062 0.296875 0.304688 0.3125 0.320312 0.328125 0.335938 0.34375 0.351562 0.359375 0.367188 0.375 0.382812 0.390625 0.398438 0.40625 0.414062 0.421875 0.429688 0.4375 0.445312 0.453125 0.460938 0.46875 0.476562 0.484375 0.492188 0.5 0.507812 0.515625 0.523438 0.53125 0.539062 0.546875 0.554688 0.5625 0.570312 0.578125 0.585938 0.59375 0.601562 0.609375 0.617188 0.625 0.632812 0.640625 0.648438 0.65625 0.664062 0.671875 0.679688 0.6875 0.695312 0.703125 0.710938 0.71875 0.726562 0.734375 0.742188 0.75 0.757812 0.765625 0.773438 0.78125 0.789062 0.796875 0.804688 0.8125 0.820312 0.828125 0.835938 0.84375 0.851562 0.859375 0.867188 0.875 0.882812 0.890625 0.898438 0.90625 0.914062 0.921875 0.929688 0.9375 0.945312 0.953125 0.960938 0.96875 0.976562 0.984375 0.992188 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 0.992188 0.984376 0.976564 0.968752 0.96094 0.953128 0.945316 0.937504 0.929692 0.92188 0.914068 0.906256 0.898444 0.890632 0.88282 0.875008 0.867196 0.859384 0.851572 0.84376 0.835948 0.828136 0.820324 0.812512 0.8047 0.796888 0.789076 0.781264 0.773452 0.76564 0.757828 0.750016 0.742204 0.734392 0.72658 0.718768 0.710956 0.703144 0.695332 0.68752 0.679708 0.671896 0.664084 0.656272 0.64846 0.640648 0.632836 0.625024 0.617212 0.6094 0.601588 0.593776 0.585964 0.578152 0.57034 0.562528 0.554716 0.546904 0.539092 0.53128 0.523468 0.515656 0.507844 0.500032 0.49222 0.484408 0.476596 0.468784 0.460972 0.45316 0.445348 0.437536 0.429724 0.421912 0.4141 0.406288 0.398476 0.390664 0.382852 0.37504 0.367228 0.359416 0.351604 0.343792 0.33598 0.328168 0.320356 0.312544 0.304732 0.29692 0.289108 0.281296 0.273484 0.265672 0.25786 0.250048 0.242236 0.234424 0.226611 0.218799 0.210987 0.203175 0.195363 0.187551 0.179739 0.171927 0.164115 0.156303 0.148491 0.140679 0.132867 0.125055 0.117243 0.109431 0.101619 0.093807 0.085995 0.078183 0.070371 0.062559 0.054747 0.046935 0.039123 0.031311 0.023499 0.015687 0.007875 0.000063 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.",
"linecount" : 34,
"numinlets" : 2,
"fontname" : "Arial",
"patching_rect" : [ 86.420074, -285.539978, 351.0, 317.0 ],
"numoutlets" : 1,
"id" : "obj-65",
"outlettype" : [ "" ],
"fontsize" : 8.0,
"hidden" : 1
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "read",
"numinlets" : 2,
"fontname" : "Arial",
"patching_rect" : [ -27.410034, 114.439972, 35.0, 18.0 ],
"numoutlets" : 1,
"id" : "obj-20",
"outlettype" : [ "" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "write",
"numinlets" : 2,
"fontname" : "Arial",
"patching_rect" : [ -44.76001, 92.730011, 36.0, 18.0 ],
"numoutlets" : 1,
"id" : "obj-19",
"outlettype" : [ "" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "multislider",
"numinlets" : 1,
"patching_rect" : [ 477.945007, 72.863945, 267.0, 124.0 ],
"numoutlets" : 2,
"id" : "obj-17",
"setminmax" : [ 0.0, 1.0 ],
"outlettype" : [ "", "" ],
"size" : 513
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "buffer~ stereocontrol 11.7 2",
"numinlets" : 1,
"fontname" : "Palatino Linotype",
"patching_rect" : [ -13.140015, 150.350006, 178.0, 25.0 ],
"numoutlets" : 2,
"id" : "obj-8",
"outlettype" : [ "float", "bang" ],
"fontsize" : 14.0
}
}
, {
"box" : {
"maxclass" : "multislider",
"numinlets" : 1,
"patching_rect" : [ 187.672943, 72.863945, 267.0, 124.0 ],
"numoutlets" : 2,
"id" : "obj-2",
"setminmax" : [ 0.0, 1.0 ],
"outlettype" : [ "", "" ],
"size" : 513
}
}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-7", 0 ],
"destination" : [ "obj-4", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}
}
, {
"patchline" : {
"source" : [ "obj-13", 0 ],
"destination" : [ "obj-10", 0 ],
"hidden" : 0,
"midpoints" : [ 362.589966, 297.0, 363.799988, 297.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-12", 0 ],
"destination" : [ "obj-55", 0 ],
"hidden" : 0,
"midpoints" : [ 233.039978, 596.289978, 225.299988, 596.289978 ]
}
}
, {
"patchline" : {
"source" : [ "obj-11", 0 ],
"destination" : [ "obj-12", 0 ],
"hidden" : 0,
"midpoints" : [ 353.26001, 366.0, 233.039978, 366.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-10", 0 ],
"destination" : [ "obj-11", 0 ],
"hidden" : 0,
"midpoints" : [ 363.799988, 327.0, 356.0, 327.0, 356.0, 333.0, 353.26001, 333.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-11", 0 ],
"destination" : [ "obj-14", 0 ],
"hidden" : 0,
"midpoints" : [ 353.26001, 366.0, 280.5, 366.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-11", 1 ],
"destination" : [ "obj-22", 0 ],
"hidden" : 0,
"midpoints" : [ 514.26001, 366.0, 427.5, 366.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-17", 0 ],
"destination" : [ "obj-70", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}
}
, {
"patchline" : {
"source" : [ "obj-16", 0 ],
"destination" : [ "obj-15", 0 ],
"hidden" : 1,
"midpoints" : [ 489.660034, 280.0, 489.660034, 280.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-16", 1 ],
"destination" : [ "obj-15", 1 ],
"hidden" : 1,
"midpoints" : [ 552.660034, 280.0, 551.160034, 280.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-70", 0 ],
"destination" : [ "obj-18", 0 ],
"hidden" : 1,
"midpoints" : [ 488.450012, 226.0, 489.660034, 226.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-18", 0 ],
"destination" : [ "obj-16", 0 ],
"hidden" : 1,
"midpoints" : [ 489.660034, 256.0, 489.660034, 256.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-2", 0 ],
"destination" : [ "obj-69", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}
}
, {
"patchline" : {
"source" : [ "obj-6", 0 ],
"destination" : [ "obj-7", 0 ],
"hidden" : 0,
"midpoints" : [ 196.342957, 279.0, 196.342957, 279.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-6", 1 ],
"destination" : [ "obj-7", 1 ],
"hidden" : 0,
"midpoints" : [ 259.342957, 279.0, 252.842957, 279.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-69", 0 ],
"destination" : [ "obj-1", 0 ],
"hidden" : 0,
"midpoints" : [ 194.5, 228.0, 196.342957, 228.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-1", 0 ],
"destination" : [ "obj-6", 0 ],
"hidden" : 0,
"midpoints" : [ 196.342957, 255.0, 196.342957, 255.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-19", 0 ],
"destination" : [ "obj-8", 0 ],
"hidden" : 0,
"midpoints" : [ -35.26001, 143.699982, -23.290039, 143.699982, -23.290039, 146.749985, -3.640015, 146.749985 ]
}
}
, {
"patchline" : {
"source" : [ "obj-20", 0 ],
"destination" : [ "obj-8", 0 ],
"hidden" : 1,
"midpoints" : [ -17.910034, 140.699982, -3.640015, 140.699982 ]
}
}
, {
"patchline" : {
"source" : [ "obj-66", 0 ],
"destination" : [ "obj-17", 0 ],
"hidden" : 1,
"midpoints" : [ 455.2901, 48.0, 487.445007, 48.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-65", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 1,
"midpoints" : [ 95.920074, 57.0, 197.172943, 57.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-3", 0 ],
"destination" : [ "obj-65", 0 ],
"hidden" : 1,
"midpoints" : [ 37.5, -283.0, 95.920074, -283.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-3", 0 ],
"destination" : [ "obj-66", 0 ],
"hidden" : 1,
"midpoints" : [ 37.5, -283.0, 455.2901, -283.0 ]
}
}
]
}
}
-----------end_max5_patcher-----------
– thats the main difference between wave~ and cycle~, cycle~ has a fixed size.
– your assumptions about frequency and cycle~ are correct.
– the vectorsize can be ignored in this context.
– the sampling rate (of maxmsp) will always be the one which objects have, too.
- the only thing you must take care of in this realm is when you want to do calculations, and you are expressing a time value IN samples. for example, when you are writing "22.050" somewhere to express "0.5 second" or "2 hertz". this patch will later work wrong when the maxmsp runtime is set to another rate. the solution is to use [dspstate~]–[* 0.5] instead of a fixed value.
-110
For plotting, see plot~ (especially the buffer~ tab in the help file).
To get the buffer~'s sample rate, see info~.
To convert between samples and milliseconds, see sampstoms~ and mstosamps~.
The phasor~ outputs a signal that goes repeatedly (i.e., cyclically) from 0 to 1, or more exactly from 0 to almost 1, because when it would arrive at 1 it loops back to 0. It completes that cycle f times per second, where f is the phasor~'s frequency in Hz. You can use it to control wave~ to cycle through a portion of the buffer~ f times per second, thus turning that portion of the buffer~ into a wavetable for synthesis.
Thank you, both Chris and Roman, you are totally great! This helps a lot.
To be clear, if I load an audio buffer~ with 512 values does that mean the length of the buffer is 512 samples so now I can calculate the corresponding milliseconds needed. 512 samples at a sample rate of 44k is thus
512*(1/44000) = 512* (0.0227227273) ms = 11.6363 ms
sampstoms~ tells me one sample is 0.022676 which is slightly different to my own answer. Also interestingly sampstoms~ tells me 44000 samples = 997.732422 ms thus slightly less than 1 sec!
and @Chris! I will have to wait for next month to purchase my upgrade to max 6 and use plot~
if you load a file into a buffer object it will remain the size you set it to.
you can use sfinfo~ to see how long a file ist, then change the buffer size with message, then import the file. or just make it bigger and dont care about the free space.