[sc-users] [SwingOSC] JSCSoundFileView, plotBuffer?
nescivi
nescivi at gmail.com
Sat Apr 12 13:36:46 PDT 2008
On Saturday 12 April 2008 16:24:58 James Harkins wrote:
> On Apr 12, 2008, at 3:49 PM, nescivi wrote:
> > On Saturday 12 April 2008 10:39:17 Martin . wrote:
> >> Hi,
> >>
> >> Is my code below correct? If so, how do I display buffers in
> >> JSCSoundFileView? I can't find anything on it in the helpfile.
> >>
> >> (
> >>
> >> b= Buffer.read(s, "sounds/a11wlk01.wav ");
> >>
> >> w = JSCWindow.new("plot me buffer!", Rect(250, 500, 500, 100)).front;
> >> a = JSCSoundFileView.new(w, Rect(5, 5, 490, 80));
> >>
> >> a.plotBuffer(b)
> >
> > b.plot( parent: a );
>
> I doubt it... this is asking to add a multislider view to the parent
> -- if the parent is a soundfile view, how should that work?
Sorry, my bad.
I didn't read the mail thoroughly enough.
I thought the question was just to plot a buffer...
> I haven't used the soundfile view much, but I expect that first you
> would have to get the buffer data into the sc client somehow.
> Probably the most straightforward way is to use myBuffer.write to put
> the data into a disk file, then use the soundfile view's read()
> method to populate the GUI.
>
> It looks to me like you could also use Buffer:loadToFloatArray (or
> getToFloatArray) to create an array in the client containing the
> buffer data, then do mySoundFileView.data = myArray.
that should work.
sincerely,
Marije
More information about the sc-users
mailing list