Module xSample

Static methods for working with renoise.Sample objects .

Requires xReflection xSampleMapping xPhrase

Functions

get_bit_depth (sample) credit goes to dblue
bits_to_xbits (num_bits) convert any bit-depth to a valid xSample representation
get_channel_info (sample) check if sample has duplicate channel data, is hard-panned or silent (several detection functions in one means less methods are needed...)
convert_sample (instr, sample_idx, bit_depth, channel_action, range) convert sample: change bit-depth, perform channel operations, crop etc.
sample_buffer_is_silent (buffer, channels) check if the indicated sample buffer is silent

Tables

SAMPLE_CONVERT SAMPLE_CONVERT: misc.


Functions

get_bit_depth (sample)
credit goes to dblue

Parameters:

  • sample (renoise.Sample)

Returns:

    int (0 when no sample data)
bits_to_xbits (num_bits)
convert any bit-depth to a valid xSample representation

Parameters:

  • num_bits (int)

Returns:

    int (xSample.BIT_DEPTH)
get_channel_info (sample)
check if sample has duplicate channel data, is hard-panned or silent (several detection functions in one means less methods are needed...)

Parameters:

  • sample (renoise.Sample)

Returns:

    enum (xSample.SAMPLE_[...])
convert_sample (instr, sample_idx, bit_depth, channel_action, range)
convert sample: change bit-depth, perform channel operations, crop etc. (jumping through a few hoops to keep keyzone and phrases intact...)

Parameters:

  • instr (renoise.Instrument)
  • sample_idx (int)
  • bit_depth (xSample.BIT_DEPTH)
  • channel_action (xSample.SAMPLE_CONVERT)
  • range (table) source start/end frames

Returns:

    renoise.Sample or nil (when failed to convert)
sample_buffer_is_silent (buffer, channels)
check if the indicated sample buffer is silent

Parameters:

  • buffer (renoise.SampleBuffer)
  • channels (xSample.SAMPLE_CHANNELS)

Returns:

    bool (or nil if no data)

Tables

SAMPLE_CONVERT
SAMPLECONVERT: misc. channel operations MONOMIX: stereo -> mono mix (mix left and right) MONO_LEFT: stereo -> mono (keep left) MONO_RIGHT: stereo -> mono (keep right) STEREO: mono -> stereo SWAP: stereo (swap channels)

Fields:

  • MONO_MIX TODO
  • MONO_LEFT
  • MONO_RIGHT
  • STEREO
  • SWAP
generated by LDoc 1.4.2