Q is a queue of values. A short list of the most recently received numbers. It’s a short line of memory for analyzing a short stream of data, or even just delaying data a given number of steps.
You set how long the register is (how many stages of memory) with Q.N
If you send Q a value eg: Q RAND 3 it will add that to the end of the queue and move everything currently in the queue forward by one step.
If you read Q eg: CV 1 Q you will get the value at the front of the queue. This value has been effectively delayed (or ‘shifted’) by however many steps you configured in Q.N.
You can use this in a classic way by setting Q.N to 3 or 4, then sending your CV 1 output values into the Q as well as directly to an output. Then also readout the Q to the second CV output. This will create an ASR (analog shift register) where the values are delayed at a control rate, rather than a time-based rate like an audio delay.
1:
X N RAND 12 // pick a random semitone within the first octave
CV 1 X // send the note to CV 1
Q X // add the value to the queue
CV 2 Q // read the value at the front of the queue and send to CV 2
I:
Q.N 3 // initialize the queue with a length of 3
Of course you can take this much further and use it to do many other things. The Q.AVG is a powerful way to take a moving average of the most recently received values. You could for example have a totally random output on CV 1, but then have an averaged (smoothed) output on CV 2, with the amount of smoothing controlled by Q.N:
1:
X V RAND 10 // set X to a random even volt value 0 - 10V
CV 1 X // output X directly to CV1
Q X // add X to the queue
CV 2 Q.AVG // send the average of the queue to CV 2
You can then change Q.N via live mode, or some other script to set different amounts of smoothing.