This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dev:disk_streaming [2015/04/03 21:08] – created deva | dev:disk_streaming [2015/04/09 17:35] (current) – deva | ||
---|---|---|---|
Line 2: | Line 2: | ||
**Goals:** | **Goals:** | ||
Load only a minimal amount of sample data from the disk on load, and then read in chunks just-in-time.\\ | Load only a minimal amount of sample data from the disk on load, and then read in chunks just-in-time.\\ | ||
- | The following properties | + | The following properties |
* The memory usage should remain (relatively) constant during operation regardless of the number of samples played simultaneously. | * The memory usage should remain (relatively) constant during operation regardless of the number of samples played simultaneously. | ||
* Look-ahead cannot be used. Everything must be real-time. | * Look-ahead cannot be used. Everything must be real-time. | ||
Line 10: | Line 10: | ||
* The user should be able to completely bypass the feature and read in all samples into memory. | * The user should be able to completely bypass the feature and read in all samples into memory. | ||
* Presets with parameters matching different architectures/ | * Presets with parameters matching different architectures/ | ||
+ | |||
+ | =====Design===== | ||
+ | {{: | ||
+ | * Each sample has an initial chunk loaded on drumkit load time. This data is stored in the AudioFile object. The initial chunksize can be set to " | ||
+ | * Once the sample gets triggered by an input event a EventSample object is allocated containing a sample position '' | ||
+ | * On each run iteration, the sample counter '' | ||
+ | * Once the value of '' | ||
+ | * Once the value of '' | ||
+ | * When the value of '' | ||
+ | * ... and so on and so forth - until the end of the sample has been reached ... | ||
+ | |||
+ | The samples are stored in multi-channel wav files, so we want to read in multiple channels at once in the loader thread since all channels are played (and therefore loaded) in parallel. Therefore the EventSample should be referencing the Sample object and not the AudioFile object alone... | ||
+ | |||
+ | =====FileLoader===== | ||
+ | Receives events/ | ||
+ | |||
+ | Request : // | ||
+ | |||
+ | If filename/ | ||
+ | |||
+ | Once a file is opened, it should stay opened as long as the sample is active. |