libinstpatch Reference Manual | ||||
---|---|---|---|---|
Top | Description |
#define IPATCH_UNIT_DLS_ABS_TIME_0SECS int ipatch_unit_dls_class_convert (guint16 src_units
,const GValue *src_val
); double ipatch_unit_dls_percent_to_percent (int dls_percent
); int ipatch_unit_percent_to_dls_percent (double percent
); double ipatch_unit_dls_gain_to_decibels (int dls_gain
); int ipatch_unit_decibels_to_dls_gain (double db
); double ipatch_unit_dls_abs_time_to_seconds (int dls_abs_time
); int ipatch_unit_seconds_to_dls_abs_time (double seconds
); double ipatch_unit_dls_rel_time_to_time_cents (int dls_rel_time
); int ipatch_unit_time_cents_to_dls_rel_time (double time_cents
); double ipatch_unit_dls_abs_pitch_to_hertz (int dls_abs_pitch
); int ipatch_unit_hertz_to_dls_abs_pitch (double hertz
); double ipatch_unit_dls_rel_pitch_to_cents (int dls_rel_pitch
); int ipatch_unit_cents_to_dls_rel_pitch (double cents
);
int ipatch_unit_dls_class_convert (guint16 src_units
,const GValue *src_val
);
Converts a value to "DLS" units. DLS units are unit types that
are used by DLS (Downloadable Sounds) patches. The IPATCH_UNIT_CLASS_DLS
map is used to lookup the corresponding type to convert to.
Only some types have an associated DLS type. It is an error to pass a
src_units
type that has no DLS mapping (note that this is contrary to the
behavior of ipatch_unit_user_class_convert()
).
|
Source unit type ID |
|
Source value (type should be compatible with the source unit's value type) |
Returns : |
The value converted to DLS units. |
double ipatch_unit_dls_percent_to_percent (int dls_percent
);
Convert value in DLS percent units to percent.
percent = dls_percent / (10 * 65536)
|
Value in DLS percent units |
Returns : |
Value in percent |
int ipatch_unit_percent_to_dls_percent (double percent
);
Convert percent to DLS percent.
dls_percent = percent * 10 * 65536
|
Value in percent |
Returns : |
Converted integer in DLS percent |
double ipatch_unit_dls_gain_to_decibels (int dls_gain
);
Converts a value from DLS gain to decibels.
dls_gain = 200 * 65536 * log10 (V / v) decibels = 20 * log10 (V / v)
|
Value in DLS gain units |
Returns : |
Value converted to decibels |
int ipatch_unit_decibels_to_dls_gain (double db
);
Converts a value from decibels to DLS gain.
See ipatch_unit_dls_gain_to_decibel()
|
Value in decibels |
Returns : |
Value converted to DLS gain |
double ipatch_unit_dls_abs_time_to_seconds (int dls_abs_time
);
Converts a value from DLS absolute time to seconds. seconds = 2^(dls_abs_time / (1200 * 65536))
0x80000000 is used as a 0 value.
|
Value in DLS absolute time |
Returns : |
Value converted to seconds |
int ipatch_unit_seconds_to_dls_abs_time (double seconds
);
Converts a value from seconds to DLS absolute time. dls_rel_time = 1200 * log2 (seconds) * 65536
|
Value in seconds |
Returns : |
Value converted to DLS relative time |
double ipatch_unit_dls_rel_time_to_time_cents
(int dls_rel_time
);
Converts a value from DLS relative time to time cents. time_cents = dls_rel_time / 65536
|
Value in DLS relative time |
Returns : |
Value converted to time cents |
int ipatch_unit_time_cents_to_dls_rel_time
(double time_cents
);
Converts a value from time_cents to DLS relative time. dls_rel_time = time_cents * 65536
|
Value in time cents |
Returns : |
Value converted to DLS relative time |
double ipatch_unit_dls_abs_pitch_to_hertz (int dls_abs_pitch
);
Converts a value from DLS absolute pitch to hertz. hertz = 440 * 2^((dls_abs_pitch / 65536 - 6900) / 1200)
|
Value in DLS absolute pitch |
Returns : |
Value converted to hertz |
int ipatch_unit_hertz_to_dls_abs_pitch (double hertz
);
Converts a value from hertz to DLS absolute pitch. dls_abs_pitch = (1200 * log2(hertz/440) + 6900) * 65536
|
Value in hertz |
Returns : |
Value converted to DLS absolute pitch |
double ipatch_unit_dls_rel_pitch_to_cents (int dls_rel_pitch
);
Converts a value from DLS relative pitch to cents. cents = dls_rel_pitch / 65536
|
Value in DLS relative pitch |
Returns : |
Value converted to cents |