ofelia: deque class
@Cuinjune I tried to create a video frame table ("circular video buffer").
It is possible to read (draw) video from the table but somehow only the current frame is stored at every position of the table.
Here is an example patch. "frames" is the frame table. "N" is the table size. At the left is the texture from the table, at the right the original video. Do you know what I do wrong?
I also tried ofPixels instead of ofTexture with the same result.
And I tried to store several images (jpg´s) instead of video to the frame buffer, which does probably work because each image has its own source.
;
if type(window) ~= "userdata" then;
window = ofWindow();
end;
;
local canvas = pdCanvas(this);
local clock = pdClock(this, "setup");
local videoPlayer = ofVideoPlayer();
local outputList = {};
local frames = {};
local N = 150;
;
function ofelia.bang();
ofWindow.addListener("setup", this);
ofWindow.addListener("update", this);
ofWindow.addListener("draw", this);
ofWindow.addListener("exit", this);
window:setPosition(50, 100);
window:setSize(800 + 40, 600 + 40);
if type(window) ~= "userdata" then;
window = ofWindow();
end;
;
window:create();
if ofWindow.exists then;
clock:delay(0);
end;
end;
;
function ofelia.free();
window:destroy();
ofWindow.removeListener("setup", this);
ofWindow.removeListener("update", this);
ofWindow.removeListener("draw", this);
ofWindow.removeListener("exit", this);
end;
;
function ofelia.setup();
ofSetWindowTitle("Video Player");
ofBackground(0, 0, 0, 255);
end;
;
function ofelia.moviefile(path);
videoPlayer:load(path);
videoPlayer:setLoopState(OF_LOOP_NORMAL);
videoPlayer:setPaused(true);
end;
;
function ofelia.setSpeed(f);
videoPlayer:setSpeed(f / 100);
end;
;
function ofelia.play();
videoPlayer:play();
end;
;
function ofelia.stop();
videoPlayer:setFrame(0);
videoPlayer:setPaused(true);
end;
;
function ofelia.setPaused(f);
if f == 1 then pause = true;
else pause = false;
end;
videoPlayer:setPaused(pause);
end;
;
function ofelia.setFrame(f);
videoPlayer:setFrame(f);
end;
;
function ofelia.setPosition(f);
videoPlayer:setPosition(f);
end;
;
function ofelia.setVolume(f);
videoPlayer:setVolume(f / 100);
end;
;
function ofelia.update();
videoPlayer:update();
if videoPlayer:isFrameNew() then;
table.insert(frames, 1, videoPlayer:getTexture());
if #frames > N then;
table.remove(frames, N + 1);
end;
end;
end;
;
function ofelia.draw();
videoPlayer:draw(420, 20, 400, 600);
if #frames == N then;
frames[ofelia.frame]:draw(20, 20, 400, 600);
end;
outputList[1] = videoPlayer:getPosition();
outputList[2] = videoPlayer:getCurrentFrame();
outputList[3] = videoPlayer:getTotalNumFrames();
return outputList;
end;
;
function ofelia.exit();
videoPlayer:close();
end;
;
Ofelia - videoPlayer and GLSL Effects
i think it is possible after trying a bit.
what seems important:
-use photo JPG (or something similar) as the codec for the video. a good program for converting is http://www.squared5.com/
-use setPosition and not setFrame for scrubbing or playing reverse through the video (it is much faster)
-playing with setPosition is without sound
-for playing with setPosition the video needs to be paused
it is adapted from the video example and can be optimized a lot to work like the [pixfilm] object...
video4.pd
if type(window) ~= "userdata" then;
window = ofWindow();
end;
;
local canvas = pdCanvas(this);
local clock = pdClock(this, "setup");
local videoPlayer = ofVideoPlayer();
;
function ofelia.bang();
ofWindow.addListener("setup", this);
ofWindow.addListener("update", this);
ofWindow.addListener("draw", this);
ofWindow.addListener("exit", this);
window:setPosition(50, 100);
window:setSize(800 + 40, 600 + 40);
if type(window) ~= "userdata" then;
window = ofWindow();
end;
;
window:create();
if ofWindow.exists then;
clock:delay(0);
end;
end;
;
function ofelia.free();
window:destroy();
ofWindow.removeListener("setup", this);
ofWindow.removeListener("update", this);
ofWindow.removeListener("draw", this);
ofWindow.removeListener("exit", this);
end;
;
function ofelia.setup();
ofSetWindowTitle("Video Player");
ofBackground(0, 0, 0, 255);
end;
;
function ofelia.moviefile(path);
videoPlayer:load(path);
videoPlayer:setLoopState(OF_LOOP_NORMAL);
videoPlayer:setPaused(true);
end;
;
function ofelia.setSpeed(f);
videoPlayer:setSpeed(f / 100);
end;
;
function ofelia.play();
videoPlayer:play();
end;
;
function ofelia.stop();
videoPlayer:setFrame(0);
videoPlayer:setPaused(true);
end;
;
function ofelia.setPaused(f);
if f == 1 then pause = true;
else pause = false;
end;
videoPlayer:setPaused(pause);
end;
;
function ofelia.setFrame(f);
videoPlayer:setFrame(f);
end;
;
function ofelia.setPosition(f);
videoPlayer:setPosition(f);
end;
;
function ofelia.setVolume(f);
videoPlayer:setVolume(f / 100);
end;
;
function ofelia.update();
videoPlayer:update();
end;
;
function ofelia.draw();
ofSetHexColor(0xFFFFFF);
videoPlayer:draw(20, 20, 800, 600);
local outputList = {};
outputList[1] = videoPlayer:getPosition();
outputList[2] = videoPlayer:getCurrentFrame();
outputList[3] = videoPlayer:getTotalNumFrames();
return outputList;
end;
;
function ofelia.exit();
videoPlayer:close();
end;
possible deken bug + general question on dependencies
Hi,
not sure if this is a bug. Don't wanna noobishly spam to the devs' bug reports pile but this needs to be clarified. Is it a deken issue or on the repository or what?
Some searches for externals in the 64-bit version of PD vanilla for windows (I'm on windows 10) the deken search (in the menu: Help -> Find externals) don't return results while the same externals (in some cases) can found on the 32-bit version. Some externals are neither found in the 32- nor 64-bit version. Additionally - as a marker that something is wrong here - PD does not output the line
[deken]: No matching externals found. Try using the full name e.g. 'freeverb'.
which is the case for truly non-existing names (like searching "sdfsdfsdf").
Example of external found as expected on 32- and 64-version:
cyclone
Example of external found as expected on 32- but NOT on 64-bit version:
moonlib
Example of external found neither on 32- or 64-bit version:
apple
What I'm most eager to find out is whether, say, the moonlib external is just not compiled for 64-bit windows and therefore is not found or whether it should be found and just isn't (which hints more towards a bug).
Does anyone have an idea? I'm not completely new to PD but not up to date at all with its development. It seems the current version 0.49 vanilla is the first to have a 64-bit windows version.
kind regards
how do i close ofelia render window?
@youaresound Yes, that's a RPi specific issue.
I think it happens because OF doesn't use X11 windowing system on the RPi as a default.
https://forum.openframeworks.cc/t/program-window-on-raspberry-pi-doesnt-behave-like-windows-on-other-platforms
However, I think there's a solution to make it use X11 by recompiling OF using different setting.
https://forum.openframeworks.cc/t/raspberry-x11-window
I will try this later and see if I can fix it.
cyclone v0.3rc1 not working on Windows 32 or 64 bit
Anyone else having this problem?
I recently installed 64-bit Pd to try it out and some cyclone objects where no longer creating so I updated it with deken
(version is: cyclone v0.3rc1.dek
Upoaded by lucarda @ 2018-09-28 00:09:15)
I cannot get any of these objects to create on 64-bit pd
so then I tried the same thing in my 32-bit version of pd that I have installed separately this time the cyclone version was:
cyclone-v0.3rc1-(Windows-i386-32)-externals.zip
Uploaded by porres @2018-06-28 04:10:47
with the same sad but curious result.
Perhaps @Porres has an idea of what is going on?
(by the way great work getting all those Max 7 objects cloned over!)
Any suggestions appreciated
I would really like to be able to get my patches to work and also would be great to test these new objects..
currently what I have done is merge the Pd-extended cyclone
(version v0.0.extended-(Windowsi386-32)-externals.zip
uploaded by chr15m @ 2015-07-30 15:42:43
with the new one from Porres in order to run my older patches. Of course none of the new objects work in this situation, but this works ok
on my 32-bit Pd (which is version 0.48.1).
Installing PureData 32 bits on 64 bits host for the life of a project
Hi everyone,
I am comming to you today because i want to make a project live !.
This project work with pureData and some external pd object :
fluid~ , freeverb~..
My objectiv is to install a 32 bits version of pureData to make external pd work.
I tried these solutions :
Multi arch ubuntu 64 bits host
- On a 64 bits ubuntu
- add i386 arch
- update , dist-upgrade..
Then when installing : $> apt-get install puredata:i386
This package is no more available :
These packet a replacing it :
puredata-utils puredata-utils:i386 puredata-extra:i386 puredata-core:i386
puredata-core puredata-dev puredata-doc puredata-extra puredata-gui
So i installed
$> apt-get install puredata-utils:i386 puredata-extra:i386 puredata-core:i386 puredata-gui
pureData is now installed. But when i run it i have this message :
ALSA lib conf.c:3357:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so
ALSA lib control.c:954:(snd_ctl_open_noupdate) Invalid CTL hw:0
ALSA card scan error
Still i can use the debugger and hear sound..
When running my stido project using some object like :
udpReceive or udpSend...
i got this on the initialisation (you can see also all the pd objects used) :
import mrpeach/routeOSC
... couldn't create
import mrpeach/udpreceive
... couldn't create
import mrpeach/udpsend
... couldn't create
import mrpeach/packOSC
... couldn't create
import mrpeach/unpackOSC
... couldn't create
import flatspace/prepend
... couldn't create
import flatspace/prepend
... couldn't create
import moocow/sprinkler
... couldn't create
import cyclone/speedlim
... couldn't create
./libs/fluid~.pd_linux: libreadline.so.5: cannot open shared object file: No such file or directory
fluid~
... couldn't create
freeverb~
... couldn't create
beware! this is xeq 0.1, 3rd beta build... it may bite!
./
So its not working ^^
Solution 2 - Docker
I was thinking : maybe i can just make a puredata container with all the 32 bits libs, So i tried to find some puredata 32 bits image. But nothing.. And Docker is a little tricky with 32 bits container as he didn't provide any support yet.
Still its possible to run 32 bits linux on it .. i found some 32 bits images on the net, but no way how to create one..
If someone has a solution please..
I am working as a volunteer on this project because i believe on it. I have no time yet to update the pd engine for 64 bits..
This project is helping disabled people and your respons will help me so much to provide them a long term support for this software
If you wanna take a look at the project http://orguesensoriel.com
Thank you a lot,
Damien
Purr Data finally released
Purr Data is finally released!
Purr Data inherits the goodness of Pd-l2ork and runs on Gnu/Linux, Windows, and OSX. Infinite undo, enhanced editing and 2d drawing, and most of the the externals from Pd-extended (plus more from Pd-l2ork).
[Edit]
2.2.4:
- fix
[wrap~]
inconsistency - port mouse events from
[hcs/cursor]
- fix bug with dollarsigns in struct names
- add some "legacy_mouse" classes to support externals that report mouse events: "legacy_mousemotion", "legacy_mouseclick" and "legacy_mousewheel"
- fix bug loading default libs on OSX
2.2.3:
- fixed overallocation bug that made loading soundfiles into arrays take up unnecessary amount of memory (4x-8x overallocation)
- fix some utf8 string handling routines
- port fixes for
[soundfiler]
from Pd Vanilla - fix bug with "$@" that could cause invalid reads in some cases
- fix
[initbang]
functionality - fix crasher in
[pdinfo]
New in 2.2.2:
- fixed usability issues with the dropdown object
New in 2.2.1:
- fix stray GUI bugs
- fix some external libs that weren't building under Windows
- fix some OSX key event bugs
New in 2.2.0:
- fix GOP sizing algo to accommodate small GOP abstractions
- turn off anoying Gnome-keyring popup that appears on some systems
- bump nw.js GUI toolkit to 0.22.1
- fix arrow-key navigation-- use arrow keys for scrollbar navigation in runmode, turn off in editmode
- ignore iemgui label in bbox computation for "-legacy" mode
- fix OSCx library on arm builds
- guard against more out-of-order messages from Pd to GUI
- clean up and simplify build instructions
- leave enough space in GOP abstractions to accommodate all xlets
- fix search path bug
- update some of the documentation, removing old "messageoddness" patches that no longer apply to Purr Data
- update unauthorized library
- clean up and simplify the repository code/structure
New in 2.1.2:
- minor bugfix in the console (duplicate messages weren't printed after clearing)
- some minor fixes in the default startup configuration
- some cosmetic changes in the accompanying README and license information
- various bugfixes in objects and internal API functions (message boxes, dropdown atom, loadbang-related issues)
- updated lyonpotpourri to the latest 3.0 version to fix various 64 bit issues on Linux and macOS
- saving the preferences is much faster on the Mac now
- new animated "About Pd-L2ork" popup; also, the proper version is now shown in the generic "About" box on the Mac
New in 2.1.1:
- normalized range for
[bendin]
(keep old behavior under legacy flag) - added "mouseenter" and "mouseleave" events for data structures
- fixed "Recent Files" under Windows
- cleaned up documentation in repo
- fix for
[midiclkin]
(#255) - added "l2ork_version" message for
[pdinfo]
- make loader search order the same as Pd Vanilla
- fixed cord inspector font size
- silence spurious error when autopatching a signal object
- added a
[dropdown]
object for choosing a value for an atom box (interface not stable yet) - made gatom resizable by click-dragging in edit mode
- added "<ctrl-mousewheel>" for zooming
- added solarized and inverted solarized gui presets
- fixed mycanvas stroke color updates
- improvements to mode 4 of intelligent patching
- fixed "<Delete>" not deleting a selected object on some systems
New since rc5:
- fixed display bug with [vu] on graph-on-parent canvas
- fix documentation for timer-help.pd
- fix "open" method for [ggee/image]
- default to the user's home directory on OSX app bundle
- open the help browser file browser in the doc folder
- add a canvas "Print" menu item (under "File" menu)
- allow option to save the zoom level with the canvas
- fix a data structure crasher
please report lots of bugs to
https://git.purrdata.net/jwilkes/purr-data/issues
Binaries:
Purr Data rc5
Purr Data release candidate 5!
- small fixes to OSX app bundle name and build instructions
- fixed OSX app bundle name
- fixed GUI errors with some GUI objects on GOP
- use cat icon for patches
- fixed a [grid] crasher with binding symbol leak
- fixed [grid] line drawing bug and GOP xlet display
- added dialog and scale handle for [grid]
- ported moonlib/knob
- get rid of some extraneous debugging messages
- allow to install Purr Data alongside Pd-l2ork
- Scope~ code cleanup
- fixes for arm build
- added some OSX app bundle dependencies for [fluid~] and others
- fix saving preferences under OSX
- added startup paths and libs to preferences dialog
- use "Purr Data" in OSX menu app
- help browser fixes
- fixed MIDI preference saving on OSX and Windows
- added a "Recent Files" menu to the "File" menu
- get consistent behavior for present working directory when opening/saving files
- fix Volume name for OSX dmg installer
- try to standardize a deterministic package name when compiling Purr Data
- add a Pd-l2ork-specific version number
- add command line open args to "Recent Files" list
- fixed crasher with ds "canvas" field
- allow saving the zoom level per canvas
please report lots of bugs to
https://git.purrdata.net/jwilkes/purr-data/issues
Binaries:
Purr Data Beta 3
Purr Data Beta 3!
This is the GUI port of Pd-l2ork from tcl/tk to nw.js. Canvas zooming, svg-based data structure drawings, GUI theming, and more...
- fixed "stale pointer" bug when re-opening a subpatch on a scalar that has an event handler
- added ds tutorial for field parameters
- removed more debugging messages
- updated ds tutorials, add coords tutorial for ds shapes
- fixed stroke-linecap "square" style
- use standard "d" attribute instead of "data" for setting svg data
- fixed for the open dialog
- added feature to format path data into a FUDI message
- added table of contents to help browser
- fixed crasher with scalar dialog handling of vector data
- fixed data properties dialog positioning
- fixed typos in drawnumber_vis that caused sizing bug
- check scroll bars after zooming the canvas
- allow doc/ and extra/ prefixes to search a particular directory (instead of
a natural language search) - allow browsing the docs using native file dialog
- fixed small bugs in the doc search engine
- fixed font size bug on newer versions of Gnu/Linux
- fixed pdogg dependency, bump version to 0.25.2
- fixed regression with broken object box getting recreated with a superfluous cord connection
- now using homebrew on OSX instead of macports (faster install time, smaller install size)
- fixed stroke-dashoffset to stick when scalar is re-vis'd
- lots of other small fixes here and there...
This is a beta release, so please report lots of bugs to
https://git.purrdata.net/jwilkes/purr-data/issues
Binaries:
Purr Data alpha6
This is the alpha 6 release of Purr Data (the GUI port of Pd-l2ork)
Change log:
- bump jmmmp to 0.47
- fix extraneous colon in [print -n]
- add missing dll dependencies for various externals for Windows
- fix bug with zombie window sometimes getting created for subpatches
- fix nbox label color not updating
- fix "New Array" dialog buttons to keep from creating multiple arrays
- Windows build simplification-- you can now build a Windows installer
using msys2 in only 7 steps! Works on both win32 and win64 machines - clean up help patches
This is the last alpha, so please report lots of bugs to
https://git.purrdata.net/jwilkes/purr-data/issues
Binaries: