Listogram? (help with data management)
Hello everybody. I am trying to create a live sampling patch for a course I am on which interacts with a hand percussionist, and was hoping for some help.
My current hang up is this:
I am using various objects to gather spectral aspects of the sound- for now I am keeping it relatively simple and using centroid~, segment~, and maybe noisiness~ to give me the spectral average, attack count, and aperiodicity respectively.
I am attempting to gather this coninuous stream of data and pack it into a lists of exactly 128 steps of length, each of which I will scale into a value between 0-8.
The reason I am doing this is to have step sequence patterns which correlate to a sort of histogram of various aspects of performance- time between attacks, volume, etc, which then playback in response to the player.
I am easily able to collate a list of 128 values using zl group, scale them to 0-8 using a list scale object, which feeds a multislider, which feeds a sequencer…
However, what I really need is something that will take a history of data that is an arbitrary length, say a list of 582 values for example- and ‘quantize’ them into a list that is 128 values long and between 0-8 values high that resembles the larger list, albeit more ‘stepped’, and I need to be able to do it with a "bang", when the current playing sequence ends.
Any guidance, magic object suggestions, vague hints, or different approaches would be greatly appreciated.
> Any guidance, magic object suggestions, vague hints, or different
> approaches would be greatly appreciated.
Did you have a look at histo and table objects?
Or, if you have jitter: jit.histogram
Hope this helps,
Thnak you for your reply. Yes, I’ve looked at table- I am pretty much using multi slider in the same way- I’ve looked at histogram, but I can’t see how it might solve my problem, unless I’m missing something.
I need to take running tab of incoming values of an arbitrary length, and squash them down into a list of 128 values at any given moment, when a bang is recieved…That list need to be a quantized representation of the longer list…. I have figured out how to scale the values vertically (using mxj ej.lscale), but I can’t figure out how to do it horizontally- that is the problem….
hi Jeremy – here’s how I’d do it:
First step would be storing the arbitrarily long list, then, when a bang is received, use [zl len] to get the length, and then divide that number by the length of the list you want to end up with.
- say you’re list was 356 members long, you would get 356/128 = roughly 2.78. Round that up to nearest int, and split the list into chunks of that size (3), run it through [mean] and pack it back down as a list (uzi?)
What you end up with is a patch that quantizes and averages at the same time, spewing out close-enough looking 128-long lists.
This is of course of the top of my head, so there could be stuff missing, but that’s the way I would go, at least.
Excellent! That is the ticket. That is exactly what I want- a quantized semblance of the shape over time.
This solution should work perfectly for what I want it to do. I will experiment with zl length and perhaps slice and see what I come up with..I have a feeling I can pack it all back using zl group….
Thank you very much for the insight!