Module xInstrument
Static methods for dealing with renoise.Instrument .
Functions
set_previous_scale (instr) | Set the instrument to use the previous scale |
set_next_scale (instr) | Set the instrument to use the next scale |
set_scale_by_index (instr, scale_idx) | Set the instrument to use the a specific scale |
is_sliced (instr) | [Static] Test whether the instrument contain sample slices |
is_keyzone_available (instr) | [Static] Test whether the keyzone can be reached with the instrument (running in program mode + sample columns) |
is_triggering_phrase (instr) | [Static] Test whether instrument seems to be triggering a phrase |
get_phrase_playback_enabled (instr) | [Static] Figure out the phrase playback mode |
set_phrase_playback_enabled (instr, bool) | [Static] Set the phrase playback mode |
get_num_frames_in_slice (instr, marker_idx) | obtain the length (in frames) of a given slice NB: allows special index of "0" - the interval leading up to the first "real" slice |
get_slice_marker_at_pos (instr, pos, threshold) | [Static] Detect if there is a slice marker approximately at the sample pos |
get_slice_marker_before_pos (instr, pos) | obtain the first slice marker following the provided position |
get_slice_marker_after_pos (instr, pos) | obtain the first slice marker following the provided position |
get_slice_marker_by_sample_idx (instr, sample_idx) | [Static] Return the slice markers associated with a given sample |
autocapture () | [Static] Perform a simple autocapture and return the instrument |
get_first_available () | [Static] Locate the first empty instrument in instrument list |
get_selected_phrase_index (instr_idx) | [Static] this is a workaround for the missing 'selectedphraseindex' in instruments. |
resolve_midi_track (instr) | [Static] Resolve the assigned track (midi input properties) |
is_empty (instr) | [Static] Check if instrument contains any samples, modulation etc. |
reset_sampler () | [Static] reset sample-based part of instrument |
insert_sample (instr, sample_idx, sample_rate, bit_depth, num_channels, num_frames) | Insert/create sample - insert at sample_idx, or after selected one use the provided values to initialize the sample |
clone_sample (instr, sample_idx, args) | Clone sample the provided sample, frame by frame * inserts sample after the provided one if destsampleidx is not specified. |
Functions
- set_previous_scale (instr)
-
Set the instrument to use the previous scale
Parameters:
- instr , renoise.Instrument
- set_next_scale (instr)
-
Set the instrument to use the next scale
Parameters:
- instr , renoise.Instrument
- set_scale_by_index (instr, scale_idx)
-
Set the instrument to use the a specific scale
Parameters:
- instr , renoise.Instrument
- scale_idx , number
- is_sliced (instr)
-
[Static] Test whether the instrument contain sample slices
Parameters:
- instr (renoise.Instrument)
Returns:
-
bool
- is_keyzone_available (instr)
-
[Static] Test whether the keyzone can be reached with the instrument
(running in program mode + sample columns)
Parameters:
- instr (renoise.Instrument)
Returns:
-
boolean
- is_triggering_phrase (instr)
-
[Static] Test whether instrument seems to be triggering a phrase
Parameters:
- instr (renoise.Instrument)
Returns:
-
boolean
- get_phrase_playback_enabled (instr)
-
[Static] Figure out the phrase playback mode
Parameters:
- instr
Returns:
-
boolean
- set_phrase_playback_enabled (instr, bool)
-
[Static] Set the phrase playback mode
Parameters:
- instr
- bool
Returns:
-
boolean
- get_num_frames_in_slice (instr, marker_idx)
-
obtain the length (in frames) of a given slice
NB: allows special index of "0" - the interval leading up to the first "real" slice
Parameters:
- instr
- marker_idx
- get_slice_marker_at_pos (instr, pos, threshold)
-
[Static] Detect if there is a slice marker approximately at the sample pos
Parameters:
- instr (renoise.Instrument)
- pos (number)
- threshold (number)
Returns:
- number (marker index) or nil
- number (marker position) or nil
- get_slice_marker_before_pos (instr, pos)
-
obtain the first slice marker following the provided position
Parameters:
- instr (renoise.Instrument)
- pos (number)
Returns:
- number (marker index) or nil
- number (marker position) or nil
- get_slice_marker_after_pos (instr, pos)
-
obtain the first slice marker following the provided position
Parameters:
- instr (renoise.Instrument)
- pos (number)
Returns:
- number (marker index) or nil
- number (marker position) or nil
- get_slice_marker_by_sample_idx (instr, sample_idx)
-
[Static] Return the slice markers associated with a given sample
Parameters:
- instr (renoise.Instrument)
- sample_idx (number)
Returns:
-
table
- autocapture ()
-
[Static] Perform a simple autocapture and return the instrument
Returns:
-
int (instrument index) or nil
- get_first_available ()
-
[Static] Locate the first empty instrument in instrument list
Returns:
-
int or nil
- get_selected_phrase_index (instr_idx)
-
[Static] this is a workaround for the missing 'selectedphraseindex' in instruments.
Will temporarily select the indicated instrument and revert the selected once done. See also: http://forum.renoise.com/index.php/topic/26329-the-api-wishlist-thread/?p=221484Parameters:
- instr_idx
Returns:
-
int or nil
- resolve_midi_track (instr)
-
[Static] Resolve the assigned track (midi input properties)
Parameters:
- instr (renoise.Instrument)
Returns:
-
number, track index
- is_empty (instr)
-
[Static] Check if instrument contains any samples, modulation etc.
Parameters:
- instr (renoise.Instrument)
Returns:
-
bool
- reset_sampler ()
- [Static] reset sample-based part of instrument
- insert_sample (instr, sample_idx, sample_rate, bit_depth, num_channels, num_frames)
-
Insert/create sample - insert at sample_idx, or after selected one
use the provided values to initialize the sample
Parameters:
- instr (renoise.Instrument)
- sample_idx (number), source sample index
- sample_rate (xSampleBuffer.SAMPLE_RATE) [optional]
- bit_depth (xSampleBuffer.BIT_DEPTH) [optional]
- num_channels (number) [optional]
- num_frames (number) [optional]
Returns:
-
number (sample index) or nil
- clone_sample (instr, sample_idx, args)
-
Clone sample the provided sample, frame by frame
* inserts sample after the provided one if destsampleidx is not specified.
* can convert: provide custom samplerate/bitdepth/channels/framesParameters:
- instr (renoise.Instrument)
- sample_idx (number), source sample index
- args (table) destsampleidx (number), insert sample at this index [optional] samplerate (xSampleBuffer.SAMPLERATE) [optional] bitdepth (xSampleBuffer.BITDEPTH) [optional] numchannels (number) [optional] numframes (number) [optional]
Returns:
-
(...) or nil
number (sample index)
boolean (drumkit mode)