Decodes an object from an integer-based encoding.

decode(x, x_type = type(x))

decode_pc_set(x)

decode_pc_chord_type(x)

decode_pc_chord(x)

Arguments

x

Object to decode.

x_type

(Character scalar) The type that x is intended to represent (e.g. "pc_chord").

Value

decode returns an object of class vec; the other functions return integer vectors.

Details

The decode function is vectorised and uses precomputed encodings. The following functions represent alternative implementations that are not vectorised and do not rely on precomputed encodings:

  • decode_pc_set

  • decode_pc_chord_type

  • decode_pc_chord

See also

encode for the reverse operation.