nsmp

Files: nsmp.h, nsmp.c

Nanosamp: a tiny sampler built for Soundpipe
A nanosamp file is comprised of a mono audio file and an ini file. Nanosamp is geared towards percussive and found sound sample players, and is intended to be combined with soundpipe modules.
The ini file contains mappings that correspond to the audio file. Such an entry would look like this:

[keyword]
pos = 2.3
size = 3
In this instance, an entry called "keyword" has been made, starting at 2.3 seconds in the audio file, with a length of 3 seconds. An example file oneart.ini has been created in the examples folder.
The SoundPipe implementation of nanosamp will automatically index the entries in the order they appear in the INI file and must be selected this way by changing the index parameter. Soundpipe will only select the new entry when the trigger input is a non-zero value.

Functions

sp_nsmp_create(sp_nsmp **nsmp)
sp_nsmp_init(sp_data *sp, sp_nsmp *nsmp, sp_ftbl*ft, int sr, const char*init)
sp_nsmp_compute(sp_data *sp, sp_nsmp *nsmp, SPFLOAT *trigger, SPFLOAT *signal out)
sp_nsmp_destroy(sp_nsmp **nsmp)

Mandatory Parameters

ft: ftbl of the audio file. It should be mono.
(Recommended value: N/A)
sr: samplerate.
(Recommended value: N/A)
init: ini file.
(Recommended value: N/A)

Optional Parameters

index: This is an optional parameter. These values are always set to a value by default, and can be set after the init function has been called.
(Default value: 0)

Inputs

trigger: Trigger input.

Outputs

signal out: Signal output.

Other Functions:

sp_nsmp_print_index(sp_data *sp, sp_nsmp *nsmp)
Prints the index and their corresponding keyword