Controlling the parameters of the waveform object

Trix's icon

Hi i am new to MAX and i am currently designing a simple glitch software plug-in, the plug-in is currently in its early stages but i have decided to create the glitch in the audio by manipulation of the waveform, i have the buffer moving randomly throughout the audio file which works nicely and creates some interesting sounds but i have come across a problem, the parameters of the buffer are set but i need them to change automatically when i switch to different audio files, for example- the problem is that if i am working with a 10sec audio file and then changed to a 5sec audio file, the parameters would be twice as wide as they needed to be so the buffer would frequently be reading nothing producing no sound. If anyone has any ideas or patches that would help me it would be much appreciated.
many thanks
Rich

Fora's icon

Have a look at the [info~] object, use the 7th outlet to get the sample length.

Trix's icon

Hi many thanks Fora, exactly what i needed- have another issue tho... i need to find a way to get the number that is generated that tells me the sample length into the urn~ so that the parameter is the same as the number generated by the info~
The number is generated in the message box but not sure how to get it into the urn~ ?
I will upload a screenshot of that part of my patch to help show what i mean

4968.Screenshot20130130at18.27.23.png
png
Trix's icon

As you can see the correct value reaches the number box above the urn~ but the range of urn~ stays at 999 instead of the value 22029

mzed's icon

Arguments in an object box do not update when the value is changed with a message in the right inlet.

Trix's icon

Yes you are correct and this is what i have discovered, so how can i update the value of the urn~ object?

Helmuth's icon

Give a look, may clarifying it to you

Max Patch
Copy patch and select New From Clipboard in Max.

Trix's icon

Thank you Helmuth, this has helped a lot, exactly what i was trying to achieve

Trix's icon

When i use your patch it works perfectly although when i use this with my value it doesn't seem to work? I am confused as to why it wont, i will post up patch so you can see, i apologize in advance if its a schoolboy error as i am a novice at using software like this, many thanks.

Trix's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Stephane Morisse's icon

I've just been into Max for to years now but my advice would be to follow the vers first tutorials about the basic objects And the way they work, you Will gain a lot of Time !

Trix's icon

ok, yes i have been and will continue to look at the basic tutorials although i still would appreciate an answer to why my patch wont work properly, it is the same as the patch Helmuth posted except has a different value and Helmuths patch works fine. any ideas why this is so would be much appreciated, thanks

Helmuth's icon

Urn seems to be limited to the maximum of 4096 numbers, (otherwise I get an notice in the max window. ) cycling support may confirm it?

Max Patch
Copy patch and select New From Clipboard in Max.

Best
(sorry Trix, I saw your message only now)

Trix's icon

Many thanks again Helmuth-i dont think i would have found that information from a basic tutorial lol, i think in that case i will try and rethink my approach

ulodin's icon
Max Patch
Copy patch and select New From Clipboard in Max.

You may achieve your goal using a couple (or more) of urn object whose sizes are divided properly, something like this:

otherwise random object seems to have no limits about size, but it has little differencies...

Trix's icon

I have tried it using the random object instead but it only seems to count down from the original value and stops when it reaches 0?

Trix's icon

Just realised I had accidentally created a loop so please ignore the last post