Hi. I built a weird little synthesizer as a web app at http://ji.quiethorn.com. I'm trying to replicate this in Pd but not sure how to manipulate Pd's arrays to do what I want. The way the web app works is
- it stores the ratios (fractions by which to multiply a base pitch) in an array
- then periodically chooses a random index from the array at the set tempo
- multiples the ratio value at that index with the base pitch
- and fires the oscillator at that new pitch
Ratios are added to/removed from the array by toggling them on and off in the display. This is the particular part I don't know how to replicate in Pd. In most languages (Javascript, Java, Python, etc.), you can append/remove an item in an array and the array will length will grow or shrink as needed, but this doesn't seem to be how Pd's arrays work. I kind of got it working somehow, but it's so convoluted and incomplete that I'm hoping there's just an easier way I'm missing.
I guess I need to have a metro that bangs a random generator, which generates an integer between 0 and a variable representing the length of the array, and also to be able to easily add and remove ratios (represented by floats) into the array by banging message or something...?