Hi! Do you know how can I fill an arbitrarily sized array with a line strip? The goal is to write square, sawtooth, triangular and other simple waves like that and then loop with tabread4~. The array size can be reconfigured, so I don't want to load the table from a presampled file but instead to resample it from the original function when the array is resized. Doing it with line~ is too awkward, scheduling delays and like that, and I guess timing will be wrong cause delays are triggered during control phase, which in general won't be exactly when desired except in case that block size == 1. Is there any object which outputs a strip of line segments? Or perhaps a message to fill the array alla cosinesum? Thank you in advance. Regards, Carlos
Hola Carlos,
Carlos Pita wrote:
Hi! Do you know how can I fill an arbitrarily sized array with a line strip? The goal is to write square, sawtooth, triangular and other simple waves like that and then loop with tabread4~.
Have a look at the MiniMoog emulator which Patrick Sanan made for Tom Erbe's UCSD class on computer music:
http://music.ucsd.edu/~tre/SananMiniMoog.zip
What was interesting was that he chose to write his own arrays rather then use ready-made oscillators. Dig in a little and you'll find them. It's really an amazingly well-made patch!
Did you find the [switch~] patch I sent useful?
d.
Hallo, Carlos Pita hat gesagt: // Carlos Pita wrote:
Do you know how can I fill an arbitrarily sized array with a line strip? The goal is to write square, sawtooth, triangular and other simple waves like that and then loop with tabread4~. The array size can be reconfigured, so I don't want to load the table from a presampled file but instead to resample it from the original function when the array is resized. Doing it with line~ is too awkward, scheduling delays and like that, and
...
You can use [vline~] instead, which accepts messages consisting of line segments and is not limited to only one segment.
See attached patch for one possible way to use it. It would need some tinkering to adapt to variable array sizes, but I hope, the basic principle becomes clear, the only thing left to do is scaling the values send to vline~ dynamically to match the current array size. And of course you'd need to decide on a way how to specify the line segments in regard to array size (like: going from 0 to 1 over half the array size could become a message like: [0 1 0.5(, then you'd need to multiply 0.5 with the arraysize and divide by samplerate/1000.)
Frank Barknecht _ ______footils.org__
_ __latest track: "scans" _ http://footils.org/cms/show/41