Implementation details¶
Data structures¶
-
class
volcasample.syro.
Endian
¶ Shadows the Endian enumeration in the Syro C library.
-
LittleEndian
= c_uint(0)¶
-
BigEndian
= c_uint(1)¶
-
-
class
volcasample.syro.
DataType
¶ Shadows the DataType enumeration in the Syro C library.
-
Sample_Liner
= c_uint(0)¶
-
Sample_Compress
= c_uint(1)¶
-
Sample_Erase
= c_uint(2)¶
-
Sample_All
= c_uint(3)¶
-
Sample_AllCompress
= c_uint(4)¶
-
Pattern
= c_uint(5)¶
-
-
class
volcasample.syro.
Status
¶ Shadows the Status enumeration in the Syro C library.
-
Success
= c_uint(0)¶
-
IllegalDataType
= c_uint(1)¶
-
IllegalData
= c_uint(2)¶
-
IllegalParameter
= c_uint(3)¶
-
OutOfRange_Number
= c_uint(4)¶
-
OutOfRange_Quality
= c_uint(5)¶
-
NotEnoughMemory
= c_uint(6)¶
-
InvalidHandle
= c_uint(7)¶
-
NoData
= c_uint(8)¶
-
SamplePacker class¶
-
class
volcasample.syro.
SamplePacker
¶ This class contains all the methods needed to program a Volca Sample device.
- Use
volcasample.syro.SamplePacker.patch()
to populate patch data. - Produce a data file from the patch with
volcasample.syro.SamplePacker.build()
.
-
static
patch
(jobs)¶ Parameters: jobs – An OrderedDict of {int: (
volcasample.syro.DataType
, str)}.- The keys are indexes of sample slots (0 - 99).
- Values are 2-tuples, such that:
- First element determines whether to load or delete the slot.
- Second element is a path to an audio sample file.
Returns: An array containing patch data. Return type: [SyroData]
-
static
build
(patch, locn=None, output='volcasamples.wav')¶ Create a WAV file with patch data for a Volca device.
Parameters: - patch ([SyroData]) – An array containing patch data.
- locn (str) – A path to a writeable directory.
- output (str) – The name of the output file.
Returns: A 2-tuple of (status, file path).
Return type: tuple
-
static
start
(handle, data, nEntries, lib=None)¶ This method wraps the SyroVolcaSample_Start function.
Parameters: - handle (Handle) – A fresh handle object.
- data ([SyroData]) – An array containing patch data.
- nEntries (int) – The number of elements in the array.
Returns: Number of output frames.
Return type: int
-
static
get_samples
(handle, nFrames, lib=None)¶ This method wraps the SyroVolcaSample_GetSample function.
Parameters: - handle (Handle) – A fresh handle object.
- nFrames (int) – The number of sample frames to be returned.
Returns: A sequence of stereo (2-tuple) samples.
Return type: generator
- Use