Search code examples
c++signal-processingvstjuce

What information does a 'sample' hold in a VST?


I started the process of making my own VST, using the VST SDK and Juce.

I am a programmer, so I have an OK understanding of C++ and computer science principles like how integer and floating point numbers are stored in binary.

I was able to jump right in to the code and understand basically what was going on, but I cannot for the life of me figure out what exactly a sample really is.

In the code, the individual sample is a floating point value, and it seemed to represent pitch or amplitude in different scenarios.

I don't know very much about DSP, so what I am hoping for is someone to point me on the right direction of the right information I am looking for.

In reading about DSP, all I could find was stuff about floating point values and binary, and them some more math stuff but nothing about how a digital value represents an analog value ETC, and how you can manipulate the digital values to simulate real life things like really simple delays.

Thank you!

Edit:

Ok I think I get it now, a sound save only has amplitude and frequency.

A sample merely represents amplitude, and then frequency would be how the amplitude is changing over time, as samples are processed periodically and uniformly.


Solution

  • Given that the computer cannot store a continuous wave of amplitudes, information is gathered at discrete points.

    These discrete points are known as samples, and the rate at which they are taken from the continuous waveform is known as the sample rate (so the consumer knows how to compose the samples into a continuous waveform again).