freenode/#sicl - IRC Chatlog
Search
6:16:46
beach
This video is more about composition and playing, but he has others that are specifically showing off how sound is created.
6:21:18
no-defun-allowed
The piano on my sampler interpolates between samples of the same pitch played with different dynamics. It does have the same utilities like layering and splitting, so I think it is a fairly normal "music workstation".
6:21:51
beach
Here is a more recent one, and it has more sound stuff: https://www.youtube.com/watch?v=HUErvWA5pYE
6:23:30
beach
"interpolating between samples" doesn't sound right in terms of psychoacoustics, but maybe the result is acceptable.
6:25:57
no-defun-allowed
Well, looking at the product page, there are specific engines for pianos, electric pianos, plucked strings and tonewheel organs, but sampling and analog-modelling synthesis are also provided.
6:27:47
no-defun-allowed
There's probably a significant amount of cleaning and preprocessing on the samples to allow sample blending to be possible, however. You can't create your own samples on my keyboard to my knowledge.
6:45:00
beach
As usual, I haven't looked into how things are done in products. I prefer to imagine how to do things if I were in charge. At least to begin with.
8:07:49
|3b|
ACTION wonders if orchestra would be better with FFT based rather than just adding sine waves
8:11:50
|3b|
question is whether you can build coefficients corresponding to current state of orchestra and do IFFT more efficiently than you can build and add a bunch of sine waves
8:13:03
|3b|
similarly to whether you can do a convolution faster than an FFT + per-element multiply + IFFT in image processing
8:20:46
beach
SIN can not be relied upon anyway. You get cancellation of significant digits after a while.
8:24:45
|3b|
'digital differential analyser', old signal processing (and 2d graphics) trick for calculating lots of sequential values of various equations (points on line/circle for graphics) efficiently
8:25:17
beach
Well, I know of two techniques for generating sine waves. I think they are called "resonators".
8:27:26
beach
The other technique is to use a rotating vector in the complex plane and multiply it by e^(i φ) in each iteration. That requires two multiplications and two additions.
8:38:24
beach
My previous calculation estimated 10ns to generate a sample. I think it can be shorter than that.
8:39:13
beach
Plus, I didn't take into account techniques for reducing the number of oscillators based on psychoacoustics.
8:39:49
|3b|
SIMD could probably give you 2x or 4x or reasonably easily (assuming the part that gives you access to simd stuff is already implemented, not sure about current state of that in cl)
8:41:13
beach
For a project like this, I am pretty sure the implementation maintainer(s) would make an effort to help out.
8:41:26
|3b|
ACTION has seen recent activity in that area (SIMD stuff in general) from SBCL, but not looked at details
8:45:22
no-defun-allowed
ACTION throws a (n unfortunately not real) space cadet in the general direction |3b|
8:46:56
pierpal
IIRC, the korg chronos, used in the videos, is made from an off the shelf Intel MB running linux
8:47:57
no-defun-allowed
yeah, most "hardware" synths are usually some embedded processor running some kind of rtos or linux with a decent dsp
8:48:30
no-defun-allowed
a chronos probably isn't handling anything else like networking or complex graphics/compositing while emitting sound though
8:55:56
|3b|
(integrated GPUs are better at latency than dedicated, since they share memory with host)
8:56:46
no-defun-allowed
yeah, it's mostly sampling with some specific synthesis for simpler waveforms like analog synths, electric pianos and organs
8:59:25
beach
I think someone should try a scaled-up experiment with additive synthesis using Common Lisp.
9:01:35
no-defun-allowed
with your resonator x(t+1) = k x(t) - x(t-1), k = cos (2 pi f/fx), is f the sample frequency and fx the desired sample rate?
9:01:50
|3b|
https://marcan.st/2016/06/hacking-and-upgrading-the-korg-kronos/ has some interesting info on the korg, separate arm CPU for IO, 1 core of atom for synth, 1 for effects, both in kernel modules
14:50:56
beach
Initial experiment is disappointing. I implemented two versions of the oscillator, one with double floats and one with double float complex numbers. The first one requires one multiplication and one addition for each sample. The second one requires four multiplications and two additions for each sample.
14:51:03
beach
I created some abstractions, so that an oscillator is a standard object with slots for the frequency, amplitude, and the data for the sample(s). Each oscillator also has a buffer in the form of a specialized vector with 10 elements.
14:51:09
beach
A central synthesizer object asks each oscillator for 10 samples and sums them up in its own vector. Anyway, it takes 10 times as long as my calculation above. But both versions take the same time, suggesting that the entire thing is dominated by generic function dispatch and other overhead.
14:52:45
beach
I can do several things to check the hypothesis. I can do many more samples per iteration. That won't fly in a real-time situation though, so it would just be to test the hypothesis. And I can time the raw computation without the abstractions to see what max performance can be expected.
14:53:51
beach
But I need to get back to our ELS paper submissions, so this work will only be during breaks.
15:23:54
Shinmera
Not really. At the moment I use generic functions in the hot loop and it's fine for my purposes.
15:24:39
Shinmera
I experienced trouble when I tried to do everything in Lisp, especially things like sample conversion.
15:25:09
Shinmera
So my sound processing stuff has a large chunk of C stuff, much to my own dissatisfaction
15:25:47
Shinmera
But maybe I was just doing things really dumb in my first attempt and it could be done just fine in Lisp too, by someone smarter than me :)
15:39:44
beach
So with a single core, max performance is around 20μs/5ns = 4000 simultaneous oscillators of this type.