record~, how can I tell it's finished?

Sep 6, 2010 at 9:22pm

record~, how can I tell it's finished?

I’m using a record~ object to record audio into a buffer. I have a toggle box connected to it to start/stop recording. However, I want a bang message when the record~ has finished, which is when the signal that comes out from the object box has gone from 0 to 1. I want this bang to trigger a “send 0″ message to the toggle box, to indicate that the record~ has finished its job. How can I achieve that?
- Eirik

#52136
Sep 6, 2010 at 9:31pm

This seems easy, but can you be a little clearer as to your patch? Because I’m not very bright, “when the signal that comes from the object box has gone from 0 to 1″ for example is not very clear. Have you used the [select] object before?

Brendan

#187359
Sep 6, 2010 at 9:43pm

ps

– Pasted Max Patch, click to expand. –

[attachment=140950,1088]

Attachments:
  1. stopRec.jpg
#187360
Sep 6, 2010 at 10:46pm

Here’s a slightly more elegant way of doing it. The record object outputs a sync signal, which shows the record position as a value between 0 and 1. Therefore, when the value is 1., recording is finished. So we simply convert the signal into a float value and test it to see if the value equals 1. If it does, a message to reset the toggle box back to 0 is triggered.

– Pasted Max Patch, click to expand. –
#187361
Sep 7, 2010 at 2:01am

iterating from David’s patch, you can get even simpler if you just use change~(signal version) into edge~ like so:

– Pasted Max Patch, click to expand. –

@Brendan, i love the new username! cheers, my fellow noobian!

___________________________________________
*Never fear, Noob4Life was never here!*

#187362
Sep 7, 2010 at 2:45am

iterating from David’s patch, you can get even simpler if you just use change~(signal version) into edge~ like so:

Not only simplier, but [snapshot~] and [number~] can be a significant waste of CPU at times.

Using [==~] instead of [change~] will make this even more efficient. For example:

– Pasted Max Patch, click to expand. –

This includes another (*SUPER* minor) optimization: using [trigger] instead of a message box when you don’t actually need to click the message.

#187363
Sep 7, 2010 at 6:52am

OK,
now it’s clear what “when the signal from the object box goes from 0 to 1″ means; told you I wasn’t too bright, hence the name change Noob4Life!

Brendan

#187364
Sep 7, 2010 at 9:09pm

Thank you! This was very helpful.
I also extended it a bit – connected a toggle to a “loop $1″ sending to the record~. At the same time, this toggle sends a message to a “!- 1″ object, which controls the opening of a “gate 1 1″ object. With this setup, a bang will not be sent if the loop setting on the record~ is turned on.

#187365
Sep 7, 2010 at 11:29pm

“hence the name change Noob4Life!”

is that why? here i thought it was because you were modest and were kicking dirt in the face to shallow labels conceived by a shallow video-game industry(where the word, “noob” originated along with the opposite word, “leet”(meaning elite) or more specifically, “733t”). Terms which have more place in hazing rituals among fraternities consisting of meathead jocks than here within the supposedly ‘intelligent’ technology sector.

i certainly have seen too much from you here to ever think of you as truly being a max noob, Brendan(give yourself more credit).
:)

#187366
Sep 8, 2010 at 6:49pm

@Noob4Life
haha

The reason(s) behind the name change, like my fluency in Max, is constantly changing – on the day I changed it, I noticed that all my solution-replies were to Max beginners, simple problems; whereas the more complex challenges left me stumped,

hey ho

ps
“i certainly have seen too much from you here to ever think of you as truly being a max noob, Brendan(give yourself more credit)”

I have good days and bad days

Brendan

#187367

You must be logged in to reply to this topic.