ofelia on raspberry pi?
Hi,
I am trying to get ofelia to run on a couple of rpi. Right now I am trying a rpi 3B+ running https://blokas.io/patchbox-os/
I run ofeila with the ofelia-fast-prototyping abs on my mac successfully.
Following install instructions here https://github.com/cuinjune/Ofelia
after running
sudo ./install_dependencies.sh
it ends like this:
detected Raspberry Pi
installing gstreamer omx
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gstreamer1.0-omx is already the newest version (1.0.0.1-0+rpi12+jessiepmg).
The following package was automatically installed and is no longer required:
raspinfo
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Updating ofxOpenCV to use openCV4
sed: can't read /home/patch/Documents/Pd/externals/addons/ofxOpenCv/addon_config.mk: No such file or directory
sed: can't read /home/patch/Documents/Pd/externals/addons/ofxOpenCv/addon_config.mk: No such file or directory
When running the example patches in Pd I get this in PD console:
opened alsa MIDI client 130 in:1 out:1
JACK: cannot connect input ports system:midi_capture_1 -> pure_data:input_2
/home/patch/Documents/Pd/externals/ofelia/ofelia.l_arm: libboost_filesystem.so.1.67.0: cannot open shared object file: No such file or directory
ofelia d $0-of
... couldn't create
/home/patch/Documents/Pd/externals/ofelia/ofelia.l_arm: libboost_filesystem.so.1.67.0: cannot open shared object file: No such file or directory
ofelia d $0-of
... couldn't create
/home/patch/Documents/Pd/externals/ofelia/ofelia.l_arm: libboost_filesystem.so.1.67.0: cannot open shared object file: No such file or directory
ofelia d $0-of
... couldn't create
/home/patch/Documents/Pd/externals/ofelia/ofelia.l_arm: libboost_filesystem.so.1.67.0: cannot open shared object file: No such file or directory
ofelia d $0-of
... couldn't create
/home/patch/Documents/Pd/externals/ofelia/ofelia.l_arm: libboost_filesystem.so.1.67.0: cannot open shared object file: No such file or directory
ofelia d $0-of
... couldn't create
/home/patch/Documents/Pd/externals/ofelia/ofelia.l_arm: libboost_filesystem.so.1.67.0: cannot open shared object file: No such file or directory
ofelia f ;
ofBackground(20) ;
ofSetSmoothLighting(true) ;
ofSetSphereResolution(24) ;
local width , height = ofGetWidth() * 0.12 , ofGetHeight() * 0.12 ;
sphere = ofSpherePrimitive() ;
sphere:setRadius(width) ;
icoSphere = ofIcoSpherePrimitive() ;
icoSphere:setRadius(width) ;
plane = ofPlanePrimitive() ;
plane:set(width * 1.5 , height * 1.5) ;
cylinder = ofCylinderPrimitive() ;
cylinder:set(width * 0.7 , height * 2.2) ;
cone = ofConePrimitive() ;
cone:set(width * 0.75 , height * 2.2) ;
box = ofBoxPrimitive() ;
box:set(width * 1.25) ;
local screenWidth , screenHeight = ofGetWidth() , ofGetHeight() ;
plane:setPosition(screenWidth * 0.2 , screenHeight * 0.25 , 0) ;
box:setPosition(screenWidth * 0.5 , screenHeight * 0.25 , 0) ;
sphere:setPosition(screenWidth * 0.8 , screenHeight * 0.25 , 0) ;
icoSphere:setPosition(screenWidth * 0.2 , screenHeight * 0.75 , 0) ;
cylinder:setPosition(screenWidth * 0.5 , screenHeight * 0.75 , 0) ;
cone:setPosition(screenWidth * 0.8 , screenHeight * 0.75 , 0) ;
pointLight = ofLight() ;
pointLight:setPointLight() ;
pointLight:setDiffuseColor(ofFloatColor(0.85 , 0.85 , 0.55)) ;
pointLight:setSpecularColor(ofFloatColor(1 , 1 , 1)) ;
pointLight2 = ofLight() ;
pointLight2:setPointLight() ;
pointLight2:setDiffuseColor(ofFloatColor(238 / 255 , 57 / 255 , 135 / 255)) ;
pointLight2:setSpecularColor(ofFloatColor(0.8 , 0.8 , 0.9)) ;
pointLight3 = ofLight() ;
pointLight3:setPointLight() ;
pointLight3:setDiffuseColor(ofFloatColor(19 / 255 , 94 / 255 , 77 / 255)) ;
pointLight3:setSpecularColor(ofFloatColor(18 / 255 , 150 / 255 , 135 / 255)) ;
material = ofMaterial() ;
material:setShininess(120) ;
material:setSpecularColor(ofFloatColor(1 , 1 , 1)) ;
... couldn't create
/home/patch/Documents/Pd/externals/ofelia/ofelia.l_arm: libboost_filesystem.so.1.67.0: cannot open shared object file: No such file or directory
ofelia f ;
pointLight = nil ;
pointLight2 = nil ;
pointLight3 = nil ;
collectgarbage() ;
... couldn't create
/home/patch/Documents/Pd/externals/ofelia/ofelia.l_arm: libboost_filesystem.so.1.67.0: cannot open shared object file: No such file or directory
ofelia f ;
local width , height , time = ofGetWidth() , ofGetHeight() , ofGetElapsedTimef() ;
pointLight:setPosition((width * 0.5) + math.cos(time * 0.5) * (width * 0.3) , height / 2 , 500) ;
pointLight2:setPosition((width * 0.5) + math.cos(time * 0.15) * (width * 0.3) , height * 0.5 + math.sin(time * 0.7) * height , -300) ;
pointLight3:setPosition(math.cos(time * 1.5) * width * 0.5 , math.sin(time * 1.5) * width * 0.5 , math.cos(time * 0.2) * width) ;
... couldn't create
/home/patch/Documents/Pd/externals/ofelia/ofelia.l_arm: libboost_filesystem.so.1.67.0: cannot open shared object file: No such file or directory
ofelia f ;
local spinX = math.sin(ofGetElapsedTimef() * 0.35) ;
local spinY = math.cos(ofGetElapsedTimef() * 0.075) ;
ofEnableDepthTest() ;
ofEnableLighting() ;
pointLight:enable() ;
pointLight2:enable() ;
pointLight3:enable() ;
material:beginMaterial() ;
plane:rotateDeg(spinX , 1 , 0 , 0) ;
plane:rotateDeg(spinY , 0 , 1 , 0) ;
plane:draw() ;
box:rotateDeg(spinX , 1 , 0 , 0) ;
box:rotateDeg(spinY , 0 , 1 , 0) ;
box:draw() ;
sphere:rotateDeg(spinX , 1 , 0 , 0) ;
sphere:rotateDeg(spinY , 0 , 1 , 0) ;
sphere:draw() ;
icoSphere:rotateDeg(spinX , 1 , 0 , 0) ;
icoSphere:rotateDeg(spinY , 0 , 1 , 0) ;
icoSphere:draw() ;
cylinder:rotateDeg(spinX , 1 , 0 , 0) ;
cylinder:rotateDeg(spinY , 0 , 1 , 0) ;
cylinder:draw() ;
cone:rotateDeg(spinX , 1 , 0 , 0) ;
cone:rotateDeg(spinY , 0 , 1 , 0) ;
cone:draw() ;
material:endMaterial() ;
ofDisableLighting() ;
ofDisableDepthTest() ;
... couldn't create
Thankful for help!
warble tones considered harmful?
@oid said:
@ddw_music said:
One of the sines is too low to be audible
How does the amplifier and speaker know what is audible? We can hear the tremolo effect of this beating so the speaker has to be moving at that rate and those tones we hear as tones are moving on top of that beating...
Perhaps, but when I checked standard sine vs sine amplitude modulation (ring modulation), any subaudio energy was too low to be detected, nowhere near loud enough to burn anything. There might have been some subaudio energy but it must have been at least 70-80 dB below the upper frequencies.
EDIT: SuperCollider's freqScope shows a peak up to 0 dB around 440 Hz, and low-frequency energy hovering around -80 or -90 dB for SinOsc.ar(440) * SinOsc.ar(4):

That's some subaudio but still much quieter than the sine waves.
hjh
understanding a simple feedback oscillator
I love this feedback oscillator! I don't know how relevant it is, but it reminded me of https://ccrma.stanford.edu/software/snd/snd/fm.html [cascade FM: sin(sin(sin))]:
As z increases above 1.27, we get a square wave, then period doubling, and finally (ca. 1.97) chaos.
Transform and enhance an audio file
@atux If the source material is boring the end result is likely to also be boring regardless of how complex you make that waveform, a theremin is generally a fairly pure sine wave but in capable hands the theremin is quite expressive. You can make a sine more interesting through waveshaping/distortion, filtering and dynamics, and you can make a sine control other sounds through pitch tracking and you also have all the traditional effects like reverb, chorus, tremolo, etc. This is a huge topic and the options are limitless. Everything from the Audio Math and Audio Filters sections of the pd help can be used here as well as [sigmund~] and [bonk~] for pitch tracking/triggering fun, plus a huge amount of externals. Experiment.
Aliasing line ~ ?
I see, all kinds of precision errors in every stage. Didn't know [vline~] was calculating in double-precision. Thank you!
And didn't see your 2nd edit:
@seb-harmonik.ar said:
edit2: personally I use my own sine tables if I want really clean sine waves because the ones pd uses internally still sound a bit gritty to me sometimes, I think they use 512 points and I usually end up using tables that use 2048 or 4096 points
Here is a rather messy patch comparing different tables and interpolations I started to make a while ago, maybe worth sharing here:
Bigger tables are more robust against precision errors (offset) of their driving inputs.
With offset, [cyclone/cycle~] has same few artefacts for smaller as for bigger arrays (hmm..might be a bug I did?).
[osc~] is the cheapest sine.
[cyclone/cycle~] has non-expected costs with different interpolations.
My linear interpolation is different than cyclone's in results and very expensive (due to vanilla patching!?).
At an offset above [+~ 1023], with [cos~] and 512-point-table called $0-cos-GOOD, there is a sudden increase of artefacts .(due to bit-depth!!?)
There might be bugs. Sorry for the mess, too boring cleaning up this time.
Phase of sine
I have created a kind of pulse width sine thingie where I can define the nr of sine waves in one period by use of a comparitor
Works great , more or less
Obviously the sine needs to be stationary (0hzยฐ ) and the phase input is modulated by a phasor .
The issue is settting the starting phase of the sine because when it's a cosine there are discontinuties ( becasue it starts from 1) , the starting phase sometimes works with the nr. 1.429 ,but most of the time not (blue rectangle on picture )
Max msp obviously suffers from the same issues with cycle~ but it has a sinx~ object which takes 2*pi as input.
Here's the stuff


narrow sine.pd
hilbert~ /hilberto~ for frequency shifting sidebandattenuation
@manuels and @Obineg so I tried with opposite signs which was fun waveshaping weardness, but no 90ยฐ phase shift.
Hm, strange ... Did you make sure you only changed the signs of the feedback coefficients (first two arguments of biquad~)? I tried that, and it kind of seems to work: hilberto-test.pd
The reason for the opposite signs, as I understand it, is that in Pd the difference equation only uses additions. (Not sure if this is just a matter of taste or maybe a more efficient implementation.)
The topic is also discussed here: https://cycling74.com/forums/converting-pure-data-biquad-coefficients
Phase cancellation illusion
Here is a surprising result for your amusement.

0709-sine-illusion.pd
0709-one-sine.pd
Just for fun, the equivalent SuperCollider code is:
(
a = {
var sig = SinOsc.ar((4 ** Array.series(200, 0, 0.002)) * 300).sum;
(sig * 0.02).dup
}.play;
)
hjh
1p24p(sin): one midi ctrlin used to control 4 parameters via sine curves of different frequency
This is a real world example:
1p24p(sin)-example(amsynth).pd
1p24p(sin)-help.pd
1p24p(sin).pd
Controlling amsynth with an 8 knob usb midi controller
Aligning the midi map to the patch or sending in your current midi map to the patch, you can control the (primary) 8 sections of amsynth with a (standard) 8 knob usb midi controller. (I've added a few sliders to control some of the params that don't "fit").
The jack connections need to look like the below.
And
the patch works out to:


1p24p(sin): one midi ctrlin used to control 4 parameters via sine curves of different frequency
The abs synchronizes one line and three sine curves using the controlling knob/cc's values (between 0 and 127), i.e. the input, as their angle and their frequency dependent on which sine curve (2^n). Thus, it captures all combinations, just with fewer possible values depending on which sine curve is assigned to which outlet.
1p24p(sin).pd
1p24p(sin)-help.pd
adsr.pd
It takes 5 creation arguments:
$1 the identifying index for the abstraction
and
$2,$3,$4,$5 to determine which outlet receives which frequency/input. So, if used, for instance, with an adsr then [1p24p(sin) 1 0 1 2 3] then "a" would have 127 possible values, d 64, s 32, and r 16. Where as, in the case of ]1p24p(sin) 1 3 2 1 0] r would have 127, s 64, d 32, and a 16.
While it does limit the possible values for the controls/parameters to [127,64,32,16] (respectively) it offers a Lot of flexibity (as the -help file shows) and is very easy to understand.
So basically, for example, in a given synth setup using the abs as input and only 2 knobs/cc you control 16,129 (127^2) adsr presets.
The state chart is as follows (where๐บ๐ปrepresents a value going either up or down, and each arrow represents a set of 16 possible values).
parameter:
0 1 2 3
๐บ๐บ๐บ๐บ
๐บ๐บ๐บ๐ป
๐บ๐บ๐ป๐บ
๐บ๐บ๐ป๐ป
๐บ๐ป๐บ๐บ
๐บ๐ป๐บ๐ป
๐บ๐ป๐ป๐บ
๐บ๐ป๐ป๐ป.
I hope this is easy to understand and that it might "serve(s) you well".
Love through Music,
-S
Let me know if you need help with this. I will (power allowing:-)) be happy to oblige.
p.s. the help files offers a lot of information and two examples (the classicsynth-help and 4 arrays to visually show what's happening).


