commit dd7e197c6dd98fc3c7593b00c94a4758176e24fa
parent 16382cc3a2305ad4460b2af8473a33dca44a038d
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date: Wed, 1 Oct 2014 16:50:35 +0200
Updated the spec
Diffstat:
M | clap.h | | | 23 | +++++++++++++---------- |
M | spec.rst | | | 23 | +++++++++++++++++++---- |
2 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/clap.h b/clap.h
@@ -45,6 +45,7 @@ enum clap_param_type
struct clap_param_info
{
+ uint32_t index;
enum clap_param_type type;
const char *id; // a string which identify the param
const char *name; // the display name
@@ -83,11 +84,12 @@ struct clap_event_note
struct clap_event_param
{
- uint32_t index;
+ uint32_t index;
union clap_param_value value;
+ float increment; // for param ramp
};
-struct clap_event_diapason
+struct clap_event_pitch
{
float freq_hz; // usually 440Hz
};
@@ -99,13 +101,14 @@ struct clap_event_preset
enum clap_event_type
{
- CLAP_EVENT_NOTE_ON, // note attribute
- CLAP_EVENT_NOTE_MODULATION, // note attribute
- CLAP_EVENT_NOTE_OFF, // note attribute
-
- CLAP_EVENT_PARAM_SET, // param attribute
- CLAP_EVENT_DIAPASON_SET, // diapason attribute
- CLAP_EVENT_PRESET_SET, // preset attribute
+ CLAP_EVENT_NOTE_ON, // note attribute
+ CLAP_EVENT_NOTE_MODULATION, // note attribute
+ CLAP_EVENT_NOTE_OFF, // note attribute
+
+ CLAP_EVENT_PARAM_SET, // param attribute
+ CLAP_EVENT_PARAM_RAMP, // param attribute
+ CLAP_EVENT_PITCH_SET, // diapason attribute
+ CLAP_EVENT_PRESET_SET, // preset attribute
};
struct clap_event
@@ -117,7 +120,7 @@ struct clap_event
union {
struct clap_event_note note;
struct clap_event_param param;
- struct clap_event_diapason diapason;
+ struct clap_event_pitch pitch;
struct clap_event_preset preset;
};
};
diff --git a/spec.rst b/spec.rst
@@ -68,8 +68,8 @@ Plugin instanciation can be done in a few steps:
Precautions
~~~~~~~~~~~
-- The function ``clap_create`` has to be thread-safe.
-- It should not throw exceptions.
+- The function ``clap_create`` must be thread-safe.
+- It must not throw exceptions.
- It can return ``NULL``.
Shell plugins
@@ -188,18 +188,33 @@ Audio buffers
The audio buffers are allocated by the host. They must be aligned by the
maximum requirement of the vector instructions currently avalaible.
-- TBD: static buffer?
-- TBD: in place processing?
+In-place processing is not supported.
Events
~~~~~~
+Events are relative to ``process->time_in_samples``.
+Their time must be positive, and included into ``[0..process->nb_samples[``.
+
Parameters
``````````
+Parameters can be automated by the host using ``CLAP_EVENT_PARAM_SET`` or
+``CLAP_EVENT_PARAM_RAMP``.
+
Notes
`````
+Notes are reprensented as a pair ``note, division``.
+Division is the number of intervals between one note and an other note with
+half or the double frequency.
+
+Pitch
+`````
+
+The pitch is the frequency of the note A. Its default value is 440Hz.
+The pitch can be changed by the host using the ``CLAP_EVENT_PITCH_SET`` event.
+
Parameters
----------