Reverse of sprintf? / Converting formatted message from string
Hello, well this is infuriatingly simple but I cannot come up with any ideas perhaps due to my limited understanding of sprintf / C+
I have a M4L patch pasted below where I want to trigger a bang when a formatted message crosses a threshold. I am successfully doing this but I'm curious if it is possible another way...
In this case I want to know if I can take a message in the format hour:min:sec:ms like 00:00:30:000 and unpack that the way fromsymbol works with a message like "blah yah boo." Am I insane or are these colons a problem? I've looked at regexp too but cannot get that to work. The doc on sprintf below suggests sscanf is what I'm looking for perhaps, but in the Max world?
As always, thanks for any help on informing me what an idiot I am.
C
If you just want it to work like fromsymbol, you can actually use fromsymbol @separator : and it will output the time as a list without the colons.
If you are interested to see how to do that with regexp, check out the following patch. Hope that is helpful!
bless your heart! yes, perfection. thanks so much.
hmm.. I posted the same use of regexp your other thread of the same name (!). I guess I'll repost my reply in your rethread. ha.
You can hit it from two angles.. Either create a list from the sprintf'd format with regexp or bypass the sprintf formatting and output a secondary list of time values from the subpatch. In either case, sel isn't gonna hack it. match is the ticket.
-
-
sorry on that rethread, must have double-clicked on post yet i cannot figure out how to erase it.
this is so helpful - match is my new favorite object!
yeah, it works just like a combination lock. It's great.