Reading data from a video camera
I think the file I create are blocked by apple security system, since their system automatically tag downloaded binaries to block them... you can type this in Terminal to untag the files:
sudo xattr -cr path/to/Gem
But good news, there is now automatic builds up on deken... Here is the news from IOhannes, who is actively maintaining Gem:
just for the record: since yesterday there's snapshot builds of Gem available on deken.
- this is a snapshot of the current git 'master'. there hasn't been a
release. things might be more broken then in a normal release (on the
upside: if you report bug, they are fixed faster than in a normal release) - there is only a single version "0.94-snapshot". the package will be
updated whenever a i change something in the git repository. there is no
turning back (if things worked with yesterday's snapshot, but not with
the one downloaded today, then you are out of luck) - Windows: both 32bit and 64bit binaries are available
- macOS: the binary is universal (amd64 and arm64). they should run at
least on "Big Sur" (i've tested them[*] on Catalina/amd64 and Monterey/M1) - Linux: there are binaries available, but unlike with Windows/macOS
binaries, there are no dependencies included. I do advise Linux people
to just build Gem themselves (or use a distribution that offers packages
for Gem's git snapshots). this is because on Linux you typically have a
proper package manager (that allows you to easily install all the stuff
needed, starting with a compiler), whereas on macOS/Windows you don't
(unless you count the variants of "app stores" - which I don't).
the pre-built binaries will most likely not work out of the box on
your system. (having said that: the binaries where produced on a
Debian/bullseye system, so if you are running something similar it
should be possible to just install the missing dependencies with your
package manager; a good start is to just install the "gem" package that
comes with your distribution, as this should pull in most dependencies)
gfds
IOhannes
Some patches won't open. (was: Why Vanilla fails at reading some Purr Data patches?)
@lacuna said:
So these patches starting with
#N canvas 2802 562 675 300 12;
or
#N canvas 785 1198 794 777 12;
appear blank.
If (I'm guessing) the canvas parameters are "left-X top-Y width height" (and I guess 12 is a zoom factor but I'm not sure), then X = 2802 is very, very far to the right, and 1198 is very, very far down. On my laptop, I've got 1366x768; a window positioned 2802 pixels away from screen left would far, far out of bounds.
The window manager that I use in Linux will "fix" offscreen window coordinates, so when I open the js-help patch, it appears flush against the right and bottom screen borders. The stated coordinates are out of bounds on my system; the window manager shifts them to be on screen. The problem is technically there, but masked by the window manager.
I have seen Windows not adjust out of bounds window coordinates -- i.e., open a subpatch within a student's patch, and couldn't see the window at all.
I'm not 100% certain that's the problem here -- but I'll observe that the action you took, which resolved the problem, was to change the upper-left window coordinates to be much closer to the top left of the screen.
hjh
What should I do (again!) about graphics?
@ddw_music Something happened on my MacBook pro running windows 7.
I had experimented running Pd 0.51.1 with wish 86....... to solve antialiasing problems with patch window rendering.
That worked...... but the patches are displayed within a wish 86 window that (at the time...... now unsure) could not be resized. The Gem window still created outside that window of course.... and I think that aliasing in Gem was "fixed".
I had also applied some rules for antialiasing from the graphics card control panel at the time so I am not sure.
Since then...... e.g. in Pd 0.49 with wish 85........ I have no (noticeable) aliasing in Gem 64-bit and don't need to set FSAA for [gemwin] or smoothing.
I cannot really help much as it was a while ago..... I can only give clues...... and I know that you have so many different platforms to deal with.
Good luck.
David.
gem and big sur
@godinpants said:
I goofed. I fell for it again and upgraded my OS and destroyed GEM. But this time I can't see any solution to getting it running again.
Anyone had luck hacking your way through getting GEM running on Big Sur?
Yeah, my multimedia exam is screwed for one student because of this too.
I'd asked on github and received this suggestion:
i don't really know, but she could try changing the windowing backend, by changing the gemdefaultwindow.pd abstraction in the Gem/-folder and replacing the [gemmacoswindow] (or whatever is there) to one of the other
gem*window
options installed on your system. (just look out for any externals (.pd_darwin,...) in the Gem/-folder that match thegem*window
pattern).
possibly good choices are: [gemglfw3window], [gemglutwindow].
FWIW this is the nail in Gem's coffin for me. Too risky to try to keep it working for a room of 40-50 students.
hjh
Fast Prototyping for Ofelia
FWIW, I don't think it needs to be a replacement for GEM, or pretend to make the interfaces similar to GEM. As noted at the top of the thread, GEM is outdated.
If an obstacle is converting Ofelia's pixel system into something like GEM's normalized coordinates, then... why not simply abandon the idea of normalized coordinates? Unless it's really necessary for practical use. If the only reason to normalize the coordinates was to make it "similar to GEM," I'd say, don't waste time on it.
FWIW, I'm not going to be able to tolerate GEM for another year. Like today -- it took me over two hours to figure out how to extract the alpha channel from pixes. (Like, how many years has GEM existed, and nobody thought it would be useful to have an object to transfer the alpha channel to the main channel of a grayscale pix? Or, if you don't need an object for it, this still seems to me a pretty basic use case... but of course hard to find in the documentation...)
I realize that a set of abstractions on top of Ofelia is not likely to be fully-featured -- but I could cobble together enough Lua to add abstractions myself where needed (and contribute them back), whereas trying to add objects to Gem is impractical (1, my C is not that good and 2, I could build in Linux but not Mac or Windows). Even a partial set of abstractions might be a starting point to get around the kinds of problems I'm facing now, where the existing objects don't quite do what I want and there's not a good way to add functionality.
Otherwise, for this course, I might not have a choice but to jump ship and go to jitter (which some of the students have already done). It pains me to think of switching away from FLOSS but where I am right now is simply not sustainable.
TL;DR Even if the current state is incomplete, would you mind sharing so I could have a look?
hjh
looking for links to info on Canvas/ GUI
@liamorourke Yes, probably best to start simple.
Here is an example using "graph on parent"...... GOP.
cart.pd
The patch itself will only work in extended. Many objects will be missing.... but that is not important.
Right click the window with the controls and click open and you will see what is inside.
The window is actually a sub-patch called [pd guts]
Once it is open you can right click anywhere on its background and a properties window can be opened.
The properties control the GOP..... whether its name is shown........ whether the GOP is active...... the size and the position of the GOP window in the sub-patch (the red box).
The size is reflected in the mother patch [cart] but the position is the position of the window through which you are looking into [pd guts]
"size" is obvious. "margin" sets the position of the box relative to the top left of the window.
Nothing outside that window is shown through the GOP, and no connections are shown even within the window.
David.
[sigmund~] creation arguments/parameters setup
@cfry Those sorts of sounds can be gotten as well and a more sensitive mic will pick them up. The problem you are having is the mic is just getting noise, everything of the same volume, so nothing distinct for [sigmund~] to pick out, remember all those discrete sources add together. By wind noise I meant the sound of wind hitting a microphone directly, this creates a constant sound which will over power all those other sounds, not the sound of wind rustling the leaves in a tree. A good wind screen will be very helpful for you here, but you need to remember, a windscreen does reduce mic sensitivity, so there is a trade off, increase mic sensitivity and the more wind noise it picks up, put on a denser wind screen and you loose some of that sensitivity. A pop screen could work better since it can be placed between the wind and the mic, the other sides of the mic are left open, but if the wind shifts you could end up with wind noise overpowering everything and have to reposition the screen. If you limit yourself to days with nothing more than light winds, you should be able to get by with just a light windscreen and not suffer much loss in sensitivity.
My knowledge of windscreens and pop screens and the like is fairly limited and largely theoretical, I have little hands on use of these things as I mostly record in more controlled environments or in situations where I have more leeway than your needs allow. Seeking out people or sites dedicated to making field recordings would likely be your best path on finding a good mic/pre setup for your needs.
Ubuntu 18, how to update Gem?
Ubuntu Studio 18.04 includes a package for "GEM: ver: 0.93.3 / GEM: compiled on 2018/02/01 at 21:58:19 UTC."
Current Gem is 0.94.
How do I update Gem on my system?
Deken's most recent Gem for Linux is from 2015 (seriously).
I searched for a PPA but I can't find one for this.
https://packages.debian.org/buster/gem -- compatible with Ubuntu or not?
(The immediate motivation is that, in the last 15 minutes or so, multiple Gem help patches caused Pure Data to crash. I suspect a conflict between new Pd 0.50 and old Gem 0.93...?)
hjh
[pix_share_read] and [pix_share_write] under windows
@whale-av, here is a log running pd with -lib Gem -verbose.
tried both 32bit and 64bit pd 0.48-1...
tried ./Gem.m_i386 and failed
tried ./Gem.dll and failed
tried ./Gem/Gem.m_i386 and failed
tried ./Gem/Gem.dll and failed
tried ./Gem.pd and failed
tried ./Gem.pat and failed
tried ./Gem/Gem.pd and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem.m_i386 and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem.dll and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem/Gem.m_i386 and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem/Gem.dll and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem.pd and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem.pat and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem/Gem.pd and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem.m_i386 and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem.dll and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem/Gem.m_i386 and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem/Gem.dll and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem.pd and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem.pat and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem/Gem.pd and failed
tried C:/Program Files/Common Files/Pd/Gem.m_i386 and failed
tried C:/Program Files/Common Files/Pd/Gem.dll and failed
tried C:/Program Files/Common Files/Pd/Gem/Gem.m_i386 and failed
tried C:/Program Files/Common Files/Pd/Gem/Gem.dll and failed
tried C:/Program Files/Common Files/Pd/Gem.pd and failed
tried C:/Program Files/Common Files/Pd/Gem.pat and failed
tried C:/Program Files/Common Files/Pd/Gem/Gem.pd and failed
tried D:/pd-0.48-1.windows.64bit/extra/Gem.m_i386 and failed
tried D:/pd-0.48-1.windows.64bit/extra/Gem.dll and failed
tried D:/pd-0.48-1.windows.64bit/extra/Gem/Gem.m_i386 and failed
tried D:/pd-0.48-1.windows.64bit/extra/Gem/Gem.dll and succeeded
D:\\pd-0.48-1.windows.64bit\\extra\\Gem\\Gem.dll: couldn't load
tried D:/pd-0.48-1.windows.64bit/extra/Gem.pd and failed
tried D:/pd-0.48-1.windows.64bit/extra/Gem.pat and failed
tried D:/pd-0.48-1.windows.64bit/extra/Gem/Gem.pd and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem.m_i386 and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem.dll and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem/Gem.m_i386 and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem/Gem.dll and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem.pd and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem.pat and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem/Gem.pd and failed
Gem: can't load library```
ofelia: deque class
i am not sure if it is the best solution, but it works now (with setFromPixels) it is a variable framebuffer and the example buffers the last 300 frames from a video.
;
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 images = {};
local N = 300;
for i = 1, N do;
images[i] = ofImage();
end;
;
function ofelia.new();
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;
;
local number = 0;
function ofelia.update();
videoPlayer:update();
if videoPlayer:isFrameNew() then;
number = (number + 1) % N;
print(number + 1);
images[number + 1]:setFromPixels(videoPlayer:getPixels());
table.insert(frames, 1, images[number + 1]);
if #frames > N then;
table.remove(frames);
end;
end;
outputList[1] = videoPlayer:getPosition();
outputList[2] = videoPlayer:getCurrentFrame();
outputList[3] = videoPlayer:getTotalNumFrames();
return outputList;
end;
;
function ofelia.draw();
videoPlayer:draw(420, 20, 400, 600);
if #frames == N then;
frames[ofelia.frame]:draw(20, 20, 400, 600);
end;
end;
;
function ofelia.exit();
videoPlayer:close();
for i = 1, N do;
images[i]:clear();
end;
end;
;