Cropping a buffer~ with buf.op


    May 08 2007 | 1:30 pm
    I am recording quad into a buffer~ that I am setting with a very generous
    initial size of 15 minutes. As I record I am keeping track of the time in
    milliseconds. When I finish recording and before I write to disk, I want to
    crop the buffer to the actual length of the recording. Setting its size
    erases the buffer. I don't see this in buf.op. Have I just missed it?
    Cheers
    Gary Lee Nelson
    Oberlin College
    www.timara.oberlin.edu/GaryLeeNelson

    • May 08 2007 | 1:50 pm
      I use waveform~ for this. Unfortunately, you have to be very careful
      with the timing of crop and other messages to waveform~, otherwise
      crop will not happen/the object will crash.
      Best,
      Zip
      Zip Boterbloem
      Media Mechanics
      Zwaluwstraat 54
      2025 VR Haarlem
      The Netherlands
      +31627014758
      zip@knoware.nl
      Op 8-mei-2007, om 15:30 heeft Gary Lee Nelson het volgende geschreven:
      > I am recording quad into a buffer~ that I am setting with a very
      > generous
      > initial size of 15 minutes. As I record I am keeping track of the
      > time in
      > milliseconds. When I finish recording and before I write to disk, I
      > want to
      > crop the buffer to the actual length of the recording. Setting its
      > size
      > erases the buffer. I don't see this in buf.op. Have I just missed it?
      >
      > Cheers
      > Gary Lee Nelson
      > Oberlin College
      > www.timara.oberlin.edu/GaryLeeNelson
      >
      >
    • May 08 2007 | 3:30 pm
      On 8 mai 07, at 15:50, Zip Boterbloem wrote:
      > I use waveform~ for this. Unfortunately, you have to be very
      > careful with the timing of crop and other messages to waveform~,
      > otherwise crop will not happen/the object will crash.
      Do you have a reproductible crash?
      ej
    • May 08 2007 | 4:53 pm
      This seems to be a different issue. What I want to do is reduce the size of
      a buffer~ to a specific length without erasing its contents.
      On 5/8/07 11:30 AM, "Emmanuel Jourdan" wrote:
      > On 8 mai 07, at 15:50, Zip Boterbloem wrote:
      >
      >> I use waveform~ for this. Unfortunately, you have to be very
      >> careful with the timing of crop and other messages to waveform~,
      >> otherwise crop will not happen/the object will crash.
      >
      > Do you have a reproductible crash?
      >
      > ej
      Cheers
      Gary Lee Nelson
      Oberlin College
      www.timara.oberlin.edu/GaryLeeNelson
    • May 08 2007 | 6:58 pm
      [waveform~] works for that. It crops to your current selection, if I
      remember well.
      > This seems to be a different issue. What I want to do is reduce the size of
      > a buffer~ to a specific length without erasing its contents.
    • May 08 2007 | 8:06 pm
    • May 08 2007 | 8:28 pm
      Not really. But I see waveform~ mentioned a bit too often in crashed
      threads in my Max logs. I am using the crop and normalize messages in
      quick succession after a recording.
      Zip Boterbloem
      Media Mechanics
      Zwaluwstraat 54
      2025 VR Haarlem
      The Netherlands
      +31627014758
      zip@knoware.nl
      Op 8-mei-2007, om 17:30 heeft Emmanuel Jourdan het volgende geschreven:
      > On 8 mai 07, at 15:50, Zip Boterbloem wrote:
      >
      >> I use waveform~ for this. Unfortunately, you have to be very
      >> careful with the timing of crop and other messages to waveform~,
      >> otherwise crop will not happen/the object will crash.
      >
      > Do you have a reproductible crash?
      >
      > ej
    • May 09 2007 | 10:42 am
    • May 09 2007 | 10:15 pm
      Firefox "Find" on that page brings you this:
      hacks
      max java - buf.Op extras
      with this copyFrom method you can select and copy into a msp buffer at
      any position. to install open the java source code for buf.Op from
      within max with 'viewsource'. then paste this code at the end of that
      document - just before the last closing curlybracket. save, press cmd+k
      and click compile. last restart max. notice that this will be
      overwritten whenever you update max.
      //redFrik 050513, 051128, 060927
      public void copyFrom(String frombuf, long destoffset) {
      copyFrom(frombuf, destoffset, 0);
      }
      public void copyFrom(String frombuf, long destoffset, long srcoffset) {
      long length= MSPBuffer.getSize(frombuf);
      copyFrom(frombuf, destoffset, srcoffset, length-srcoffset);
      }
      public void copyFrom(final String frombuf, final long destoffset, final long srcoffset, final long srcsize) {
      MaxSystem.deferLow(new Executable() {
      public void execute() {
      int channels= MSPBuffer.getChannels(frombuf);
      for(int i= 1; i MSPBuffer.poke(bufname, i, destoffset, MSPBuffer.peek(frombuf, i, srcoffset, srcsize));
      }
      outlet(0, "done");
      }
      });
      }
      and here is a little example patch...
      _download (1,2kb)
      Gary Lee Nelson skrev:
      > This pints to the f0 externals which I already have. I don't see a
      > reference to buf.op or cropping.
      >
      >
      > On 5/9/07 6:43 AM, "James Little" wrote:
      >
      >
      >> use this hack of buf.Op
      >>
      >> http://www.fredrikolofsson.com/pages/code-max.html
      >>
      >>
      >> --
      >> www.myspace.com/binray
      >>
      >
      >
      > Cheers
      > Gary Lee Nelson
      > Oberlin College
      > www.timara.oberlin.edu/GaryLeeNelson
      >
      >
      >
      > .
      >
      >
    • May 10 2007 | 8:31 am
      Zip Boterbloem schrieb:
      > Unfortunately, you have to be very careful with the timing of crop
      > and other messages to waveform~, otherwise crop will not happen/the
      > object will crash.
      If this is reproduceable, it should be reported and fixed...
      Stefan
      --
      Stefan Tiedje------------x-------
      --_____-----------|--------------
      --(_|_ ----|-----|-----()-------
      -- _|_)----|-----()--------------
      ----------()--------www.ccmix.com