• jancsika

    @Balwyn Thanks, that helps. I think I can indeed just add the new pointer events and get multi-touch for data structures essentially for free.

    That's one of the great things about the web-- I can just throw a url up and anyone anywhere can run it and report back. No binaries needed. :)

    posted in technical issues read more
  • jancsika

    Did you install it from here:

    https://launchpad.net/~dr-graef/+archive/ubuntu/pd-l2ork.bionic

    Regardless, you should be able to paste that data url into any browser on your Surface Pro. Let me know if you can touch in both rectangles at the same time to move around each of the circles.

    posted in technical issues read more
  • jancsika

    @ablue It changes Pd's scheduler to this:

    int m_batchmain(void)
    {
        while (sys_quit != SYS_QUIT_QUIT)
            sched_tick();
        return (0);
    }
    

    In other words, it computes your audio blocks as fast as possible until the program halts.

    You can select this scheduler by starting Pd with the flag "-batch". (E.g., pd -batch foo.pd)

    posted in technical issues read more
  • jancsika

    @jancsika Oh, I may not even have to compile a binary for you to test this:

    Just use the data url below. You should see two simple rectangles with circles in them. You should be able to touch and drag the circles in each rectangle at the same time.

    This is just a test, so there are no bounds on the circles to keep them from extending outside the rectangles.

    I'm posting this from a Chromebook with no dev environment, so I can only create a data url for you. You should be able to copy the long line below and then paste it into a url bar of a browser running on your surface tablet. Let me know if that doesn't work.

    data:text/html;base64,PHN2ZyBzdHlsZT0idG91Y2gtYWN0aW9uOiBub25lOyIgd2lkdGg9IjQ1MCIgaGVpZ2h0PSI0NTAiPjxyZWN0IGlkPSJhIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PC9yZWN0PjxjaXJjbGUgaWQ9ImFjIiByPSIxMCIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2U9IndoaXRlIiBjeD0iMTAwIiBjeT0iMTAwIiBwb2ludGVyLWV2ZW50cz0ibm9uZSI+PC9jaXJjbGU+PHJlY3QgaWQ9ImIiIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIiB4PSIyMjAiPjwvcmVjdD48Y2lyY2xlIGlkPSJiYyIgcj0iMTAiIHN0cm9rZS13aWR0aD0iMSIgc3Ryb2tlPSJ3aGl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bnBvaW50ZXJtb3ZlID0gZnVuY3Rpb24oZSkgewqgIKAgoCCgIGJjLnNldEF0dHJpYnV0ZU5TKG51bGwsICJjeCIsIGUueCAtIDEwKTsKoCCgIKAgoCBiYy5zZXRBdHRyaWJ1dGVOUyhudWxsLCAiY3kiLCBlLnkgLSAxMCk7CqAgoCB9Owp9OwoKYi5vbnBvaW50ZXJ1cCA9IGZ1bmN0aW9uKGUpIHsKoCCgIGIucmVsZWFzZVBvaW50ZXJDYXB0dXJlKGUucG9pbnRlcklkKTsKoCCgIGIub25wb2ludGVybW92ZSA9IG51bGw7Cn0KPC9zY3JpcHQ+
    

    posted in technical issues read more
  • jancsika

    I'm pretty sure I don't need any hardware to do this. AFAICT it's just a matter of adding a few lines of code for pointerdown, pointermove, pointerup, etc. events and seeing if that meets your needs.

    The top row of your example could be implemented in Purr Data using [draw rect] and two [draw circle] objects. (Or replace the two circles with one [draw path].) The other row could be implemented, too, but I'm not exactly sure what they do.

    posted in technical issues read more
  • jancsika

    You should be able to use writesf~ to write continuously to disk during performance.

    In the main Pd thread (which is the one in which your patch is running) writesf~ will just write samples to a buffer every block, plus some other bookkeeping stuff. Reading an array of samples and writing it to another array is about the simplest thing a tilde object can do in Pd, so it should be realtime safe.

    There's a secondary (i.e., child) thread that actually writes the data to the disk. For simplicity, the code in the child thread will write data using a blocking system call. But even when writing to the disk takes longer than the time it takes to compute a block of samples in Pd, that's ok. Pd will just add more samples to the buffer, and the child thread will eventually catch up and write everything to disk. Your patch should continue computing audio in realtime with no dropouts.

    Using the current settings in Purr Data, it looks like you will start approaching a catastrophe if the child thread falls behind schedule by about 6 seconds. Operating systems don't technically make any guarantee about the maximum time a write to the disk. However, in practice if it takes that long for your computer to write some bytes to disk you've probably got bigger problems with your system. So in practice, you should be able to continuously record to disk without a problem.

    Also worth noting-- if Pd itself happens to take too long to compute audio (e.g., your patch uses too much CPU and you hear dropouts) then writesf~ will actually continue to work deterministically (i.e., you'll get the proper audio signal written to disk). This is because the child thread will wait until it has sufficient number of samples to write to the file. (Unlike your soundcard which has to deliver something on a clock, which is just zeros if there was a problem and Pd missed the deadline to deliver audio.)

    Edit: clarification

    Edit: another set of clarifications

    posted in technical issues read more
  • jancsika

    I took a look at the spec for multi touch. Given the current way I've implemented data structure events I think it's as easy as binding a function callback to three or four event listeners.

    I don't have any multi-touch screens. But I can go ahead and implement it and then you can let me know if it's a workable interface.

    posted in technical issues read more
  • jancsika

    I believe [pd~] was designed for this use case.

    The help patch for [pd~] should have an example inside it. Does it work for you?

    posted in technical issues read more
  • jancsika

    Just looking for a control surface, or something more complicated?

    posted in technical issues read more
  • jancsika

    @EEight It appears the pointerevents API supports multi-touch events. So at least the GUI toolkit used by Purr Data supports multi-touch.

    Probably the most user-friendly way of supporting it would be to add multi-touch capability to Pd's C API. That way you could be sliding a slider while simultaneously clicking a toggle. But adding that functionality happens to also be the most difficult and crash-prone from a development perspective.

    Currently, I'm doing an end-run around that C API with data structure events for [draw]. So I could add a message to that class that supports multi-touch notifications. Then you'd at least be able to draw a rectangle and then pick up multi-touch events inside the rectangle.

    If you're interested, put an issue up on the tracker and we can go from there:

    https://git.purrdata.net/jwilkes/purr-data/issues

    posted in technical issues read more

Internal error.

Oops! Looks like something went wrong!