Problems with jack on linux.
It's hard to tell without knowing your setup. OS? Hardware?
I run PD vanilla on xubuntu 20.?? (latest LTS) and an external sound card/mixer (cheap behringer). I can get audio both with and without jack
If I set up PD to run just with ALSA (no jack) and I have some other programs running that are using the sound card (like a browser or whatever) PD will tell me:
ALSA input error (snd_pcm_open): No such file or directory
ALSA output error (snd_pcm_open): No such file or directory
However, closing my browser and/or other programs that route sound through ALSA solves this
Using jack instead gives me the advantage of running other DAW software along side PD and route both midi and audio back and forth between them (non jack programs will be silenced), but jack has to be set up properly for the server to run without dropouts (select the correct soundcard, buffer size etc in settings), or even start at all. For this purpose I use qjackctl, which is a GUI control panel for the jack server- should be in your distro's repositories.
The errors you get with jack simply states that the jack server is not running- it has to be started manually. You can do that with a command from your terminal or get the qjackctl software for the GUI (which I reckon you will prefer as a windows convert). Run: sudo apt install qjackctl
from your terminal to install it if you are using a debian based distro (*ubuntu, mint et al)
How much is a signal aliasing?
@lacuna Ha ha, it turns out I did "solve" it using FFTs, but I had to study my year-old code for a while to see it. You can see in this snapshot that I'm measuring a lot less upper harmonic energy in oversampled sinewaves than you are, and I'm wording it that way (and putting "solve" in quotes) because I'm not convinced that this is a useful measure of aliasing at the normal sample rate. I also can't say that I understand my results for noise and for the impulse function--I thought the latter would have even more energy above Nyquist. I have another idea to try, but I have a plumbing issue to address first I'm still interested in your thoughts though.
measure aliasing (static vector).pd
Contribute to better Pd Documentation
@porres said in Contribute to better Pd Documentation:
On the other hand. If you want a new tutorial like the FLOSS one for 'vanilla' as part of its official documentation, then we need to work on it from scratch, and there'll be no need for a FLOSS version that lives in flossmanuals.net! And I think that can easily be included as part of the Pd Vanilla distribution and its online documentation.
So, went to have a look as to what would it take to make the FLOSS tutorials ported to vanilla... and... well, it seems that despite using Extended, some of the examples are pretty much 'vanilla friendly' (no externals). These can be easily ported then...
But where are the authors these days? I know Derek Holzer is one, but he was just recently sayin on the facebook group that the FLOSS manuals is old should be forgotten himself... If we were to update it in the web, who would do it? And could we revise it and change it and take or put stuff?
Well, I'm thinking about copying the basic tutorials here into a new one, fully vanilla, to be downloadable via deken. But... I guess it'll be kinda "based on this", because I have a few issues with some of the things we have here.
For instance, [phasor~] is described as an osccllator, and it is not one in the sense you can plug it in and listen to it as it has a DC Offset. I will suggest that we even change the description in the help object from 'sawtooth' generator to 'phase ramp' generator. Oscillators need to go from -1 to 1. The square oscillator there is also a pulse train instead. And these are not band limited oscillators (so pretty bad and aliased ones) and we should say that...
Also, in ampplitude modulation, I don;t think it's a good classical example to modulate it to a phasor~ signal, an [osc~] should be much better. And the 'tremolo' effect should also have a 'depth' parameter so it can be called an actual tremolo. A tremolo is not just amplitude modulation with a low frequency.
So if I were to design a new and quick, simple, new tutorial for newcomers, I know I'd change a lot of things... so the problem I have with it is not that it's just old and outdated, but also with the content, which I think can be greatly improved.
I created a new issue on github https://github.com/pure-data/pure-data/issues/1331#issuecomment-850893517
Few questions about oversampling
Hi,
About a year ago I started to learn a bit pure data in order to create a patch that would act as a groovebox and that should perform on limited cpu resources since I want it to run on a raspberry pi. First I tried to make somekind of fork of the Martin Brinkmann groovebox patch, even if it allowed me to learn a lot about data flow I didn't went to the core of the patch tweaking with sound generation. This led me to end this attempt at forking MNB groovebox patch because even if I could seperate GUI stuff from sound generation and run it on different thread ect... I couldn't go further in optimization in order to reduce the cpu use.
Then a few weeks ago I decided to start again from scratch my project and this time I wanted to be more patient and learn anything needed in order to be capable of optimizing my patch as much as possible. After making a functional drum machine which runs at 2/3% of cpu with 8 different tracks, 126 steps sequencer, a bit of fx ect... I tried to find synths that would opperate well aside the drum machine. And I basicly didn't find any patch that wouldn't use massive amount of cpu time. So I created my own synths, nothing incredible but I'm happy with what I got, though I noticed some aliasing. I read a bit the floss manual about anti aliasing and apply the method used in the manual(http://write.flossmanuals.net/pure-data/antialiasing/), it work well but my synths almost trippled their cpu use, even if I put all my oscilators in the same subpatch in order to use only one instance of oversampling.
I didn't tried to oversample it less than 16 time but since oversampling is so cpu intensive I'm wondering if there's no other option in order to get a good sound definition at a lower cpu cost. I'm already using banlimited waveform so I don't know what I could do in order to limit the aliasing, especialy for my fm patch where bandlimited waveform isn't very useful in order to reduce aliasing.
Since I want to have at least 4 synth track with some at least one synth having 5 voice polyphony I want to know what the best thing to do. Letting FM aside for this project and use switch~ for oversampling 2 or 4 time my synths that use bandlimited waveform ? Or should I try to run different instances of pd for each synth and controling it from a gui/control patch with netsend(though it wouldn't bring down the cpu use at least it would provide somekind of multithreading for my patch) ? Or is there another way to get some antiliasing ? Or should I review lower my expectation because there is no solution that could provide a decent antialiasing for 4 or more synth running at the same time with a low cpu use in pure data in 2021.
Thanks to everyone that would read my topic and try to give some advice in order to get the best antialising/low cpu use solution.
Synthesis OSC
@8v01d You are using only ring modulation. You can change by adding frequency modulation (it is very powerful and can create very interesting sounds) to some carrier oscillators but not all. Also you could split the output of each oscillator right before the envelope into 2 channels (one left and one right to have stereo). Then you could change the envelope to be different in the stereo section. Also you could use different kinds of oscillators (sine, triangle, saw, square etc.). You made it clear and i like that. Nice.
NoxSiren - Modular synthesizer system <- [v15]
NoxSiren is a modular synthesizer system where the punishment of failure is the beginning of a new invention.
--DOWNLOAD-- NoxSiren for :
-
Pure Data :
NoxSiren v15.rar
NoxSiren v14.rar -
Purr Data :
NoxSiren v15.rar
NoxSiren v14.rar
--DOWNLOAD-- ORCA for :
- x64, OSX, Linux :
https://hundredrabbits.itch.io/orca
In order to connect NoxSiren system to ORCA system you also need a virtual loopback MIDI-ports:
--DOWNLOAD-- loopMIDI for :
- Windows 7 up to Windows 10, 32 and 64 bit :
https://www.tobias-erichsen.de/software/loopmidi.html
#-= Cyber Notes [v15] =-#
- added BORG-IMPLANT module.
- introduction to special modules.
- more system testing.
#-= Special Modules [v15] =-#
- BORG-IMPLANT (connects ORCA MIDI system to NoxSiren system)
#-= Current Modules [v15] =-#
- VCO (voltage-controlled-oscillator)
- VCO2 (advance voltage-controlled-oscillator)
- WAVEBANK (additive synthesis oscillator)
- ADSR (Attack-Decay-Sustain-Release envelope)
- C-ADSR (Curved Attack-Decay-Sustain-Release envelope)
- CICADAS (128 steps-Euclidean rhythm generator)
- CICADAS-2 (advance 128-steps polymorphic-Euclidean rhythm generator)
- COMPRESSOR (lookahead mono compressor unit)
- DUAL-COMPRESSOR (2-channel lookahead mono compressor unit)
- STEREO-COMPRESSOR (lookahead stereo compressor unit)
- MONO-KEYS (virtual 1-voice monophonic MIDI keyboard)
- POLY-KEYS-2 (virtual 2-voice polyphonic MIDI keyboard)
- POLY-KEYS-3 (virtual 3-voice polyphonic MIDI keyboard)
- POLY-KEYS-4 (virtual 4-voice polyphonic MIDI keyboard)
- POLY-KEYS-5 (virtual 5-voice polyphonic MIDI keyboard)
- POLY-KEYS-6 (virtual 6-voice polyphonic MIDI keyboard)
- BATTERY (simple manual triggered machine for drumming.)
- REVERB (reverb unit with lowpass control)
- STEREO-REVERB (stereo reverb unit with lowpass control)
- RESIN (advanced rain effect/texture generator)
- NOISE (generates black,brown,red and orange noise)
- NOISE2 (generates yellow,blue,pink and white noise)
- COBALT (6-stage polyrhythm generator)
- SHAPER (basic shaper unit)
- FOLDER (basic wave folding unit)
- STEREO-FOLDER (stereo wave folding unit)
- DUAL-FOLDER (advance wave folding unit)
- POLARIZER (transform a signal into bi-polar, uni-polar, inverted or inverted uni-polar form)
- CLOCK (generates a BPM clock signal for sequencing other modules)
- CLOCKDIVIDER (a clock divider with even division of clock signal)
- CLOCKDIVIDER2 (a clock divider with odd division of clock signal)
- DELAY-UNIT (delay unit)
- STEREO-DELAY (stereo delay unit)
- CHORUS (chorus unit)
- STEREO-CHORUS (stereo chorus unit)
- SEQ (advance 16-step/trigger sequencer)
- KICK (synthesize kick unit)
- KICK2 (synthesize flavor of KICK module)
- KICK3 (synthesize flavor of KICK module)
- SNARE (synthesize snare unit)
- CLAP (synthesize clap unit)
- CYMBAL (synthesize cymbal unit)
- RAND (RNG generator for other modules parameters)
- FMOD (feedback modulation unit)
- AM (amplitude modulation unit)
- RM (ring modulation unit)
- LFO (low-frequency-oscillator)
- LFO2 (advance low-frequency-oscillator)
- COMBINATOR (combine two waves)
- COMBINATOR2 (combine three waves)
- COMBINATOR3 (combine four waves)
- STRING (Karplus-Strong string synthesis unit)
- STRING2 (advance Karplus-Strong string synthesis unit)
- DETUNER (parametric 4-channel detuner unit)
- CRUSHER (basic audio resolution unit)
- STEREO-CRUSHER (basic stereo audio resolution unit)
- DUAL-CRUSHER (advance audio resolution unit)
- FILTER (basic filter)
- VCF (voltage-controlled-filter)
- MAR (Moog-analog-resonant filter)
- VCA (voltage-controlled-amplifier)
- DUAL-VCA (advance voltage-controlled-amplifier)
- FMUX (multiplexer with fast A/D internal envelope)
- MMUX (multiplexer with medium A/D internal envelope)
- SMUX (multiplexer with slow A/D internal envelope)
- FDMX (demultiplexer with fast A/D internal envelope)
- MDMX (demultiplexer with medium A/D internal envelope)
- SDMX (demultiplexer with slow A/D internal envelope)
- MIXER (mix 1-4 possible waves)
- SCOPE (oscilloscope analyzer)
- MASTER (fancy DAC~)
- BOX (useless decorative module)
NoxSiren integrated modules menu system.
Smooth frequency transition
you should use a logarithmic line~ object to adjust the curve as smooth as you want.
On top of that you should apply a Nyquist correction to the output of your oscillator abstraction.
So here you have some imagines how to do that. The Nyquist abstraction is used in the output of the triangle oscillator abstraction as an example. Then the final output can be controlled with a logarithmic line~ object.
OBS : If you need more then one oscillator you can apply this for each oscillator and then use a mixer and then the output of the mixer you use again the same idea. In this way you have an oscillator smooth stage control and a final mixer stage control for extra smoothness.
This is just the simple mono smooth control (no curve adjustment)
The same idea but as a stereo version
Here is with logarithmic smooth control (with curve adjustment)
Here you have a Nyquist correction abstraction
Here you have a triangle oscillator with Nyquist correction
You can also download xline~ which is an object that is doing just that :
https://forum.pdpatchrepo.info/topic/13084/xline-logarithmic-line-object
Why does Pd look so much worse on linux/windows than in macOS?
@ingox it means you video card is actually being used by the system, /dev/drive/card0 is your video card. The standard test using lsmod
or dmesg
actually only checks to see if the kernel loaded the driver, does not actually tell you that it is being utilized. I have no idea where I was going with that, I think it was just 4AM logic, but I may have actually had a plan and just forgot it during sleep.
@ddw_music said:
We might be having a terminology problem here.
No, I was referring to the aliasing error shown in Ingox's screen grabs, the line changes thickness, it is not aliased properly. In my experience most people realize this given the context. With anti-aliasing you never have nice crisp single pixel lines, you have 3 or 4 pixel lines of two shades of grey depending on the angle, they are not crisp, just smooth.
If it's a driver issue
The aliasing error being a driver issue. Aliasing vs anti-aliasing is obviously a software issue.
The distro's TK version:
I meant implementation not version, the hour was late. A quick glance at the pd source, its config and the Makefile suggests there is nothing there that enables anti-aliasing for OSX, which strongly suggests that you just need to compile TK with anti-aliasing and you will have it (possibly after recompiling TK apps, did not bother to look into it to see how it works). Most likely every linux distro assumes that anyone choosing TK is doing so for speed over aesthetics, a fair assumption, so they package TK without aliasing. I did not give a thorough search of the source, just a few greps, read the readme and checked the configs help, but considering that there is not one mention of TK in the Makefile, I think it is a safe assumption. This is part of linux, distros have to consider being able to run on less than state of the art hardware.
Why does Pd look so much worse on linux/windows than in macOS?
@oid:
all my wires come out as shown in the screen grab of my redraw of Ingox's patch, nice crisp single pixel lines.
and
I have not seen aliasing effects like that since the early 90s
We might be having a terminology problem here.
Graphics aliasing is: A line should ideally look like a diagonal, but instead it looks like stairsteps.
The "changing thickness" that you mentioned could be seen as one case of aliasing... but... your "nice crisp single pixel lines" are in fact aliased. You are seeing aliasing -- every day when you use Pd. (Edit: deleted a bit here, not helpful comment from me)
So, for fun:
(
u = UserView(nil, Rect(800, 200, 450, 300)).front;
u.background = Color.white;
u.drawFunc = { |view|
var drawPort = { |x, y|
3.do { |i|
Pen.moveTo(Point(x, y + i))
.lineTo(Point(x + 8, y + i))
};
Pen.stroke;
};
Pen
.color_(Color.black)
// integer pixels are "between" canvas pixels
// and subject to anti-aliasing
// by shifting the coordinates by a half pixel,
// lines are drawn exactly on display pixels
.translate(0.5, 0.5)
.moveTo(106@29)
.lineTo(130@29)
.lineTo(135@34)
.lineTo(135@49)
.lineTo(106@49)
.lineTo(106@29)
.stroke;
drawPort.(106, 29);
drawPort.(106, 47);
Pen.moveTo(117@142)
.lineTo(157@142)
.lineTo(157@162)
.lineTo(117@162)
.lineTo(117@142)
.stroke;
drawPort.(117, 142);
drawPort.(117, 160);
Pen.moveTo(109@49).lineTo(120@142).stroke;
};
u.refresh;
)
If you prefer the version on the left, that's fine. We can agree to disagree about the aesthetics. But I don't think there's any room to disagree with my assertion that the version on the left does not reflect the state-of-the-art in graphics rendering. It simply is out of date.
Would Pd benefit from a more modern graphical presentation? Yes. (Would it be a large investment of developer resources -- yeah, probably too large. So it won't happen. Doesn't mean that the current state of things is good exactly.)
@ddw_music @ingox what do you get if you run lsof -p $(pidof Xorg) | grep /dev/dri in a terminal?
I get nothing.
this is a driver issue or possibly your distro's TK
If it's a driver issue, that would be assuming that the processing chain goes something like "software requests a line to be drawn --> the request is passed along to the video driver --> video driver does (or doesn't do) anti-aliasing." I'm pretty sure that's not how it works -- especially considering that the above screenshot shows different rendering, but under the same video driver.
The distro's TK version:
$ tclsh
% info patchlevel
8.6.8
The absolute most recent seems to be 8.6.10. So I would doubt that there is a different Linux distribution where Tk's drawing is significantly improved.
So let's compare Tk's native drawing outside of Pd to Qt, borrowing a script from http://zetcode.com/gui/tcltktutorial/drawing/ :
That confirms one thing at least -- it's Tk's fault. The Tk one on the left is... like... it's 2020, why is a graphics toolkit drawing like this in 2020? Are they for real? (So, the Pd problem is that it's hitched itself to a badly out of date wagon. That might have been a good decision at the time, but Tk hasn't kept up with the modern world, and it's holding Pd back in that regard.)
hjh
Unable to get FM saws?
@randal I hacked up your patch a little so I could run it to see what was going on, in particular I removed the algorithm switch from the voice and just took signal from the carrier. Is this not the result you were looking for?
Note that both oscillators are at the same pitch, and I took care to start them at the same time so they'd be in the same phase. I also think you might have accidentally deleted the feedback path for the modulating oscillator. [edit: I see now that you didn't, but the feedback outlet is post amp attenuation, so there is very little feedback. Additionally, you are using s~/r~ which introduces a 64 sample delay--consider using the technique in my next post]
I only have a passing knowledge of FM, but it seems like you have to keep the modulation index (in your case, op2 amp) really low to get the results you're looking for. I don't know how the DX modulation indexes are scaled. Also, if you're evaluting your results in time domain (i.e. looking at the wave shape) I think the phase between the oscillators is important. Adjusting the tuning of the oscillators while they're running will shift their phase relative to each other.