Posted
8 days
ago
by
nor...@blogger.com (nael)
Andá a hacer esto en Windows!!!! / Do this on Windows!!!!
Posted
9 days
ago
Why do I get the danceablity upside down ? Weeks ago I implemented the detrended fluctuation analysis exponent (dfaExponent) to scale the danceablity. The dfaExponent is introduced in [1] by Streich and Herrera. However, today I happened
... [More]
to notice that, compared with the observation of the reference, the dfaExponent I've obtained is the hell upside down. 30s-length segmentations of 107 dance tracks and 103 classical tracks are processed, which are half less long than those of the reference. On the left is the result of dfaExponent shown in the reference, and on the right is the funny one who stands on its hands: As the clam annotator now is taking random danceability data as one of the high-level annotations, is anybody interested in filling this fast implementation in? [Less]
Posted
13 days
ago
This script is about a basic code generation of a CLAM plugin. In some point I think this is some kind of meta-programming or perhaps the term “automatic programming” fits better. The basic idea is to specify some basic features of the
... [More]
planned new processing in a plain text and then, generate some code with the script, saving in this way many of the often repetitive and mechanical work needed to set-up a new processing from scratch. Main intention is to allow concentrate in the Do() function or plugin details quickly.
As an example, I will reproduce here how I worked with me some time ago:
One day, in the irc #clam channel:
“[11:51] <groton> Consul, do you know if there is any trigger-like processing unit, list when the volume gets louder than a threshold or something like that”
I’m not Consul in the irc (I’m hordia), but next day at my console…
cd CLAM/scripts/TemplatedPluginsGenerator
vi ThresholdTrigger.template
Name:ThresholdTriggerTemplate
BaseClass:Processing
i:AudioInPort,Audio Input
ic:0,1,Threshold
oc:0,1,Trigger
In words, this means a Processing template named “ThresholdTriggerTemplate” using “Processing” as a base class and with one input of “AudioInPort” type named “Audio Input”, with one in control in the 0..1 range named “Threshold” and one out control named “Trigger”. Of course, you can add as many inputs/outputs of ports or controls as you want.
This script creates the template:
./TemplateGenerator.py ThresholdTrigger.template
And this one the processing plugin:
./TemplatedPluginsGenerator.py ThresholdTrigger ThresholdTriggerTemplate "Hernán Ordiales" GPL 2008
Again in words, this means create a new processing called “ThresholdTrigger” based on the “ThresholdTriggerTemplate” filling the copyright with my name plus the current year and the license with the GPL text.
A final edit just typing the required code for the Do() function:
cd CLAM/plugins/ThresholdTrigger
vi ThresholdTrigger.hxx
#include <cmath>
bool Do()
{
bool result = Do( mAudioInput.GetAudio() );
mAudioInput.Consume();
return result;
}
bool Do(const Audio& in)
{
int size = in.GetSize();
const DataArray& inb = in.GetBuffer();
TData threshold = mThreshold.GetLastValue();
bool trigger = 0;
for (int i=0;i<size ;i )
{
if (std::fabs(inb[i])>threshold)
trigger = 1;
}
mTrigger.SendControl(trigger);
return true;
}
</size></cmath>
At this point, just remains add the basic SConstruct file for a CLAM plugin, compile it with the corresponding clam_prefix and install it:
scons install clam_prefix=$CLAM_PATH
NetworkEditor
And ready to use…
This example it’s very simple and has a poor implementation but was just to show the idea of how those scripts can save a lot of work.
Share This/Compártelo [Less]
Posted
14 days
ago
by
nor...@blogger.com (nael)
The previous python-blender script was called on FrameChanged event, and it iterates over all objects to print its information.
How to access specific object information when you assign(link) the script to, let's say, ObjectUpdate? How to know
... [More]
which object is calling the script? Using the variables of the Blender module.
Here I made a new script and linked the same to:
an object (Audio_Omni_Source2), on ObjectUpdate eventa scene, on FrameChanged eventa world, on FrameChanged event
When the animation is running, the script says on console: [Less]
Posted
16 days
ago
by
nor...@blogger.com (nael)
CLAM supports OSC as a plugin. You can compile CLAM/plugins/osc just as the other clam modules ("scons [options]").
That, for now, compiles a simply server processing (LibloSource) using the high level API of liblo.
On NetworkEditor
... [More]
(click to see animation):
As you can see on the animation, it have 2 options: osc port number and osc path.
LibloSource print whatever osc pakage it receives on that port in the console[1], and if the package have the config path and contain just 3 floats, the values are sent to the three control outputs[2].
If you configure the processing to get port 7000, you will see in the console:
LibloSource::ConcreteConfigure: STARTING the server. port 7000So, just run the blender animation and back to the clam console, it will show something like:
That's it! You have three floats from every blender object osc position package! So, you could configure your LibloSource server to receive an object position subpath[3]:
[1] catched with lo_server_thread_add_method(st, NULL, NULL, generic_handler, this);
[2] catched with lo_server_thread_add_method(st, _config.GetOscPath().c_str(), "fff", controls_handler, this); (the tree "f"s are the three typespec: floats...)
[3] at the moment just once at the time, because it create a new thread server on each processing, which make the port slot be busy and clam crash. This is an IMPORTANT todo task, when see how to deal with several osc paths/objects... Another bugs in actual implementation: if you duplicate a object with the same parameters it crashes... and if you change the options there is no reload (you actually need to quit and open the file again).
I expect to strike these bugs soon, but that need to define some things: what we want to use? a processing as server with different linked (sub)processings as paths? (this could be implemented using some kind of list control messages to deal with paths) Or just a big but configurable processing to receive all paths from an osc sender (for instance, blender)? [Less]