pos2ppq

Converts a position input to a ppq output. Useful for syncing to other objects. The 24ppq signal automatically resets when position goes back to 0 (so it won't go infinite)
Author: Sputnki
License: BSD
Github: sptnk/looper/pos2ppq.axo

Inlets

frac32buffer position input

int32.positive length

int32.positive number of quarters for the loop

int32.positive start position

Outlets

int32.positive pos4ppq

int32.positive pos24ppq

Declaration
uint32_t count4 = 0;
uint32_t count24 = 0;
Control Rate
uint32_t startpos = inlet_startpos;
uint32_t length24 = inlet_length / (inlet_quarters * 24);
uint32_t length4 = inlet_length / (inlet_quarters * 4);

uint32_t diff = inlet_pos[0] - startpos;

count24 = diff / length24;
count4 = diff / length4;

outlet_pos4ppq = count4;
outlet_pos24ppq = count24;

Privacy

© 2024 Zrna Research