View Source SuperCollider.SynthDef.Parser (SuperCollider v0.1.5)

This is a helper function to parse values from a .scsyndef file.

Link to this section Summary

Functions

Helper function for parsing multiple big-float-32s in a sequence.

Helper function for parsing 16 bit integers.

Helper function for parsing 32 bit integers.

Helper function for parsing multiple key-value pairs in a sequence, where the key is a string and the value is a a float.

Helper function for parsing multiple key-value pairs in a sequence, where the key is a string and the value is an integer.

Helper function for parsing pstrings.

Link to this section Functions

Link to this function

parse_floats(binary, number)

View Source

Helper function for parsing multiple big-float-32s in a sequence.

  • binary: hold the binary data
  • number: number of floats to parse in a sequenece

Parsed floats are rounded to 3 decimal places.

Returns a tuple with a list of the floats as the first element, and the remainder of the binary data as the second parameter, e.g.: {float_list, binary_data}.

Link to this function

parse_integer_16(binary)

View Source

Helper function for parsing 16 bit integers.

Returns a tuple with a 16-bit integer as the first element, and the remainder of the binary data as the second parameter, e.g.: {int_value, binary_data}.

Link to this function

parse_integer_32(binary)

View Source

Helper function for parsing 32 bit integers.

Returns a tuple with a 32-big integer as the first element, and the remainder of the binary data as the second parameter, e.g.: {int_value, binary_data}.

Link to this function

parse_name_float_pairs(binary, number)

View Source

Helper function for parsing multiple key-value pairs in a sequence, where the key is a string and the value is a a float.

  • binary: hold the binary data
  • number: number of key-float value pairs to parse in a sequenece.

Returns a tuple with a list of the floats as the first element, and the remainder of the binary data as the second parameter, e.g.: {float_list, binary_data}.

Link to this function

parse_name_integer_pairs(binary, number)

View Source

Helper function for parsing multiple key-value pairs in a sequence, where the key is a string and the value is an integer.

  • binary: hold the binary data
  • number: number of key-integer value pairs to parse in a sequenece.

Returns a tuple with a list of the floats as the first element, and the remainder of the binary data as the second parameter, e.g.: {float_list, binary_data}.

Helper function for parsing pstrings.

A pstring is SuperColliders string format, which starts with a 8-bit integer holding the length of the string (string_length), followed by a binary of string_length with the string data.

Returns a tuple with string as the first element, and the remainder of the binary data as the second parameter, e.g.: {int_value, binary_data}.