• cuinjune

    @miguellacorte Yes, I tried WebPD a while ago but as I recall there were quite a few vanilla objects that are not supported, but it might be your option if your project can be done with the objects it supports. And it will be easier to setup than the projects I mentioned above.

    posted in technical issues read more
  • cuinjune

    Hi, I think you can take a look at https://mathr.co.uk/empd/ to compile Pd to Javascript and Web Assembly.

    There's also Purr Data on the Web:


    but it's in alpha stage and still in development so I would say it's not really ready to be used. But you can try the demo and learn about it from https://git.purrdata.net/jwilkes/purr-data/-/tree/emscripten/emscripten/project/purr-data

    I'm planning to build something like PdParty / PdDroidParty for the web browser in a few weeks.
    It will allow the user to drag and drop a patch onto the webpage to load the patch and share the patch using the URL with the patch data appended. If this is successfully done, I will post it here and you could probably use it for your project. But you will still need to use Javascript to gather such data and use it as an input for a patch.

    posted in technical issues read more
  • cuinjune

    @cuinjune Nevermind, I got an answer to my question from @alexandros
    He said I simply need to add [declare -path ofelia/abs] to patches so the listener objects can be created as abstractions.

    posted in pixel# read more
  • cuinjune

    This patch should work as expected: ofelia.movie.pd

    The problem is in [ofelia.movie]'s M.pointer(p) and M.bang() functions.

    You need to call videoplayer:unbind() to unbind the video texture after it is being bound to the cube.

    But return videoplayer; will output a value and end the function immediately so you need to use the Ofelia's built-in ofOutlet() class to output a value without ending the function.

    So you can create an outlet variable with local outlet = ofOutlet(this);

    And then use it in these functions to output a value:

    function M.pointer(p);
    videoplayer:update();
    videoplayer:bind();
    outlet:outletPointer(0, videoplayer);
    videoplayer:unbind();
    end;
    
    function M.bang();
    videoplayer:update();
    videoplayer:bind();
    outlet:outletPointer(0, videoplayer);
    videoplayer:unbind();
    end;
    

    The first argument of outletPointer() specifies the index of outlet, and the second is the value to output.

    Now, whenever it binds the video texture to a cube (or other shapes), it will unbind it.

    I hope this helps.

    posted in pixel# read more
  • cuinjune

    @60hz Hi, I just found this. Thanks for the amazing work!
    I tried your patches and they work fine with Ofelia v3 but not with the latest v4.

    Do you have one that works with v4? If not, do I need to just replace the listener objects (e.g. [ofDraw]) with the abstractions in v4? Any tips on how I can make your abstractions also work in v4?

    posted in pixel# read more
  • cuinjune

    Hi, Ofelia v4.0.0 is now available on Deken.

    Changes:

    • removed all embedded objects
    • updated Pd source files to Pd-0.51-0
    • removed ofxJSON, ofxJsonSettings, ofxOsc, ofxReverb, and ofxZipPass addons
    • rebuilt using openFrameworks 0.11.0
    • updated abstractions and examples

    For more information, visit https://github.com/cuinjune/Ofelia
    Thanks!

    Logo.png
    Iteration.png
    GLSL.png

    posted in news read more
  • cuinjune

    @cuinjune Adding the [vline~] at the end produced a clean square waveform sound. Thank you!

    answer.png

    posted in technical issues read more
  • cuinjune

    Hi, I have a silly question.

    Let's say I'm receiving 1 and -1 alternately from outside of Pd which changes fast. (e.g. 2ms)

    How can I reliably translate them to audio in Pd so I can hear the square waveform sound?

    test.png

    posted in technical issues read more
  • cuinjune

    @Jona Hi man, sorry for the late reply and thanks for sharing your GUI work and example you ported.

    I'm glad you found out the way to make your abstractions work.

    However, in my chrome browser, the audio was glitchy so I changed const int ticksPerBuffer = 8; to const int ticksPerBuffer = 32; and now it seems to work fine. I also updated this in Ofelia Github repo: https://github.com/cuinjune/Ofelia/commit/b4b0b11872574eb1046e3b15cc9011982559ad42

    Could you please update the ofelia3_toggle_slider_osc_lis_abstractions.zip patch in your original post and also, rebuild the project using const int ticksPerBuffer = 32; and update files in http://puredata.handmadeproductions.de/?

    I'm not sure if I can make MIDI work in the browser or not. I will have to try different things or ask people around.

    posted in abstract~ read more
  • cuinjune

    You can now run Ofelia patches in your web browser using Emscripten.

    Here are the instructions if you're interested: https://github.com/cuinjune/ofxOfelia#running-the-emscripten-example-in-a-web-browser


    GitHub repo: https://github.com/cuinjune/ofxOfelia
    User group: https://www.facebook.com/groups/ofeliausers


    Emscripten.png

    posted in news read more
  • cuinjune

    Hi, Ofelia v3.0.1 is now available on Deken.

    Changes:

    • Added more examples (3d, drawing, math..)
    • Fixed type checking issue in "ofxOfeliaPdBindings.i"
    • Fixed bug when outputting a table with a string key using ofOutlet()
    • ofArray's array elements can be accessed using square brackets

    Thanks!
    screenshot.png

    posted in news read more
  • cuinjune

    Here's the patch: test.pd

    Screen Shot 2019-08-25 at 4.24.49 PM.png

    posted in technical issues read more
  • cuinjune

    @Jona Yes, M is just an alias for ofelia module table.

    The actual full script that runs in Lua when you create [ofelia define foo] object is like the following:

     local name = "foo"
     package.preload[name] = nil
     package.loaded[name] = nil
     package.preload[name] = function(this)
     local ofelia = {}
     local M = ofelia
    -- Your written script will be here. 
     return M
     end
    

    And sending the 'bang' message to this object will run the following script:

    local m = require("foo")
    if type(m.bang) == "function" then
      return m:bang() -- the object will output the returned value through its outlet
    end
    

    I added M since it's easier to write and the script can be shorter. Also, M is commonly used in Lua as a variable name for a module table.

    Therefore, you should not reassign anything to M or ofelia in almost any case since it can be problematic.

    posted in patch~ read more
  • cuinjune

    Logo.png
    Iteration.png
    GLSL.png
    Hi, I'm happy to announce the new version of ofelia.
    ofelia is a Pd external which allows you to use openFrameworks and Lua.

    The new version provides all available openFrameworks functions and class methods as Pd objects. (1,770 objects) Meaning, you don't need to write Lua scripts to use unsupported feature since they all exist as Pd objects.

    Also, ofelia now provides documentation for all objects. You can simply double click on any object to open the help file or the documentation page in your browser. You can see a full categorized list of objects from the "help-intro.pd" patch.

    Lastly, you can create a standalone application for macOS, Windows, Linux, Raspbian, iOS and Android using ofxOfelia, an openFrameworks addon for ofelia. It will be also possible to create web applications using ofelia soon.

    For more information, please visit https://github.com/cuinjune/ofxOfelia
    Also, please join Ofelia user group: https://www.facebook.com/groups/ofeliausers

    Main changes:

    • all available global functions and class methods from Lua bindings are embedded as objects
    • all embedded objects use "of" prefix for consistency
    • added [ofRequire], [ofExpr], [ofExpr~], [ofIf], [ofIf~], [ofFor], [ofTable], [ofJson], [ofReverb~], [ofOscSender], [ofOscReceiver], [ofUnZip], [ofUnZipPass] and [ofMakeFileName]

    Any feedback is welcomed, hope you like it.

    posted in news read more
  • cuinjune

    @lamviec4 Hi, the same question was asked in the past. Please check the post below:

    https://forum.pdpatchrepo.info/topic/12181/ofelia-expected-float-got-number/2

    posted in technical issues read more
  • cuinjune

    @Jona Thanks for sharing the patch and video.

    The delay effect works nicely and it is pretty efficient to run the patch. (12~15% CPU usage)

    posted in patch~ read more
  • cuinjune

    @Jona std::deque (double-ended queue) is an indexed sequence container used to store data types (number, string, classes...etc) in C++. There are many other containers such as std::array, std::vector and std::list in C++. (like [array] and [list] in Pd) These containers work similarly in some way and some are preferred over others depending on cases.

    In Lua, there is only one container type: the table. So you should be able to create and use such a frame buffer to store data such as ofPixels class.

    For example, a table that holds two ofPixels data would look like this:

    local t = {}
    t[1] = ofPixels()
    t[2] = ofPixels()
    

    You can append/prepend/insert data to the table or remove/modify the element. basically anything that std::deque can do.
    It should be fast enough to use unless you use it to store and modify a large number of pixels. storing some frames would be fine.
    You will be able to find some tutorials about Lua table from google.

    posted in technical issues read more
  • cuinjune

    @Jona Hi, ofColor::getHsb() function takes float &hue, float &saturation, float &brightness arguments.

    In C++, a function can expect arguments to be passed by reference which means the reference to the variable will be passed to the function instead of copied alias. It is used when you need to reuse the passed variables after calling the function. Sometimes, it is also used to create a getter function that returns multiple variables just like ofColor::getHsb().

    You will understand what I mean if you see the example code: https://openframeworks.cc/documentation/types/ofColor/#show_getHsb

    Unfortunately, Lua doesn't have such pass by reference feature, so currently you can't expect ofColor::getHsb() function to work like it works in C++. Instead, you would need to use ofColor::getHue(), ofColor::getSaturation() and ofColor::getBrightness().

    There are a few getter functions that work like ofColor::getHsb() in openFrameworks and I can make them work in Lua with some modification in SWIG interface. (e.g. make the function return a table instead)

    Please feel free to report if you find such unsupported functions. I will try to support them as soon as possible.

    posted in technical issues read more
  • cuinjune

    @Jona I don't know how easy or difficult it would be to design the shader effect chain but If you can implement multiple shader effects in one [ofelia] object, it won't be difficult to split it into multiple [ofelia] objects that work in chain. So first, I would suggest you try to implement two shader effect chain in one [ofelia] object and then try to split it into two [ofelia] objects.
    I think this post might be helpful: https://gamedev.stackexchange.com/questions/22216/using-multiple-shaders

    posted in technical issues read more
  • cuinjune

    @Jona I think it's because your two images have RGB color space and don't have an alpha channel.

    Screen Shot 2019-06-30 at 3.02.23 PM.png

    posted in abstract~ read more
Internal error.

Oops! Looks like something went wrong!