but. I read that technique number 1 works very intensively with the processor and is not entirely feasible. Is this true for ARM processors like the iPad?
This makes a difficult difficult task (pun intended). Accelerate.framework provides optimized variations of these functions (fwiw), but this still complicates the simple problem. As a general note: floating point calculations on devices are slow. A floating point implementation can significantly reduce the cost of your program. This will likely lead to a compromise of functions, polyphony or quality. Without knowing reqs, it's hard to say if you can handle floating point calculations.
Q. Whatever technique I choose, is it possible to solve the smoothing problem by simply connecting a low-pass filter to the output of the generator?
This will not work for signals generated in the time domain unless you reprogram.
C. Any other suggestion on how to implement such a generator?
see below
Any suggestions on using C ++ toolkit? I watched STK from CCRMA, but I don't know if there are other more suitable libraries.
STK is more like a training tool than a tool kit designed for built-in synthesizers. More suitable implementations exist.
Option 1. Invent a function that occupies the position of the handle and calculates the spectrum of the actual signal (an array of amplitudes and frequencies), and then uses a bunch of sinusoidal functions and a sum unit to implement the output signal.
Option 2. Similar to 1. but apply the inverse Fourier transform instead of sines and sums (OK, at this moment I’m not sure if they are actually the same.)
It is relatively slow on desktops.
Option 4. Start with two waves of tooth teeth (they contain both even and odd harmonics), invert one and sum them up and control the amplitude of each of them with the handle. Waveforms would not be
You can do this efficiently enough (for example, using BLIT) to generate an alias. However, BLIT is limited to several waveforms (you can use it for saw and square). You can look back at the story and ask: "How did they solve this problem in hardware and software synthesizers around 2000." That was one solution. Another was:
Option 3. Create a waveform table for each possible pen position and use the wave table synthesis method to generate the output signal.
Given the capabilities of the device, I would recommend an int implementation of this or BLIT.
The table is easy to disassemble and implement, and also provides good sound and CPU results. It is also highly customizable for CPU / Memory / Quality tradeoffs.
If you want the alias to be free (or closed), go to BLIT (or relative). The reason is that you will need a good piece of memory and a good amount of oversampling to minimize the lack of audio smoothing with wavetables.
Implementation:
There are many BLIT implementations (and families) on the Internet.
Here the table napkin is laid out:
enum { WF_Sine, WF_Saw, WF_Square, WF_COUNT }; enum { TableSize = SomePowerOfTwo }; struct sc_waveform { uint32_t at[TableSize]; }; enum { NPitches = Something }; sc_waveform oscs[WF_COUNT][NPitches];
After initialization, use additive synthesis to populate the oscs
.
During playback, use either:
- interpolation and oversampling for reading from tables
- or a large amount of oversampling the signal, and then downsampling (which is an effective CPU).
For reference: I would appreciate the linear interpolation of the table, which consumed an irresponsible amount of memory (taking into account the available amount) without oversampling, should support your alias frequencies at or below -40 dB if you were not supposed to hear partial sound, and you displayed on frequency 44.1 kHz. This is a naive brute force approach! You can do better with a little extra work.
Finally, you should also find relevant information if you google "Vector Synthesis" - what you are describing is a primitive form.