Swing algorithm

Just a thought. Hope you don’t consider me too vocal about things I see and think of. Not a feature request or anything, just throwing this out there, 'cause it came to mind while I was playing with the synth tonight…

Is there a way to re-think the “swing” algorithm? Like, change the size of the step_duration array and traverse that each time? I’m thinking this isn’t going to have any “traditional” use but as I’ve been playing with this thing it seems like it’s already got a LOT of really interesting, non-traditional structure to it which I ADORE…

Relevant code:

[code lang=“cpp”]
void VoiceController::UpdateArpeggiatorParameters(const Patch& patch) {
tempo_ = patch.arp_tempo;
pattern_ = ResourcesManager::Lookup<uint16_t, uint8_t>(
lut_res_arpeggiator_patterns, patch.arp_pattern >> 2);
mode_ = patch.arp_pattern & 0x03;
direction_ = mode_ == ARPEGGIO_DIRECTION_DOWN ? -1 : 1;
octaves_ = patch.arp_octave;
pattern_size_ = patch.pattern_size;
step_duration_[0] = (kSampleRate * 60L / 4) / static_cast<int32_t>(
tempo_ <= 240
? tempo_
: ResourcesManager::Lookup<uint16_t, uint8_t>(
lut_res_turbo_tempi, tempo_ - 240 - 1));
step_duration_[1] = step_duration_[0];
estimated_beat_duration_ = step_duration_[0] / (kControlRate / 4);
int16_t swing = (step_duration_[0] * static_cast<int32_t>(patch.arp_swing)) >> 9;
step_duration_[0] += swing;
step_duration_[1] -= swing;


Also I found this which is an interesting read:


There’s a feature in the next synth that you’ll love… I’m not thinking of porting it to the Shruti-1 because it makes sense in the context of a big chunk of new features not present in the Shruti-1, and that would be hard to port (the UI works a bit differently on the next synth in the way navigation between pages/parameters is handled - which makes me more comfortable with adding more pages on it).

Haha. I’m going to wind up designing a 2nd case, aren’t I?! :wink:

after reading the doc, it makes sense to me that having an array of size 16 and several templates in ROM - in addition to the 0-127 values for the shuffle would be cool. I think it can be put in the Shruti-1 too…

UI-wise… Ok to have something like for the tempo? 0-127: standard shuffle. Afterwards it shows a bunch of strings describing different 16 steps duration modifiers?

@smrl: interested in spending some time getting some inspiration from the most interesting templates from this doc (8 or 16 of them…) and translating it into a sequence of 16 integers between -127 and 127 (-63: step duration is divided by 2 ; +127: step duration is multiplied by 2). Ideally the numbers should sum to 0 so the tempo is preserved!

Overlaying a 16-step sequence might work, but it also might be conflating the groove with the arp. sequence length. It certainly makes a lot of sense to have a longer sequence so that there’s a reason to have a more complex shuffle, but maybe something like using an array of 16 for a “1” or “2” type arpeggio, 12 or 15 for a “3” type arpeggio, 16 for 4, etc.

Yeah, tempo preservation is crucial here. If it’s just a lookup table I’m sure the values could be fit it so that they sum to 0…

And I think your UI suggestion is solid. Actually, you could even have different triplet and sixteenth, etc. divisions listed after 127, and then apply them either to an “appropriate” or “inappropriate” pattern…

Oh I don’t mean using the step sequencer UI for that - just presets with pre-defined lists of values…

Right, but am I correct that the step sequencer would “step through” the list of values? I’m just saying that certain non-sixteen step sequences, might they exist, would make more sense applied to sequences that aren’t subdivisions of 16…

And my second comment was just that it would be more flexible if these lists (which could be placed after the 127th shuffle value) could be applied in a rhythmically sensible way to certain patterns (“appropriate”), or in more rhythmically complex ways to other patterns to which they’re not matched in strict multiples/divisions. (Sorry, this is a difficult concept to convey.)

Yes, the step sequencer would step through it… it would be like patching a specific step sequence to the main clock rate.

I don’t think I’ll do anything with respect to matching the swing pattern to the arpeggiator pattern or pattern length, since this would need exposing higher level musical notions. My approach here is more to bring a bunch of low-level tools - up to the user to combine them so that the result is meaningful, or not, musically.

exactly, hence my insistence on quotation marks around “appropriate” and “inappropriate” in my previous comments. Sounds good to me