how to use visual shapes to modulate a sound?
Hello,
I have no idea whether my approach is possible, but what I am trying to do is to migrate a shape into the "buffer~" or "function" object that I can use the shape for sound modulation like an amp or filter modulation.
To be specific, let's assume that I create a circle or rectangle in the "jit.lcd" with a "paintoval" or "paintrect" message (please see image 01 and I also attached my patch below) and then what I want to do next is to draw an envelope curve (in the function object) or a waveform (in the buffer~ object) based on the shape (something like image 02 below).
No matter how hard I try, nothing comes up to me. I am wondering if it is possible to realize my idea. Thank you so much.


This could be a starting point
@FEDERICOFOD this is really awesome!! Since I cannot use the same "paintoval" message and its argument to draw an envelope curve, I have been thinking of edge detection but I didn't know how. I will take a look at your patch first and let you know if I have any questions. Thank you so much!!
Great! Let me know how it goes
Hello @FEDERICO-AMAZINGMAXSTUFF,
I would like to ask a couple of my questions.
I am really into your approach here, so I want to fully understand your "jit.gen" object inside to go further and make some improvements. I've never used the "gen" object before so please consider that I am not familiar with the code inside.
Your "jit.gen" code seems like that it reads the jit.lcd horizontally and draw a waveform base on the upper half of the shape.
My current goal is to create two types of a buffer like the below "image 01". Instead of scanning "jit.lcd" horizontally, what I am trying to do is to scan "jit.lcd" vertically (top to bottom) for the "a" section and read it one more time (bottom to top) for the "b" section. Will it be difficult to implement this approach in gen? I was hoping that I could do this on my own but I am having a hard time understanding your code inside, would you be able to leave comments on what each line means by any chance? Thank you for your time!

Hey @UFORACHANGE, no this would not be difficult.
Maybe my approach is even overkill, but basically it uses a for loop to go through all the cells in the matrix and stops when it encounters a cell that doesn't contains zeros. So in this way you can reconstruct the shape as an envelope for audio.
To implement it the other way around simply start at the end of the matrix with the for loop and come up until you find a cell that doesn't contains zeros : )
Thank you for keeping me updated. Sorry for asking too many questions, but it would be great if I can learn this new approach using gen. I left my questions as comments inside the codebox, so can you please take a look at it when you're available? It would be really helpful if I can get through this because I have been thinking of doing this way(converting the edge to the waveform) but I could not make it. I really appreciate your time.