Copying part of a buffer~


    May 02 2007 | 2:27 pm
    Is there a way to copy part of a buffer~ to a temporary buffer~? I have
    loaded a file into a buffer~ and I want to copy sample 2000 to 4500 to
    another buffer.
    Cheers
    Gary Lee Nelson
    Oberlin College
    www.timara.oberlin.edu/GaryLeeNelson

    • May 02 2007 | 7:10 pm
      like this?
    • May 02 2007 | 9:38 pm
      Another option would be to use [[jit.buffer~]. Or if you want to stay in Max
      domain, have a look at [mxj buf.Op]. I don't know if the copy function is
      built in [mxj buf.Op], but maybe that's not too difficult to hack something.
      Both approaches would enable faster than real time copy.
      > like this?
      >
      > #P window setfont "Sans Serif" 9.;
      > #P window linecount 1;
      > #P newex 62 243 47 9109513 pack 0 0.;
      > #P newex 62 208 34 9109513 buddy;
      > #P flonum 115 176 79 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
      > #P number 115 91 76 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
      > #P message 318 97 26 9109513 read;
      > #P newex 318 174 96 9109513 buffer~ buffer2 3000;
      > #P newex 62 280 67 9109513 peek~ buffer2;
      > #P newex 318 126 96 9109513 buffer~ buffer1 2000;
      > #P newex 115 128 67 9109513 peek~ buffer1;
      > #P connect 8 0 2 0;
      > #P fasten 7 1 8 1 91 234 104 234;
      > #P connect 7 0 8 0;
      > #P fasten 0 0 7 1 120 157 91 157;
      > #P connect 0 0 6 0;
      > #P fasten 5 0 7 0 120 112 67 112;
      > #P connect 5 0 0 0;
      > #P connect 4 0 1 0;
      > #P window clipboard copycount 9;
      >
    • May 02 2007 | 10:03 pm
    • May 02 2007 | 11:25 pm
      Yes, that works. Thanks. I was using uzi to generate the sample numbers
      but buddy made it work.
      On 5/2/07 3:10 PM, "Dayton" wrote:
      >
      Cheers
      Gary Lee Nelson
      Oberlin College
      www.timara.oberlin.edu/GaryLeeNelson