Skip to content

Sample Management

passivist edited this page Oct 15, 2016 · 4 revisions

Sample Management

Now that we know loading and playing of audio works in principle we can think a bit about making the process more robust and flexible. In this chapter some concepts such as classes, threads and thread-safe techniques are introduced. This chapter is based on this tutorial which I used to learn how to make loading sound files work in the plugin.

Before we get into rewriting the loading functions we'll start by doing a preliminary exercise on writing classes: the encapsulation of our processing function in a custom class. This class will be called Grain and over the next few chapters we will fill it with all the functionality we'll eventually need to do granular synthesis.

Classes are blueprints for objects and are made up of member variables (or attributes) and member functions (or methods). Our Grain class will encapsulate all the variables and functions that are necessary to play a single grain.

[<<< last Chapter] [next Chapter >>>]

Clone this wiki locally