Random Scale Player Via PSQ1684 Shift Register

Need some fresh sounds? Want to show off your sound design skills? Here's the place!
Post Reply
User avatar
Catblack
Posts: 1020
Joined: 15 Apr 2016
Contact:

14 Feb 2018

Here's a combi I've been working on this week. It uses a PSQ1638's shift register to set a Scale and Chords Player's custom scale in a random fashion. Then it generates the playing note into the combi from a Little LFO's noise oscillator (with some tweaking to narrow the note range. The custom scale changes every bar, and with filter notes on it gives it pauses between the notes. There's also a CV8x4 with some more parameters.

It will probably give you a headache, but it satisfied my random note generation urge. Try it!
Shift Register Random Scale Piano.zip
Revised version
(55.59 KiB) Downloaded 141 times
Last edited by Catblack on 14 Feb 2018, edited 2 times in total.
If you ain't hip to the rare Housequake, shut up already.

Damn.

mataya

14 Feb 2018

Can't wait to try it after I finish my work.
I was always and still am confused about shift register. How does it work?

mataya

14 Feb 2018

"Bad Patch Format" error here.

M

User avatar
Catblack
Posts: 1020
Joined: 15 Apr 2016
Contact:

14 Feb 2018

mataya wrote:
14 Feb 2018
Can't wait to try it after I finish my work.
I was always and still am confused about shift register. How does it work?
The PSQ1684 can output a Shift Register made up of a variable number of bits. (8 bit, 12 bit... up to 32 bits) In the case of the Scales and Chords Player, settable through the combinator, you have access to the Custom Scale through a combi. But it's a number from 0 to 4095. That means it's a 12 bit number, which is pretty impossible to dial in from a combi's rotary.

I've been thinking about how to do this for a long while. But basically that 12 bit number for a custom scale looks like this:

Code: Select all

C  =            1 = 1
C# =           10 = 2
D  =          100 = 4
D# =         1000 = 8
E  =        10000 = 16
F  =       100000 = 32
F# =      1000000 = 64
G  =     10000000 = 128
G# =    100000000 = 256
A  =   1000000000 = 512
A# =  10000000000 = 1024
B  = 100000000000 = 2048
I've been trying to create something that would let me add bits together to create random scales. But my math actually sucks (Using the DVC-1 Voltage Comparator,) and then I realized that the PSQ had a shift register. Here's a video of it working, NO AUDIO. Note how the bits displayed in the PSQ are reversed in the Player!



Now the PSQ has 600 patterns for it's shift register -- though I sort of wish it had a more direct access to each bit. (But maybe I'll make a RE that does that.) And those 600 patterns are 32 bit, so when you pare it down to 12 bits, you get some patterns repeating. And when a pulse is detected the bits shift over one.

The scales and chords player is the only place in Reason that I know of where any direct bit manipulation is useful. But great for that midi polyphony.

mataya wrote:
14 Feb 2018
"Bad Patch Format" error here.

M
Have you tried turning it off and on again? :D I've reuploaded it.
If you ain't hip to the rare Housequake, shut up already.

Damn.

User avatar
emilng
Posts: 99
Joined: 03 Oct 2017

15 Feb 2018

This is a really cool find. I managed to get some really interesting drum patterns with the scales and chords with filter notes turned on and attached to a kong and having the custom scale set by the shift register value in one PSQ instance. In a separate PSQ instance I was using a shift register sequencer to send note values to the scales and chords/kong combinator. This ends up using a shift register in one PSQ instance to filter which drums get played by the sequencer from the second PSQ instance.

mataya

15 Feb 2018

Sounds like a real fun stuff. But unfortunately I still get the bad format or corrupt patch error.
I'm just trying to lad it from the desktop into combinator.
Sorry.

M

User avatar
theshoemaker
Posts: 595
Joined: 21 Nov 2015
Location: Germany
Contact:

15 Feb 2018

emilng wrote:
15 Feb 2018
This is a really cool find. I managed to get some really interesting drum patterns with the scales and chords with filter notes turned on and attached to a kong and having the custom scale set by the shift register value in one PSQ instance. In a separate PSQ instance I was using a shift register sequencer to send note values to the scales and chords/kong combinator. This ends up using a shift register in one PSQ instance to filter which drums get played by the sequencer from the second PSQ instance.
Whenever you see base 2 numbers 2,4,8,16,64,128,256,512,1024,2048,4096,8192, ....

There is a good chance of bit operations. I figured that out long time ago, but could never make sense of it, what to do with it.

so for the chromatic scale we all know we need 12 notes.

2 ** 12 = 4096.

So to represent the state of a 12 note scale in parallel you need a integer number which can hold the value 4096 by applying bit operations on the bits. Each note is a bit. So all keys in the scale turned off is

0000 0000 0000 which tends to relate the integer number 0

all on

1111 1111 1111 which tends to relate the integer number 4096

What made me wonder is, why I can just have steps of 5 on the programmer inside the combinator, when selecting the min/max

Any ideas on this?
:PUF_figure: latest :reason: V12 on MacOS Ventura

User avatar
theshoemaker
Posts: 595
Joined: 21 Nov 2015
Location: Germany
Contact:

15 Feb 2018

mataya wrote:
15 Feb 2018
Sounds like a real fun stuff. But unfortunately I still get the bad format or corrupt patch error.
I'm just trying to lad it from the desktop into combinator.
Sorry.

M
I got that too. I also have different demos of reason which timed out. Just fire up reason and open it by dragging and dropping. At least this worked on my reason 9.5
:PUF_figure: latest :reason: V12 on MacOS Ventura

User avatar
theshoemaker
Posts: 595
Joined: 21 Nov 2015
Location: Germany
Contact:

15 Feb 2018

Catblack wrote:
14 Feb 2018
mataya wrote:
14 Feb 2018
Can't wait to try it after I finish my work.
I was always and still am confused about shift register. How does it work?
The PSQ1684 can output a Shift Register made up of a variable number of bits. (8 bit, 12 bit... up to 32 bits) In the case of the Scales and Chords Player, settable through the combinator, you have access to the Custom Scale through a combi. But it's a number from 0 to 4095. That means it's a 12 bit number, which is pretty impossible to dial in from a combi's rotary.

I've been thinking about how to do this for a long while. But basically that 12 bit number for a custom scale looks like this:

Code: Select all

C  =            1 = 1
C# =           10 = 2
D  =          100 = 4
D# =         1000 = 8
E  =        10000 = 16
F  =       100000 = 32
F# =      1000000 = 64
G  =     10000000 = 128
G# =    100000000 = 256
A  =   1000000000 = 512
A# =  10000000000 = 1024
B  = 100000000000 = 2048
I've been trying to create something that would let me add bits together to create random scales. But my math actually sucks (Using the DVC-1 Voltage Comparator,) and then I realized that the PSQ had a shift register. Here's a video of it working, NO AUDIO. Note how the bits displayed in the PSQ are reversed in the Player!



Now the PSQ has 600 patterns for it's shift register -- though I sort of wish it had a more direct access to each bit. (But maybe I'll make a RE that does that.) And those 600 patterns are 32 bit, so when you pare it down to 12 bits, you get some patterns repeating. And when a pulse is detected the bits shift over one.

The scales and chords player is the only place in Reason that I know of where any direct bit manipulation is useful. But great for that midi polyphony.

mataya wrote:
14 Feb 2018
"Bad Patch Format" error here.

M
Have you tried turning it off and on again? :D I've reuploaded it.
If it helps you, I could provide you with a BETA of my RePlay - Python Scripting Codec for Remotable Items.

There you could use python for your bit manipulation, or a lisp dialect (hy) to send midi. The only thing I have to do is setup 16 bit values to be transmitted at the codec level. Right now I just send simple midi 0-127 values, which don't help for the 12 bit stuff you need here. I guess a device with modwheel to cv-out matrix routing would do the trick to send the propper CV value to your combinator.

EDIT: I really love the work you have been doing here. I think if rob would add an update to PSQ you could even setup the matrix with the sequencer to do the bit manipulation
:PUF_figure: latest :reason: V12 on MacOS Ventura

User avatar
Catblack
Posts: 1020
Joined: 15 Apr 2016
Contact:

15 Feb 2018

theshoemaker wrote:
15 Feb 2018


If it helps you, I could provide you with a BETA of my RePlay - Python Scripting Codec for Remotable Items.

There you could use python for your bit manipulation, or a lisp dialect (hy) to send midi. The only thing I have to do is setup 16 bit values to be transmitted at the codec level. Right now I just send simple midi 0-127 values, which don't help for the 12 bit stuff you need here. I guess a device with modwheel to cv-out matrix routing would do the trick to send the propper CV value to your combinator.

EDIT: I really love the work you have been doing here. I think if rob would add an update to PSQ you could even setup the matrix with the sequencer to do the bit manipulation
I was really trying to keep things 'in the rack' with this, and I think I pushed the limits of what could be done. But I did it.

I've done some bitwise stuff in the remote codec lua. Unfortunately Remote locked in it's version of lua before all the handy bit functions were added. But it's possible. I just really didn't want to go back into it for this.

I'd love to try out you beta. Send me a pm!
If you ain't hip to the rare Housequake, shut up already.

Damn.

Jay Bird
Posts: 14
Joined: 25 May 2017

15 Feb 2018

Thanks Catblack. I love the PSQ and making generative music in Reason. I learned some stuff.

User avatar
emilng
Posts: 99
Joined: 03 Oct 2017

15 Feb 2018

theshoemaker wrote:
15 Feb 2018
What made me wonder is, why I can just have steps of 5 on the programmer inside the combinator, when selecting the min/max

Any ideas on this?
Thanks for the explanation of how 12 bit numbers work. That part I knew but I appreciate you taking the time out to explain it :)

The part that I didn't know was that you could change the custom scale setting using a combinator and that it would map to the shift register output in PSQ.

The min/max value in the combinator is changing by steps of 20 for me. I'm wondering if this depends on your screen resolution so the change amount is your screen resolution divided by the mouse pointer movement.

User avatar
theshoemaker
Posts: 595
Joined: 21 Nov 2015
Location: Germany
Contact:

16 Feb 2018

emilng wrote:
15 Feb 2018
theshoemaker wrote:
15 Feb 2018
What made me wonder is, why I can just have steps of 5 on the programmer inside the combinator, when selecting the min/max

Any ideas on this?
Thanks for the explanation of how 12 bit numbers work. That part I knew but I appreciate you taking the time out to explain it :)

The part that I didn't know was that you could change the custom scale setting using a combinator and that it would map to the shift register output in PSQ.

The min/max value in the combinator is changing by steps of 20 for me. I'm wondering if this depends on your screen resolution so the change amount is your screen resolution divided by the mouse pointer movement.
I just explained it in general for the other who may not know how the bit operations work.

The Min/Max stepping also depends on the settings for mouse sensitivity. I have to test this... I'll add a 16 bit value to my python remote codec and try to send it the values, so I can change this setting by CV form a thor instances modwheel > CV1 out > combinator > Programmer > CV 1 In > scales & chords. This whay it should be possible to set the needed values precisely.
:PUF_figure: latest :reason: V12 on MacOS Ventura

User avatar
theshoemaker
Posts: 595
Joined: 21 Nov 2015
Location: Germany
Contact:

16 Feb 2018

Catblack wrote:
14 Feb 2018
mataya wrote:
14 Feb 2018
Can't wait to try it after I finish my work.
I was always and still am confused about shift register. How does it work?
The PSQ1684 can output a Shift Register made up of a variable number of bits. (8 bit, 12 bit... up to 32 bits) In the case of the Scales and Chords Player, settable through the combinator, you have access to the Custom Scale through a combi. But it's a number from 0 to 4095. That means it's a 12 bit number, which is pretty impossible to dial in from a combi's rotary.

I've been thinking about how to do this for a long while. But basically that 12 bit number for a custom scale looks like this:

Code: Select all

C  =            1 = 1
C# =           10 = 2
D  =          100 = 4
D# =         1000 = 8
E  =        10000 = 16
F  =       100000 = 32
F# =      1000000 = 64
G  =     10000000 = 128
G# =    100000000 = 256
A  =   1000000000 = 512
A# =  10000000000 = 1024
B  = 100000000000 = 2048
I've been trying to create something that would let me add bits together to create random scales. But my math actually sucks (Using the DVC-1 Voltage Comparator,) and then I realized that the PSQ had a shift register. Here's a video of it working, NO AUDIO. Note how the bits displayed in the PSQ are reversed in the Player!



Now the PSQ has 600 patterns for it's shift register -- though I sort of wish it had a more direct access to each bit. (But maybe I'll make a RE that does that.) And those 600 patterns are 32 bit, so when you pare it down to 12 bits, you get some patterns repeating. And when a pulse is detected the bits shift over one.

The scales and chords player is the only place in Reason that I know of where any direct bit manipulation is useful. But great for that midi polyphony.

mataya wrote:
14 Feb 2018
"Bad Patch Format" error here.

M
Have you tried turning it off and on again? :D I've reuploaded it.
rcbuse wrote:PPSQ1684
Hey Rob,

maybe it's possible to combine the sequence output or the grid as binary cv output. So ... lets explain what I mean.

You have an option switch for the CV In/Out on the back, that says "binary" or something meaningful. When enabled,
All the Matrix opertions which point to this CV out do a binary operation (and, or, xor, ...) Hopefully selectable from some UI or in the setup menu.

The grid represents the binary index: A1=2**0 = 1, A2=2**1=2, A3=2**2=4 and so on.

This way we could have binary randomization for devices which use an encoding like this on the CV for the player
:PUF_figure: latest :reason: V12 on MacOS Ventura

User avatar
theshoemaker
Posts: 595
Joined: 21 Nov 2015
Location: Germany
Contact:

16 Feb 2018

Catblack wrote:
15 Feb 2018
theshoemaker wrote:
15 Feb 2018


If it helps you, I could provide you with a BETA of my RePlay - Python Scripting Codec for Remotable Items.
I was really trying to keep things 'in the rack' with this, and I think I pushed the limits of what could be done. But I did it.

I've done some bitwise stuff in the remote codec lua. Unfortunately Remote locked in it's version of lua before all the handy bit functions were added. But it's possible. I just really didn't want to go back into it for this.

I'd love to try out you beta. Send me a pm!
Here is a way for you to do it easily.

I've been stripping out and building a liitle bare bone script (where you can just send raw messages, without all the added functionality and automapping).

Use any codec of choice which has an input_item definition for "Pitch Bend" (I've been searching for the "xx yy" pattern for 14 bit values in the codecs folder). For example Oxygen3 form M-Audio. And add the proper mapping for the combinator, which would look like:

Code: Select all

Scope	Propellerheads	Combinator
Map	Pitch Bend		Pitch Bend
Setup and execute the MidiPort in your script. I personally use jupyter for this and sending midi from python to Reason (http://jupyter.org/install)

Code: Select all

# setup the midi port
from rtmidi import MidiOut

midi = MidiOut()
available_ports = midi.get_ports()
port_name = "MyCode MidiOut"
print(port_name)
if port_name in available_ports:
    midi.open_port()
else:
    midi.open_virtual_port(port_name)
The last thing you then have to do is Open reasons settings (I guess you know that part already), select the M-Audio codec (or other matching you selected) and put the "MyCode MidiOut" as In Port.

That's it, then you can execute the code.

Code: Select all

 
def midi14bit(val):
    return [int(val/128), int(val%128)]
 
# Send pitch bend "E" on Channel 1
midi.send_message([0xE0]+midi14bit(1|2|4|32))
I'm not sure whether I stil have a bug in this or why my bit operations don't work as expected.

EDIT: I think it's just an error, because it's not the 14bit value, but the 16 bit. Have to fix that.

EDIT2: Can't use the exact values by mapping to the pitch wheel, but executing the following code randomly selects the scale. The issue is, that the 14 bit value can't be mapped exactly to the 12 bit. I guess a RE would be best :)

Code: Select all

scale = random.getrandbits(14)
midi.send_message([0xE0]+midi14bit(scale))
I'll provide a codec later, which also has MidiIn support. This way you could use the external midi device with PSQ and send CVs to the script doing something with it and then setting the custom scale.
:PUF_figure: latest :reason: V12 on MacOS Ventura

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests