I've been playing around with midi remote scripts for a while and I grew to be quit happy with the results so far. There's just one thing, I can't get under control:
I want a clip to be quantized 'by a press of a button' (for example to quickly fix, if I mess up doing finger-druming), but I can't get clip.qualtize() to work properly. It DOES some kind of quantisation, but it's not reliable and I'm not able to track down the problem.
Here's what I'm precisely trying to do:
Code: Select all
def quantize_clip():
#get current highlighted clip
cur_clip_slot = self.song().view.highlighted_clip_slot
# 'Bonus-Task: get the current quantization of the clip.
# This only works, if I set the quantization manually,
# it does not get the current quantization based on the
# current clip-view
cur_quant = cur_clip_slot.clip.view.grid_quantization
# this does something, but I can't figure out what exactly
cur_clip_slot.clip.quantize(cur_quant, 1.0)
# Alternatively, I tried to figure out a int-value to pass to the function
# since the actual API call seems to be quantize(int, float). I guess the
# value 7 is supposed to be 1/16ths
# cur_clip_slot.clip.quantize(7, 1.0)
Does anyone have an Idea what's going on and how to solve this?