• 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

Internal error.

Oops! Looks like something went wrong!