Polyrhythmic Tap Sequencer

Nice fix. Will implement on mine.

1 Like

Updated the write-up for latest.

1 Like

More playing around. My earlier mod to the existing quantizer had a fatal flaw, so I decided to try my hand at writing one. I think it’s a little expensive, processor-wise, compared to the Audulus one I had tried modifying. The Audulus seemed to use a very clever “nesting funnel coin sorter” method, which my poor brain was too dim to comprehend this week, alas.

16-beat Tap Polyrhythmic Drums n Tones.audulus (1.8 MB)

The new project uses my new quantizer patch. It also has a new scale selector, which uses up all the 16 scales my 2x8-bit internal MUX structure could hold. The Tonic-only scale is just the scale’s first note (aka the key for the scale), which is just the last midi note before the latest pattern fill happened or before the AUTO button was hit. (If you turn up spread all the way up to 36 half-steps, the Tonic-only scale in AUTO mode will fill the auto-fill sequencer with a random series of the root tone, falling randomly over three octaves, which can sound kind of cool against your own tap tones.)

A change to the SOLO button: It’s no longer called SOLO. It’s AUTO now. And it’s no longer a toggle button, but a momentary contact button with latching logic A light tells you the state. It always comes up in the off state now. You still have to hit some midi note to hear some tones from the auto-filling tone loop, but at least it won’t confuse you by being saved in the “pressed” state and coming up not ready to pass that note along for latching. Also, if you hit AUTO now without having pressed a midi key, the new setup outputs a random fill based on the selected scale, in the key of A (440, a “0” in “octave value” speak.) That’s because the random in-key fill is just the fill in the selected scale in the key of A (440), superimposed over the latched midi note. Such is the beauty of exponents.

I also made the user-filled tone loop its own controller, to allow polyrhythm of the tones as well as the drums. I combined the two drum loop outputs into one drum synth (saves processor, considering my quantizer is a bit of a hog.)

I hope this brings some fun your way.
Don

1 Like

I’m curious if you are talking about the “gateable” quantizer? You might look at the STS uQuant, which has an uncanny internal similarity at first glance.

I’m definitely looking forward to trying this patch out after aI take a quick nap.

edit: here is a little quantizer comparison:


quantizer comparison.audulus (617.9 KB)

1 Like

I built several different quantizers at one point. I was initially inspired by the Ornament and Crime eurorack module which has a pretty flexible quantizer as one of its many functions. It featured some non-well-tempered scales, so I needed to create an architecture that was flexible. The simplest approach to a well-tempered quantizer is to take a 1 per octave signal, multiply it by 12, take the floor() and divide it by 12. This is the approach taken by the chromatic quantizer in the library.


This is very lightweight, but has a number of drawbacks. Rather than outputting the note closest to the input, it outputs the closest note below the input. This can be improved by slightly changing the formula to floor(x*12+0.5)/12. This will result in outputting the note closest to the input value. The more significant drawbacks to this approach are that it does not allow one to exclude notes from the scale, and the intervals between the notes are all equal (well-tempered). For many uses, these limitations are outweighed by the high efficiency of the module and I often use this with sequencers, where the output of each step is fixed.
The next level of complexity is a well-tempered output where some notes can be excluded. This category includes the uQuant and many of the quantizers from the library as well as many others that have been posted. The challenge here is adjusting the logic of the quantizer to select the correct output note based on which notes are currently enabled as well as the input note. Again the simplest approach is to output the note below (or above) the input value, but I prefer to output the closest note although it requires a bit more computation. With the uQuant, in order to keep the unit compact, I chose to input the scale as a integer value which is converted to a binary pattern of notes internally. The quantizer unit itself could be used with any form of note selection. The heart of the quantizer is a module which takes an upper and lower value and an input and outputs the upper or lower value depending on which is closer to the input.

It takes the difference between the input and the upper and lower value, determines which is greater, and switches the output accordingly. Looking at it now, I realize that I could improve it slightly by substituting a crossfade node for the pair of multiply nodes.
The quantizer is a cascade of these modules driven by a set of crossfade nodes used as switches to select which notes are enabled. Then quantizer uses 0 as it’s first note which is typically A, so I included a scale root selector and transpose function to allow the use of different keys with the same input scale.
The most complex units are those that allow scales based on an arbitrary division of the octave. I developed a unit that allowed for scales up to 16 notes where each note value could be configured separately.
30%20AM
I also built a microtonal unit that went to 39 notes.
10%20AM
Needless to say these were rather more complex and CPU intensive. They use a similar approach to quantizing but allow for individual note values. I haven’t posted them on the new forum as yet since they’re rather CPU heavy and I rarely use them.

3 Likes

Switched out the multiply nodes for a crossfade and reduced CPU usage. :cowboy_hat_face: “Less is more”
https://discourse.audulus.com/t/uquant-scale-based-quantizer/402?u=stschoen

2 Likes

Thanks for the response. I’ll definitely check out those sequencers. My knowledge of temperament is kind of limited at present, I basically know (I think I know at least!) that’s been an issue for hundreds of years, and that in older music (from the 17th century on back, I’m guessing) the scale sounded somewhat different, leading to disagreement over what “period instruments” really means.

In my quantizer (simplified today to move the root latching to the little random generator), each of the 12 tones has a patch which knows its position in the scale and whether it’s used in the scale. It passes up and down either its scale position (if it’s in the scale) or that passed by its neighbor (if it’s not in-scale), allowing it to calculate its breakpoints. Break points for active scale intervals in the quantizer are then based on its position and that of its neighboring intervals, by splitting the difference. (The exceptions are at the ends of the scale, where there’s no upper or lower neighboring interval in the scale. The ends use hard-coded values.) Splitting the difference in the power of two for adjacent intervals on the scale would guarantee the split is fair, proportionally, as it’s the power of 2 that’s being split evenly.

I added the Tonic Only scale mainly to test the system, but noticed it kind of sounds neat when used in random fill mode with a three octave spread. With the “Tonic Only” scale in play, everything is captured and stuffed into the one bin. Does that make sense?

Here’s the umpeenth version of the project. This one plays better when on non-auto fill for the tones. If you’re not on auto, then whatever you play on the midi goes to both sequencers (the manual/auto loop plays through the quantizer). This can lead to interesting loops when you’re running them at different time signatures and/or clock speeds, as the tones play off one another differently, each pass through.

16-beat Tap Polyrhythmic Drums n Tones.audulus (1.8 MB)

3 Likes

Interesting that the cross fade uses less cpu than a multiply node. I haven’t experimented with the cross fade yet. Need to look at that a bit.

1 Like

I just added another quantizer to the far left (manual tap only) loop, slaved to the auto loop (simple copy/paste and a little hook up). Now my left loop is always in the scale selected. My fingers definitely do not know piano scales (apart from C-major, of course!), so the change tends to make the results a bit more reliably musical.

2 Likes

Crossfade node is just an “if then else” expression that is easier to edit :slight_smile:

2 Likes

Ok, I swear I’m done for awhile. I fixed some lapses of logic. Now, the key is set no matter whether you’re tapping out your own loops or letting the auto fill to happen (seems like a “well duh” to me!). Typical of a hobby project for me, not to fully think it through.

Here’s a little demo rig to prove out the setup:

Don’s Quantizer DEMO.audulus (225.8 KB)

Changes to the big Polyrhythm Tones and Drums project:

  1. My little “MIDI Omni legato” now defaults the freq to C below A440, instead of zero Hz.
  2. “Key Cntrl” latches the root key and octave (at startup, it latches that default key mentioned above—no clock is needed to latch the key, however, so you can set the key and octave right away by playing it on your MIDI keyboard and then hitting “set”. Whatever midi key you press, if you then hit the “set” button on the Key Ctrl patch, that note is latched and becomes the root for subsequent quantizing to scales. If you are putting in tap tones, those tones are in the same key.
  3. To allow automatic music to begin as soon as possible, all four loops default to “auto fill.” To start hearing something, all you need to do now is tap out a tempo and stuff will start happening right away (remember to count out the beats a per measure that’s set on the tap tempo patch between each tap, otherwise the thing’ll run off like a bat outa hell.)
  4. To that same end, I also modified the auto fill timer (the one with the bar display) to issue the “fill” pulse right away.
  5. The tone sequencers now latch the tone outputs to avoid having the 0 Hz pulses between taps. Solved a little mystery “…tic-tic-tic…” when it was supposed to be off—sounds way cleaner now. The little Hz display did that to make the display only show valid frequencies. It just occurred to me today that this would be very desirable for the actual output.

16-beat Tap Polyrhythmic Drums n Tones.audulus (2.0 MB)

1 Like

Here’s the latest:

Some changes.

  1. I moved the quantizers to the output side of the tap tone sequencers, so the tap tone outputs can be requantized at will, Allowing you to try out different scales on a tapped loop pattern you like or on the randomly created loops.
  2. I made a push button scale-code-making widget that lets you manually set which intervals of the 12-tone chromatic scale to play. A decimal code input at the left turns on lights below each button, indicating which intervals are used in the scale corresponding to the code—lights are for reference only.
  3. A BPM clock generator auto starts when you open the file. It’s feeding…
  4. A new version of the tap tempo patch, with a bad indexing problem fixed.
  5. The quantizer now defaults to chromatic if the # input is open (0).
  6. The little additive synths were updated with a sub channel and a mix control to set the sub/main ratio. Note that all three oscillators’ output waveforms are exposed in the patch.

16-beat Tap Polyrhythmic Drums n Tones 8.10.18.1.audulus (2.1 MB)

2 Likes

That’s actually a pretty fun song you get right when you open it :musical_keyboard::burrito::ok_hand:

2 Likes

Thanks! I wanted it to provide its own demo, as it looks kind of daunting, right out of the box.

And yeah, it’s a catchy tune, but believe me it becomes an ear worm. I should post a warning!

I originally wanted something that would allow me to practice my guitar in time to something more fun than a metronome, and with tap tempo. Adding the tone sequencer with changeable scales might make it kind of useful to practice soloing over scales. Time will tell.

2 Likes

Kind of an answer to a challenge.

Changes:

  1. The random tone generators now allow an offset—number of halfsteps from the tonic note of the scale to put in the random fills. I allowed 12 stamps bellow and 24 above, for a two octave range. Same span control, so you can play one note up on that offset, or as many as three octaves.

  2. Changes to the tap sequencer module—Two output now, an impulse output and a stepped values output. The stepped values provide clean steps in tone. The impulse output pulses once per beat.
    16-Step Tap Sequencer V6.audulus (86.6 KB)

  3. The tone loop sequencers and drum sequencers both have the new tap sequencer modules. Just for fun, the tone loop sequencer has an RGB light that displays different colors, depending on where the tone is on the 12-tone scale.
    16-step Tap Drum Sequencer v2.audulus (266.7 KB)

16-Step Tap Tone Sequencer v3.audulus (184.4 KB)

4, Change to the manual scale entry widget—took out the major scale references and moved them to a new “major scale intervals ruler.” If you’re constructing a chord from a scale, you set the R mark down on the root of the chord (no inversion assumed) and read off the intervals from the ruler. (Remember that chord intervals are based on the intervals of the major scale.)

Manual Decimal code from 12-bit binary v2.audulus (34.3 KB)

Here’s the final project, with a little O-scope tool to display the tones from the sequencers. One loop is set for a sub-bass crawl and the lead loop is playing a triad off the manual scale.

[edit—This afternoon I created and just now fixed a problem that made the synths bleat like bagpipes when they were supposed to be off. What I’d done was clamp the gate to the synths to a range that excluded zero, to avoid passing velocity values too low to hear. The fix was to add a test to only clamp non-zero gate values.]

16-beat Tap Polyrhythmic Drums n Tones 8.12.18.3.audulus (2.1 MB)

1 Like

Sequencer seems stable enough. Here it is with some great off-the-shelf synths and percussion voices!

16-beat Tap Polyrhythmic Drums n Tones 8.13.18.1 Exotic Voices.audulus (1.9 MB)

1 Like

Here it is, larded to the max, with my old 16-bar song sequencer providing the offset to the right-side random tone sequencer. This offset is the change I made to try making inversions by setting the bottom level of the random value range to be some desired number of half-steps off of key (in-key is zero or any integer as in this application the key is set and handled separately and reinserted at the end—everything plays over or under zero). The song sequencer sets that level. 0 means in-key, so 12 means in-key, one octave up.

The song sequencer translates a root freq to other intervals. I’d never tried octave signals when I built this, so it’d probably be smaller if reimplemented for octave signals. The conversion for this application is to provide a 440 Hz level as the reference. The output is scaled to match the 0-1 —> -1 to 2 octave range of the random signal patch (all my knobs are 0-1 range). I used ther slowest clock for allow a slow progression. The hand drum is tuned off the slow-moving left loop’s output tone (minus the integer part). I don’t know if the hand drum is tuned to octaves, but it sounds ok.

16-beat Tap Polyrhythmic Drums n Tones 8.13.18.1 Exotic Voices 16 bar.audulus (2.3 MB)

Now this project is a hog — 70% of my iPad Pro.

2 Likes

Latest:

Added a query function to the quantizer to allow one to get the nth degree of a particular scale.

Added an up-to-16-bar melody sequencer with a knob for each bar. Output from the melody sequencer for each bar is a scale degree (1 - 7, or i - vii) and an octave. The query from the quantizer returns the interval on the current scale (standard octave format) corresponding to the desired scale degree.

The project that’s uploaded starts in C below A440, in a 6-tone blues scale.

16-beat Tap Polyrhythmic Drums n Tones 8.13.18.1 Exotic Voices 16 bar 8.18.18.1.audulus (2.4 MB)

Once again, it’s a hog.

Here’s the melody sequencer

16-Bar Progression - Degrees of Scale.audulus (364.5 KB)

Here’s a demo of the quantizer and interval lookup feature of the latest dcQuant.

DcQuant with Degree Lookup DEMO.audulus (292.5 KB)

I left in there a little patch I made to bring multiple outputs from place to place or to park some for easy re-use:

Input Parker:Hauler.audulus (1.9 KB)

1 Like

LOL, I use vias for that, but that module cracks me up.

I did, however, center my copy.

23%20AM

Input Parker_Hauler centered.audulus (2.1 KB)

2 Likes

The correct decoding of my “hybrid” O.DO signal proved to be a (an?) SOB. I was going into my deeply repetitive melody sequencer, fixing and swapping out units. Later I used it to grab a bunch of outputs and haul the bunch of them over to a mux.

Regarding the centering: Some folks go for pound pups—others prefer a little pedigree!

AND, by the way, it just occurred to me that it’s outputs I was hauling—not inputs…

SO—here’s a new and improved one, renamed, with numbers and a big textured handle for better dragging. I could add a flashing beacon, in case you drop it somewhere in the woods, but I’ll leave that to you!

Output Parker Deluxe!.audulus (4.7 KB)

3 Likes