ofelia is an external library which allows you to use openFrameworks and Lua within Pure Data to create cross-platform multimedia applications.
openFrameworks(aka OF) is an open source C++ toolkit for creative coding.
Lua is a powerful, efficient, lightweight, embeddable scripting language.
Pure Data(aka Pd) is a real-time visual programming language for multimedia.
Thanks to the Lua scripting feature, you can do text coding directly on a Pd patch or through a text editor which makes it easier to solve problems that are complicated to express in visual programming languages like Pd. And unlike compiled languages like C/C++, you can see the result immediately as you change code which enables faster workflow.
Using ofelia, you can flexibly choose between patching and coding style depending on the situation.
For patching style, ofelia currently provides over 300 abstactions which cover the following features of openFrameworks.
- ofAppRunner: contains functions for getting and setting the properties of the window.
- ofBaseApp: contains callback functions such as setup, update, draw and keyPressed.
- ofGraphics: has several functions to change the state of the graphics pipeline and allows to quickly draw 2d shapes.
- ofImage: allows to load, save and draw images and do basic transformations on them.
- ofTrueTypeFont: can load true type fonts in different formats and draw text using the loaded font.
- of3dGraphics: contains some functions to quickly draw the most used 3d shapes like spheres, cones and boxes.
- of3dUtils: allows to draw 3d utililty objects such as arrows, axis and grid.
- ofMath: contains functions for various mathematical operations like calculating the distance between two points.
- ofUtils: contains different functions for varied purposes, from string manipulation to time functions.
- ofSystemUtils: contains functions for creating message and file opening and saving dialogs.
The abstractions use the same function names, arguments and return types as the original openFrameworks API so users can easily learn about them and transfer from one to another when needed.
There is only one slight difference in function and class names. For exmaple,
ofDrawCirclein openFrameworks becomes
ofImagein openFrameworks becomes
The help files for the abstractions currently don't exist but you can learn about them from one of the openFrameworks documentation pages above or you can simply google the name of the function to find the page.
ofDrawCircle to learn about
of.drawCircle abstraction in ofelia)
Although more abstractions will be added later, you can already use all openFrameworks features using [ofelia] object which allows you to code Lua and OF API bindings on a Pd patch or create such abstractions yourself. See the object help file to learn how to use it.
The library is available to be used under macOS, Windows, Linux and Raspberry Pi. (64bit only on macOS and Linux)
- Make sure you have Pure Data installed on your desktop.
- Start Pd and go to
Find externals, then search for
- Select the proper version of ofelia for your system to download and install.
- Try opening patches inside the downloaded
- (Windows) If the library fails to load, open
vc_redistexecutable file inside
ofeliadirectory to install Microsoft Visual C++ Redistributable packages.
- (Linux, Raspberry Pi) If the library fails to load, open the Terminal and run the following command to install dependencies.
cd ofelia/scripts/distro_name sudo ./install_dependencies.sh
Contributing to ofelia
You can contribute to ofelia by reporting bugs, creating the missing
of abstractions or by sharing your own custom abstractions. Please open an issue or contact the author if you have any questions or suggestions.
ofxOfelia is ofelia packaged as an openFrameworks addon which enables you to create a standalone application for macOS, Windows, Linux, Raspberry Pi, iOS and Android that can run Pd patches made with ofelia and Pd vanilla objects.
You can share the application with a wide range of audiences including non-Pd users and mobile device users.
In order to use ofxOfelia, you first need to download and install openFrameworks. Please follow the setup guides to download and install openFrameworks. The following tools are used to build ofxOfelia project.
- macOS / iOS : Xcode.
- Linux / Raspberry Pi : Makefile.
- Windows : Visual Studio Community 2017.
- Android : Android Studio.
The setup guide and examples for creating standalone project will be ready soon.
You can help developing ofxOfelia on GitHub: https://github.com/cuinjune/ofxOfelia
Create an account, clone or fork the repo, then request a push/merge.
Feel free to contact the author if you have any questions or suggestions.
Projects that used ofelia/ofxOfelia
- Bruno Rohde: ESMERIL.
- Virtual Insight: World of Piano.
- The Center for Haptic Audio Interaction Reseach: instrument development.
- Martin Hiendl: Ten Bullets Through One Hole.
- POLR Technologies: LIQUID GRID.
I would like to thank Miller Puckette and the Pd community for developing and maintaining Pd, Dan Wilcox for developing ofxLua, ofxPd and ofxMidi which ofelia/ofxOfelia uses, IOhannes M Zmölnig for developing GEM which has greatly influenced ofelia, Arturo Castro, Theodore Watson and the OF community for developing and maintaining openFrameworks and answering so many questions, Henri Menke for consulting on Lua design matters, and many others who contributed to the development of ofelia.
Copyright (c) 2018 Zack Lee: email@example.com
GNU General Public License v3.0
For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "LICENSE.txt," in this distribution.