-
quiethorn
Thanks, guys. @whale-av I'll go over that patch and figure out how it works.
@LiamG I'll check out lists too, but long term my hope is to turn this into an Android app with libpd, so I think I need to stay away from externals, right? -
quiethorn
Thanks. I worked with [array size] a bit before and kinda got it working... make a bang to add/subtract 1 from the array size while adding/subtracting an index from it. But I don't know how to remove, for instance, the index of value 1.25 when it's in the middle of the array and have the array shrink to fit. I kinda wonder if it's just not possible and maybe I need to re-evaluate my approach to the whole thing.
-
quiethorn
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...?