beginners help on buffer~ import

Sep 10, 2008 at 10:06pm

beginners help on buffer~ import

Can anybody tell me what I do wrong with this, when I want to try to read in a stereo mp3 in a buffer~?

By the way: Is this the right way to present a patch (MAX 5) in this forum?

Thanks

Peter

{
“boxes” : [ {
"box" : {
"maxclass" : "newobj",
"text" : "loadbang",
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 1,
"patching_rect" : [ 174.0, 80.0, 60.0, 20.0 ],
“id” : “obj-2″,
“outlettype” : [ "bang" ],
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “import 0 -1 2″,
“fontsize” : 12.0,
“numinlets” : 2,
“numoutlets” : 1,
“patching_rect” : [ 312.0, 74.0, 78.0, 18.0 ],
“id” : “obj-65″,
“outlettype” : [ "" ],
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “button”,
“numinlets” : 1,
“numoutlets” : 1,
“patching_rect” : [ 312.0, 41.0, 20.0, 20.0 ],
“id” : “obj-13″,
“outlettype” : [ "bang" ]
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “set speelaf”,
“fontsize” : 12.0,
“numinlets” : 2,
“numoutlets” : 1,
“patching_rect” : [ 173.0, 246.0, 69.0, 18.0 ],
“id” : “obj-16″,
“outlettype” : [ "" ],
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “waveform~”,
“numinlets” : 5,
“snapto” : 2,
“numoutlets” : 6,
“patching_rect” : [ 173.0, 276.0, 250.0, 83.0 ],
“setmode” : 1,
“id” : “obj-15″,
“outlettype” : [ "float", "float", "float", "float", "list", "" ],
“textcolor” : [ ],
“buffername” : “speelaf”,
“quiet” : 1
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “buffer~ speelaf 0 2″,
“fontsize” : 12.0,
“numinlets” : 1,
“numoutlets” : 2,
“patching_rect” : [ 313.0, 96.0, 110.0, 20.0 ],
“id” : “obj-1″,
“outlettype” : [ "float", "bang" ],
“fontname” : “Arial”
}

}
],
“lines” : [ {
"patchline" : {
"source" : [ "obj-13", 0 ],
“destination” : [ "obj-65", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-2", 0 ],
“destination” : [ "obj-16", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-16", 0 ],
“destination” : [ "obj-15", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-65", 0 ],
“destination” : [ "obj-1", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
]
}

#39653
Sep 10, 2008 at 10:41pm

If you’re going to do this, select the stuff
you want to post and chose “Copy Compressed”
from the Edit menu and paste *that* into the
patch.

One thing you might want to investigate is the
info~ object. You might pay some attention to
the righthand outlet of the buffer~ object. It
might be useful to you, especially since there’s
that suspicious loadbang object connected to the
display object.

#139821
Sep 11, 2008 at 10:03am

The import message takes one argument, filename. The channels are taken from the header information in the mp3 file.

#139822
Sep 11, 2008 at 7:43pm

Thanks for the answer on the way to post here.
The other question: why is a loadbang to the set message that couples the waveform~ to the buffer, suspect? It is a matter of a one-time-bond betwee the buffer and the wave that will stay forever, isn’t it?
Second: a simple import to my buffer~ will show the filename in the info~ but doesn’t fill the buffer with the MP3-audio. While, of cause, quicktime plays the mp3 without any problems.

So still stuck, a little.

Peter

#139823
Sep 11, 2008 at 7:56pm

If you look at the right outlet of buffer~ you will see it will bang after a file read. If you connect your waveform to this rather than loadbang then you don’t need to load anything at start.

As for your import problem, I can reproduce on Max 5 OSX Leopard. Though works fine on Max 4.

#139824
Sep 11, 2008 at 9:06pm

Got your bang thing.
Concerning buffer~ import: I’m glad that I don’t have to go crazy after all my tries. That it might be a problem from outside.
In the mean time I got a workaround: Give the buffer~ a length (any) at creation. Then override it with the “import -1 2″ message. Then it loads in the buffer~. Next have to set the waveform~ length from info~. Then in the end all is in place.

Peter

#139825

You must be logged in to reply to this topic.