Buffer and Data don't sound the same

    Nov 27 2014 | 11:20 pm
    I am interested in using a Data object in Gen to playback a short loop (450 samples long). I came across Roald Baudoux's 'Seemless Looper' and Kristoff S's 'Sampler' (inspired by Roald's work). Both patches are great but use a Buffer outside Gen and refer to that Buffer inside Gen. In the attachment are adaptations of the the two patches with the left side of each patch using the original Buffer and the right using a Data object.
    The Buffer versions sound the same as the original loop. You can load 'Sample_43-77_LOOP' into a DAW or sample editor to hear this or play the longer sample 'Sample_43-77'. The problem: The Data version sounds awful. It's vaguely similar to the the Buffer version but not accurate.
    Can anything a Buffer does be done with Data? - is it possible to use a Data object instead of Buffer?
    What's wrong with my patch? Why does the Data object sound different? To me it sounds filtered or like aliasing.
    Note that the sample data has 450 points so it isn't stereo. Presumably Buffer plays stereo. Could it be that the Buffer versions sound better due to the buffers having twice as many samples in them?
    Should I be using splat or wave somewhere?
    If you could examine these patches that would be great. Better still, if you could take the patch 'Basic - Just a DATA object filled with loop sample' and make it just playback the sample with the same sound as the original wav that would be fantastic. All I want is a way to playback using only Gen.
    'extract.wav.2.text' is a PD patch to extract the sample data from a wav. I'm not sure how to do this in Max.
    Data for the Coll object is included.
    Any help is welcome.

    • Nov 28 2014 | 7:20 am
      Thanks Raja,
      I replaced poke with splat but unfortunately it sounds the same. See attached.
      cycle is only used so the user sees the wav is loaded into the data object.
      Oh well, I guess I'll have to wait for somebody to offer more tips.
    • Nov 29 2014 | 4:15 pm
      hi daveyc.
      if you read the gen~ documentation there is a whole section which clearly explains what buffer and data are and what they can and cannot do.
      short version: - no, data has no knowledge of the world outside the gen~ patch - it is internal only and for poking or splatting in internal 64-bit doubles - buffer is only for referencing external msp numbers held in an msp buffer~ object. it is the sole means by which one can get data into gen~ at present.
      buffer~ is (and possibly always will be) 32-bit floats maximum resolution, whereas all numbers in gen~ are 64-bit doubles. but this makes no difference to quality at all - buffer in gen~ simply copies the 32-bit numbers from msp buffer~ into its own 64-bit namespace. if you are using this just for audio files all is fine as they will unlikely be > than 32-bit floats. the only problem arises when using for LUTs of arbitrary non-algorithmically-generatable 64-bit doubles - then you are screwed and need to go to C / SDK.
      you can however write from gen~ to msp buffer so long as it is referenced, and vica versa. but there is no way to write msp numbers to gen~ data operator or vica versa.
    • Nov 29 2014 | 8:03 pm
      Hi STKR,
      Thanks for the explanation. That makes sense. At least I now know what I wanted isn't possible.
    • Feb 19 2015 | 12:48 am
      STKR is mostly right, but not completely: you *can* copy from MSP buffer~ to gen [data], using the param-like message (see patcher below).
    • May 12 2015 | 2:24 pm
      Hi everyone
      I have looked at your patches being plagued by the same problem but cannot figure out how to load a wavetable in gen only once, save it as .gendsp and use it upon next opening without having to load from sound file again. I want Data operator to retain its table on project closure.
      Much appreciated Archos
    • May 13 2015 | 12:35 pm
      Thanks Raja
      The project I am working on will be exported from Gen and handed in to coders for further development hence the need to make the audio engine (synths etc.) in Gen, to lessen the code adaptation. But I get that the wavetable for a synth would need to be stored elsewhere on programmer's side