Problem installing purr data on Pop_os! ( Ubuntu-based )
As a sidenote, when I usually have this problem (installing a deb I got off the internet) I can solve it 3 simple ways:
The simple method
double-click on the package file, and there is a little widget that comes up and lets you install it (and goes and finds the deps for you.)
The older, non-GUI method
sudo dpkg -i FILE.deb
# there will be errors
sudo apt-get -f install
This will grab all the deps (if they are available) and fix future apt errors.
The modern non-GUI method
You can also use the apt
wrapper to do both steps:
sudo apt install ./FILE.deb
In most cases this works for things that are made for ubuntu, on Pop!OS, but in this case I get some errors (probly due to the version hard-coding):
sudo apt install ./pd-l2ork-2.9.0-20190416-rev.2b3f27c-x86_64.deb
[sudo] password for konsumer:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'pd-l2ork' instead of './pd-l2ork-2.9.0-20190416-rev.2b3f27c-x86_64.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
pd-l2ork : Depends: libgsl2 but it is not installable
Depends: libpng12-0 (>= 1.2.13-4) but it is not installable
Recommends: tap-plugins but it is not going to be installed
Recommends: ladspa-foo-plugins but it is not going to be installed
Recommends: invada-studio-plugins-ladspa but it is not going to be installed
Recommends: blepvco but it is not going to be installed
Recommends: swh-plugins but it is not going to be installed
Recommends: mcp-plugins but it is not going to be installed
Recommends: cmt but it is not going to be installed
Recommends: blop but it is not going to be installed
Recommends: slv2-jack but it is not installable
Recommends: omins but it is not going to be installed
Recommends: ubuntustudio-audio-plugins but it is not going to be installed
Recommends: rev-plugins but it is not going to be installed
Recommends: dssi-utils but it is not going to be installed
Recommends: vco-plugins but it is not going to be installed
Recommends: wah-plugins but it is not going to be installed
Recommends: fil-plugins but it is not going to be installed
Recommends: mda-lv2 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Dictionary object in pd-extended?
@Jona Sorry, I'm not up on my CS terminology but I'll do my best.
A hash map is a type of dictionary, and a dictionary as I understand it is basically a bunch of key/value pairs.
For a real-time system you want to be able to take a key as input and output the value in an amount of time that is small and predictable. You also want the performance to be about the same regardless of how many keys you have or whether a particular key is at the beginning or end of the data.
Suppose I have an array of 10,000 key/value pairs and I want to find the value for key "blah." An easy way to search would be to start at the beginning and iterate through each element until I find the key named "blah." If the key is at element 0 then it's as fast as possible, but if it's at element 9,999 it's much slower (because I had to iterate through the entire array before I found it). If we want the lookup time to be constant that's not a good algorithm, and it gets worse the more elements we add.
A hashing function will take something like one of our keys and "hash" it to some value
in a fixed range. So "foo" might hash to the number 12, "blah" to 450, and so on. The point
is that the input can be an arbitrary string, and the output will be a number between,
say, 1 and 1,000. The mapping of strings to numbers should ideally happen in a way that
distributes our keys uniformly between 1 and 1,000. But it should also be predictable
so that when we hash the same string we always get the same number out.
Since we have 10,000 keys and only 1,000 total slots, we'll still get multiple key/value
pairs in each slot. But now instead of our worst case of iterating through 9,999 keys,
we have
- time it takes to compute the hash and find the slot where our key/value pair is. (For Pd symbols, the hashing algo is essentially just doing two addition ops per character of the string, then a modulo op. That usually takes a lot less time than iterating through a big array of symbols to find a match.)
- time it takes to iterate through 10 keys (on average) for that slot.
That's much better performance for a real-time system. And we can decrease our
average iteration from 10 to 1 by using 10,000 slots instead of 1,000, at the expense of more memory. (And possibly worse cache performance, though I'm not sure about the particulars of that.)
To sum up, there are a few variables:
- How many slots do you want? Fewer means less memory allocation up front at the
expensive of (potentially) longer time to find/set/remove key/value pairs in each slot. - How much data do you have? For small number of key/value pairs you can probably simply use a much simpler data structure and forgo hash maps altogether. For enormous amounts of key/value pairs, memory may be a limiting factor.
There are all kinds of hashing algorithms, a bit of a rabbit hole like DSP filters. I would guess some are better for situations where you may want to sort keys as well as generally efficient performance, etc. But I haven't studied them in depth.
Lua / Ofelia Markov Generator Patch / Abstraction
I finished the Ofelia / Lua Markov Generator abstraction / patch.
The markov generator is part of two patches but can easily be used as an abstraction.
I want to use it for pattern variations of a sequencer for example.
It just needs a Pure Data list as input and outputs a markov chain of variable order and length.
Or draw into the array and submit it to the markov generator.
The first patch is an experiment trying to create interesting sounds with the markov algorithm.
In addition I used the variable Delay from the Pure Data help files:
LuaMarkovGeneratorSynthesizer.pd
The second patch creates markov chains at audio rate, it is quite cpu heavy but works until the 10th markov order.
It is quite noisy but I was courius how it will sound:
LuaMarkovGeneratorAudioRate.pd
And here is the Lua code.
The core of the code is adapted from this python code: https://eli.thegreenplace.net/2018/elegant-python-code-for-a-markov-chain-text-generator/
A few things that I do not really understand yet, but finally it works without errors (it was not easy sometimes ):
-- LUA MARKOV GENERATOR;
function ofelia.list(fv);
;
math.randomseed(os.time()- os.clock() * 1000);
;
print("LUA MARKOV GENERATOR");
local markovOrder = fv[1];
print("Markov Order: ", math.floor(markovOrder));
;
-- make dictionary;
;
local function defaultdict(default_value_factory);
;
local t = {};
local metatable = {};
metatable.__index = function(t, key);
if not rawget(t, key) then;
rawset(t, key, default_value_factory(key));
end;
return rawget(t, key);
end;
return setmetatable(t, metatable);
end;
;
-- make markov matrix;
;
local model = defaultdict(function() return {} end);
local data = {};
for i = 1, #ofelia.markovInputList do;
data[i] = ofelia.markovInputList[i];
end;
print("Data Size: ", #ofelia.markovInputList);
for i = 1, markovOrder do;
table.insert(data, data[i]);
end;
for i = 1, #data - markovOrder do;
local state = table.concat({table.unpack(data, i, i + markovOrder - 1)}, "-");
local next = table.unpack(data, i + markovOrder, i + markovOrder);
model[state][next] = (model[state][next] or 0)+1;
end;
;
-- make tables from dict;
;
local keyTbl = {};
local nexTbl = {};
local prbTbl = {};
for key, value in pairs(model) do;
for k, v in pairs(value) do;
table.insert(keyTbl, key);
table.insert(nexTbl, k);
table.insert(prbTbl, v);
end;
end;
;
print("Key: ", table.unpack(keyTbl));
print("Nex: ", table.unpack(nexTbl));
print("Prb: ", table.unpack(prbTbl));
;
print("Make a Markov Chain...");
;
function ofelia.markovChain();
;
-- make start key;
;
local startKey = {};
if ofelia.randomStart == 1 then;
local randomKey = math.random(#keyTbl);
startKey = randomKey;
else;
startKey = 1;
end;
;
local markovString = keyTbl[startKey];
local out = {};
for match in string.gmatch(keyTbl[startKey], "[^-]+") do;
table.insert(out, match);
end;
;
-- make markov chain;
;
for i = 1, ofelia.markovChainLength do;
;
-- weighted random choices;
;
local choices = {};
local weights = {};
for j = 1, #keyTbl do;
if markovString == keyTbl[j] then;
table.insert(choices, nexTbl[j]);
table.insert(weights, prbTbl[j]);
end;
end;
;
-- print ("choices:", table.unpack(choices));
-- print ("weights:", table.unpack(weights));
;
local totalWeight = 0;
for _, weight in pairs(weights) do;
totalWeight = totalWeight + weight;
end;
rand = math.random() * totalWeight;
local choice = nil;
for i, weight in pairs(weights) do;
if rand < weight then;
choice = choices[i];
break;
else;
rand = rand - weight;
end;
end;
;
if math.type(choice) == "integer" then;
choice = choice * (1.0);
end;
;
table.insert(out, choice);
local lastStep = {table.unpack(out, #out - (markovOrder-1), #out)};
markovString = table.concat(lastStep, "-");
end;
;
return {table.unpack(out, markovOrder + 1, #out)};
end;
end;
;
foo_pd - Pure Data plugin for foobar2000
This is a spiritual successor to amPd. It's much more stable and has many more features than amPd:
-
reads/writes metadata to/from patches. This is done by storing the info in the form of comments, in a canvas called [pd meta] or [pd info]. If no such canvas exists, foobar will add it in the top left-hand corner of your patch.
-
comes with a Win32 Dialog UI element, containing sliders, toggles, buttons, and edit-text/button combos to send messages to your patch.
- foobar looks in your patch for a canvas called [pd mix] and uses the parameters of whatever sliders, bang objects, or toggles it finds there to give your UI controls similar functionality.
How playback works
- libpd sends a 1 to vol, then a bang to play.
- Generally this is where, in your patch, you have an [r play] hooked up to your metro, and an [r vol] connected to a [*~ ] before your output reaches [dac~].
- the length of the song is arbitrarily set by the user.
- This affects the trackbar's cursor visibility and ability to set a position.
- If the length is 0, there will be no trackbar cursor. Otherwise, the cursor, when moved, will send its position in seconds to pos. From there, it's up to your patch to take that information from [r pos] and work it into song events.
- The patch will not actually stop and move on to the next track until libpd receives a bang from [s stop].
How the mixer works
- all mixer controls go inside of [pd mix]
- horizontal and vertical sliders are turned into slider controls in the UI element
- labels assigned to sliders in the patch become labels for the UI element's slider controls. The same applies for send symbols.
- min and max values of sliders on the UI element work in integers only, so if you want a gradual shift from, say, 0 to 1, write "gradient" in the slider's receive symbol, and the slider's range will be broken down into roughly 200+ individual steps.
- there are currently 7 sliders in the UI element
- bang objects with no label become simple buttons in the UI
- their send symbols will be reflected in the button's name and they will send a bang when clicked.
- there are currently 3 buttons
- bang objects with a label assigned become message buttons
- these have an edit text field associated with them, where you can type out any message you want and send it to the destination.
- the bang's label is placed inside of the edit text field as a suggested message to send.
- pure data strips commas out of labels, so I'm using apostrophes to denote where commas should go. ex: do this' then this
- there are currently 2 message buttons, with the 'any' button being a potential 3rd.
- a bang object with a label written in the format dest : msg will be assigned to the 'any' button.
- the 'any' button has an editable destination field, giving you access to basically any receive symbol in your patch.
- also substitutes as a third normal message button, when the other two are already in use
- toggles become checkboxes
- each checkbox can have a label and send symbol assigned to it
- there are currently 4 checkboxes
- right-clicking a track shows the context menu entry Pd Player -> Load mixer.
- basically, you can load mixers of tracks not currently playing for some potentially interesting exchanges between patches. After loading the mixer, you still need to hit the Refresh button to show the changes.
foo_pd's copy of libpd.dll contains only the externals that I needed to run the example patches. If you want your own patches to work with foo_pd, you might need to make another build using MSYS2. If you're not sure which objects aren't instantiating, foobar's console prints all of pd's messages while audio is being processed. I'll also add more externals over time.
I'll be maintaining foo_pd at https://github.com/myQwil/foo_pd where you can also find the latest builds
foo_pd.zip
Last Updated: Feb 26, 2021 3:55pm EST
Lissa Executable / ofxOfelia compile error (Solved)
@cuinjune I tried to compile the lissa seq patch. but when i open the executable it opens only a small empty window.
i also tried to compile a help patch for testing, with the same result.
but your example works fine(Win32Example).
How to „read out“ time values after a bang got triggered? How to define „time windows“ in ms?
Hi there!
I’m quite new to pd but getting more and more into it as I’m trying to build a simple game/app, where users must trigger sound-samples in a certain order and (most notably) at certain points in time. The samples are triggered with bangs and since I edited them by myself, I know the exact length of every sample.
Now let us assume we have 4 samples, each of them with a length of 1200ms and each sample has its own bang to trigger it. These bangs get their input from „buttons“ which the user can hit via a graphical user interface (I built this GUI with MOBMUPLAT, a GUI-editor which interacts with Pd patches). If the bangs are triggered with exact timing, the 4 samples will add up to a musical sequence.
The first bang starts sample1 - after 1200ms the second bang (= button on the interface) shall be hit to start sample2 and so on.. it’s obvious that the user will not hit the buttons on the interface with an accuracy of single milliseconds, so here are my questions for the pd patch:
-
How can I „read out“ certain points in time, after a bang got triggered? e.g. after the first bang was hit, how much time (in ms) has passed until the second bang got hit? And can I „store“ and „recall“ these values in any way?
-
Is it possible to define a kind of „time window“ in ms? e.g. after the first bang was hit, the second bang has to be hit within 1150-1250ms to trigger something, or else (if the second is triggered too soon/late) nothing will happen..
Hope this explanation of my problem is not too complicated. Any help would be much appreciated!
[struct] / [pointer] object limitation?
I'm also curious about what triggers the Stack Overflow.
A safety mechanism that puts an upper limit on how deep an immediate "chain reaction" can be in response to an event like a mouse click, key press, netreceive, or clock callback (.e.,g. a bang coming from [delay 1000]
). When I say "chain reaction", I mean an initial message to an object triggers an outgoing message to another object, and so on until there are no more outgoing messages to process. When I say "immediate", I mean the messages get sent without any logical time in between.
Here's an example:
[bng]
|
[bng]
|
[bng]
If you clicked the object chain above, you get an immediate chain reaction 3 objects deep.
Now, if you extended that chain so that there were 1001 [bng] objects-- each with a single connection to the next-- you'd get a stack overflow error because it exceeds the limit Pd puts on how deeply a single message is allowed to flow in an immediate chain reaction.
The way Pd is coded, these simple examples actually end up using recursive function calls in C. Using recursion with too many levels can end up overflowing the stack and cause a crash, which is why you get that particular error message. (1000 may be too small a number nowadays, but recursion is complex and I'm not sure how one would come up with a better number.)
When you use recursion explicitly in a Pd diagram-- that is, hooking an object's outlet to an inlet that is back up the chain-- you make it way more likely to hit this particular error. You can imagine that your recursive diagram ends up "unrolling". That is, if you have a chain of 4 objects where the bottom one connects back into the top one and recursing 251 times, you're going to hit a stack limit and get the error.
The [until]
object solves this "explicit" recursion problem-- it sends a bang to its outlet, and when the resulting immediate chain reaction has finished it sends another until the specified limit is reached.
So if you have this:
[10000(
|
[until]
|
[bng]
|
[bng]
|
[bng]
You go two objects deep for the bang coming out of [until]
, then three more for the first time through the chain of [bng]
objects. So now we're 5 deep. But once the first iteration of the [bng]
objects are done they unroll, so we're back to being just 2 levels deep. Then the [until]
object starts its next iteration, which goes 3 more deep, then unrolls. It can do this indefinitely, which is why [until]
is preferred over using recursive object chains in Pd.
Included externals are not being loaded by Purr-data
@jancsika the contents of that file (org.puredata.pd-l2ork.default.plist are as follows.... if I had to guess, <string>-helppath ~/Library/Pd -helppath /Library/Pd</string> should be something like Pd-l2ork/Contents/Resources/app.nw/extra instead of ~/Library/Pd ?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>defeatrt</key>
<string>0</string>
<key>flags</key>
<string>-helppath ~/Library/Pd -helppath /Library/Pd</string>
<key>loadlib1</key>
<string>libdir</string>
<key>loadlib2</key>
<string>Gem</string>
<key>loadlib3</key>
<string>cyclone</string>
<key>loadlib4</key>
<string>zexy</string>
<key>loadlib5</key>
<string>creb</string>
<key>loadlib6</key>
<string>cxc</string>
<key>loadlib7</key>
<string>iemlib</string>
<key>loadlib8</key>
<string>list-abs</string>
<key>loadlib9</key>
<string>mapping</string>
<key>loadlib10</key>
<string>markex</string>
<key>loadlib11</key>
<string>maxlib</string>
<key>loadlib12</key>
<string>memento</string>
<key>loadlib13</key>
<string>mjlib</string>
<key>loadlib14</key>
<string>motex</string>
<key>loadlib15</key>
<string>oscx</string>
<key>loadlib16</key>
<string>pddp</string>
<key>loadlib17</key>
<string>pdogg</string>
<key>loadlib18</key>
<string>pixeltango</string>
<key>loadlib19</key>
<string>pmpd</string>
<key>loadlib20</key>
<string>rradical</string>
<key>loadlib21</key>
<string>sigpack</string>
<key>loadlib22</key>
<string>smlib</string>
<key>loadlib23</key>
<string>unauthorized</string>
<key>loadlib24</key>
<string>vbap</string>
<key>loadlib25</key>
<string>pan</string>
<key>loadlib26</key>
<string>hcs</string>
<key>loadlib27</key>
<string>jmmmp</string>
<key>loadlib28</key>
<string>ext13</string>
<key>loadlib29</key>
<string>ggee</string>
<key>loadlib30</key>
<string>iem_anything</string>
<key>loadlib31</key>
<string>ekext</string>
<key>loadlib32</key>
<string>pdp</string>
<key>loadlib33</key>
<string>disis</string>
<key>loadlib34</key>
<string>lyonpotpourri</string>
<key>nloadlib</key>
<string>34</string>
<key>path1</key>
<string>/System/Library/Fonts</string>
<key>path2</key>
<string>/Library/Fonts</string>
<key>path3</key>
<string>~/Library/Fonts</string>
<key>path4</key>
<string>/usr/X11R6/lib/X11/fonts/TTF</string>
<key>path5</key>
<string>/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts</string>
<key>npath</key>
<string>5</string>
</dict>
</plist>
Load Libraries, plug-ins
@Balwyn I've follow your steps but still nothing this is what i got in the console:
'pd-gui' connecting to 'pd' on localhost 5400 ...
------------------ done with main ----------------------
Default font: DejaVu Sans Mono
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/Jose/pd-externals/Gem.m_i386 and failed
tried C:/Users/Jose/pd-externals/Gem.dll and failed
tried C:/Users/Jose/pd-externals/Gem/Gem.m_i386 and failed
tried C:/Users/Jose/pd-externals/Gem/Gem.dll and succeeded
C:\Users\Jose\pd-externals\Gem\Gem.dll: couldn't load
tried C:/Users/Jose/pd-externals/Gem.pd and failed
tried C:/Users/Jose/pd-externals/Gem.pat and failed
tried C:/Users/Jose/pd-externals/Gem/Gem.pd and failed
tried C:/Users/Jose/pd-externals/Gem/Gem.m_i386 and failed
tried C:/Users/Jose/pd-externals/Gem/Gem.dll and succeeded
C:\Users\Jose\pd-externals\Gem\Gem.dll: couldn't load
tried C:/Users/Jose/pd-externals/Gem/Gem.pd and failed
tried C:/Users/Jose/pd-externals/Gem/Gem.pat and failed
tried C:/Users/Jose/pd-externals/Gem/Gem/Gem.pd and failed
Gem: can't load library
Loading plugin: C:/Program Files (x86)/Pd/tcl/pd_deken.tcl
The Pd window filtered 26 lines
The Pd window filtered 27 lines
GEM error
I know this has been asked a few hundred thousand times- i know because i've been reading everything i can find. But most of the documentation and posts are apparently outdated, or don't seem to work for me.
I had been learning pure data for a few weeks about a year ago using pd extended, but noticed that the libs haden't been updated for a long time, so when i got back into it yesterday i decided to start with the nonextended version.
At first i didn't realize that Gem isn't a standard library, so downloaded it, installed, eventually found that someone suggested to go to edit/preferences/startup, make a new entry and just type "gem" and add it. I did that, restarted. The log window still shows a lot of error messages, it looks like PD is searching for two files:
gem.dll
Gem.m_i386
There are a lot of lines that indicated tried and failed for both, but eventually i see "succeeded" for gem.dll, but not for Gem.m_i386.
Anyway i 'put' an object called gemwin and two messages, create and destroy and link them both to gemwin after creating a new project, then switch to run mode ctrl-e and click on create. Nothing happens. It should make a black, empty gem window, but it doesn't.
In the log window, there are no entries added after clicking on create/destroy, i don't know what i'm doing wrong, can someone suggest what to do?
I've been reading for hours, a lot of pages suggest where to look, but have dead links, or the suggestion didn't help, any ideas?
I pasted below the full startup log (the full log using the "all" option).
Thanks:)
Rob T
------------------ done with main ----------------------
input channels = 2, output channels = 2
Default font: DejaVu Sans Mono
tried ./Gem.m_i386 and failed
tried C:/Users/me/AppData/Roaming/Pd/Gem.m_i386 and failed
tried C:/Program Files (x86)/Common Files/Pd/Gem.m_i386 and failed
tried C:/Program Files (x86)/pd/extra/Gem.m_i386 and failed
tried ./Gem.dll and failed
tried C:/Users/me/AppData/Roaming/Pd/Gem.dll and failed
tried C:/Program Files (x86)/Common Files/Pd/Gem.dll and failed
tried C:/Program Files (x86)/pd/extra/Gem.dll and failed
tried ./Gem/Gem.m_i386 and failed
tried C:/Users/me/AppData/Roaming/Pd/Gem/Gem.m_i386 and failed
tried C:/Program Files (x86)/Common Files/Pd/Gem/Gem.m_i386 and failed
tried C:/Program Files (x86)/pd/extra/Gem/Gem.m_i386 and failed
tried ./Gem/Gem.dll and failed
tried C:/Users/me/AppData/Roaming/Pd/Gem/Gem.dll and failed
tried C:/Program Files (x86)/Common Files/Pd/Gem/Gem.dll and failed
tried C:/Program Files (x86)/pd/extra/Gem/Gem.dll and succeeded
GEM: Graphics Environment for Multimedia
GEM: ver: 0.93.3
GEM: compiled: Nov 10 2011
GEM: maintained by IOhannes m zmoelnig
GEM: Authors : Mark Danks (original version)
GEM: Chris Clepper
GEM: Cyrille Henry
GEM: IOhannes m zmoelnig
GEM: with help by Guenter Geiger, Daniel Heckenberg, James Tittle, Hans-Christoph Steiner, et al.
GEM: found a bug? miss a feature? please report it:
GEM: homepage http://gem.iem.at/
GEM: bug-tracker http://sourceforge.net/projects/pd-gem/
GEM: mailing-list http://lists.puredata.info/listinfo/gem-dev/
GEM: compiled for SIMD architecture: SSE2 MMX
GEM: using SSE2 optimization
The Pd window filtered 40 lines
The Pd window filtered 41 lines```