SamplerSound degraded audio playback (newbie)


#1

Hello Everyone!

I've been playing around with the juce audio plugin demo in an attemtp to get more familiar with the libraries. I really want to endeavor in creating a sampler of sorts in the future so I began to tinker with the AudioFormatReader. The lastest code seems to omit the example of the cello_wav playback but I managed to dig around and hack my own bits together. I noticed than on playback however, the sample sounds degraded from its original.

I'm using:


// Initialise the synth...
    for (int i = 4; --i >= 0;)   
        synth.addVoice (new SamplerVoice());
    synth.clearSounds();
    File file("C:\\temp\\KICK_MUGSHOT.wav");
    if (file.exists())
    {
        FileInputStream *stream = new FileInputStream(file);
        WavAudioFormat format;
        AudioFormatReader *reader = format.createReaderFor(stream, false);
        BigInteger allNotes;
        allNotes.setRange (0, 128, true);
        synth.addSound (new SamplerSound ("demo sound",
            *reader,
            allNotes,
            74,   // root midi note
            0.1,  // attack time
            10.0,  // release time
            10.0  // maximum sample length
            ));
    }
  

I simply would like to play back the sample at full volume with no pitch information to begin with and build up from there. But I feel I'm missing something. Any tips?

 

Thanks in advance.

Tone


#2

Post a sample maybe? I'm not sure what you mean by degraded ...


#3

Thanks, bazrush. I discovered that having 0.1 attack time causes a very unexpected difference in the sample. I have sorted it out.


#4

phew!