mganss / pdjs

JavaScript External for Pure Data based on V8
BSD 3-Clause "New" or "Revised" License
67 stars 3 forks source link

Tasker/Scheduler #1

Open theslyprofessor opened 3 years ago

theslyprofessor commented 3 years ago

Hi, I LOVE this external. I've been doing a lot of work with pitch collections for my dissertation and I was wondering if there was a plan to roll out a scheduler, like the Tasker object that came with MaxMSP. It would come really in handy for timing my events.

Thanks, Nakul

mganss commented 3 years ago

Thanks. Do you mean the Task object? AFAICT it's similar to setInterval/setTimeout in the browser.

I have no plans to implement any of the additional objects that Max provides. But of course contributions are very welcome.

For this particular object I'm wondering if its functionality couldn't be easily emulated using a metro object that periodically calls a method in the js object.

If you do decide to implement this, it should live in its own set of Task.h/Task.cpp files and define a function that attaches a v8::FunctionTemplate to the global template.

theslyprofessor commented 3 years ago

That makes sense, thanks! Miller himself suggested the approach that you brought up because of the implications of low-priority scheduling when using a task object.