• Jona

    @ingox Thanks. PdWebParty https://github.com/cuinjune/PdWebParty can do that too, but its a different approach, so I think they compliment each other. I basically just use Emscripten with Open Frameworks and ofxOfelia. But I had to make some changes to make Emscripten work again, and I extended some things (and there is still room for improvement ;)).

    posted in patch~ read more
  • Jona

    @JackOats Thank you. I will continue to work on the sound synthesis and sequencing possibilities after I fixed the last technical Emscripten issues.

    posted in patch~ read more
  • Jona

    @jaffasplaffa Thank you. Couldnt test it on a Mac by myself yet (I heard Macs do handle audio quite well...).
    Recording should be possible (in theory).

    posted in patch~ read more
  • Jona

    I posted the Emscripten Website which is based on a Pure Data / Ofelia patch some time ago.
    But I made some improvements and would like to get some feedback if there is a large audio latency or if there is a lot of audio distortion with certain browsers, os or devices: https://simplesequencer.handmadeproductions.de/
    My experience is, that it works well with the current audio buffersize of 2048 with Firefox and Chrome on my desktop computer (Linux and Windows), and with some distortion on my Android smartphone.

    posted in patch~ read more
  • Jona

    In https://github.com/openframeworks/openFrameworks/blob/master/addons/ofxEmscripten/libs/html5audio/lib/emscripten/library_html5audio.js replace:

    var context = new AudioContext;
    

    with:

    var context = new AudioContext({
                latencyHint: "interactive",
                sampleRate: 44100
    });
    

    Or whatever sample rate you have choosen for your project. This will prevent playing the sound with the wrong tempo and pitch (if the sample rate from the sound card is different from the project sample rate). latencyHint: "interactive" is not really neccessary, because it is the default.

    posted in pixel# read more
  • Jona

    If using webgl2 you need to edit the compiled .js file.
    search for:

    var ctx = canvas.getContext("webgl", webGLContextAttributes);
    

    and change it to:

    var ctx = canvas.getContext("webgl2", webGLContextAttributes);
    

    Maybe it is also solvable with an Emscripten compile flag or with editing the file library_webgl.js in the emsdk directory.
    Edit: Not necessary anymore after the changes I made.

    posted in pixel# read more
  • Jona

    Here are the new elements in use, its basically a modification of the PD example C08.analog.sequencer.pd: https://arrays.handmadeproductions.de/

    posted in pixel# read more
  • Jona

    I thought maybe it is a good idea to collect Emscripten behavior / bugs that differ from Ofelia without Emscripten.

    Five things for now:

    [cos~] does not work, [expr~ cos(2 * 3.14159 * $v1)] does.
    [array] does not work, but [array define] does.
    ofSetLineWidth() does not work.
    I need to set the ticksPerBuffer in ofApp.cpp from 8 to between 16 and 64, depending on the complexity of the patch and the power of the computer for avoiding audio glitches and artifacts (maybe there is a way to optimize it).
    Shader need to be ported from GLSL to GLES or directly written in GLES.

    posted in pixel# read more
  • Jona

    @ostorni redarding audio latency: this is the shortest audio latency without artifacts that seems to work for me, sadly its still around 100-200 ms (also depending on the complexity of the patch)... Its really nice that the Pure Data audio stuff can run in a browser, but would be much better if the latency could be improved...

    https://simplesequencer.handmadeproductions.de/

    Here is something about the (not yet implemented) audioWorklet technology, which sounds quite promising (not sure, if OF could be a another bottleneck in this case): https://hacks.mozilla.org/2020/05/high-performance-web-audio-with-audioworklet-in-firefox/

    Another drawback: While it seems to work very well on my desktop computer, my Android phone seems to be too slow for the Emscripten stuff...

    posted in libpd / webpd read more
  • Jona

    @ostorni Sounds very interesting, but never used gdpd. In my opinion Ofelia with Emscripten is relatively painless regarding some basic stuff, but it has its quirks (mainly due to using Open GL ES instead of Open GL) and issues that are solvable with enough experience, I guess (some things I just do not understand...). Still, it has a lot of potential if its developed further (I started to implement WebMIDI for example, which works quite well, but is coded in a messy way)... Also audio latency could be improved using AudioWorkletNode instead of ScriptProcessorNode... I think there are also some issues with the current OF / Emscripten combination, that are possibly solved in the future (already opened a few Github issues)...

    posted in libpd / webpd read more

Internal error.

Oops! Looks like something went wrong!