Comments (3)
EDIT changed size*2+1, a benign mistake I copied everywhere, to size/2+1
also made the triangle wave start upwards instead of downwards
About this I don't know, didn't check against real oscillator, but I remember the LFO triangle was starting going up.
EDIT checked against ARIA, all waves starting upwards, fixed the square also
from sfizz.
It's implemented in the PR #61
For a short summary of how this thing works:
-
there exists a class
HarmonicProfile
which is a spectrum generator for any kind of periodic wave.
You invoke this with successive indices (DFT bin), this returns the amplitude and phase as complex number. It starts at index 1 for fundamentalf0
, then2*f0
,3*f0
, up to any size.
The spectrums of conventional waves extend to infinity, that we are able to truncate at whichever point we want. -
it can
generate
into an array of any size, by filling a spectrum of the matching size and doing IFFT.
When parametercutoff
is set at 0.5, the whole harmonic range is generated up to Nyquist, or <0.5 to cut it sooner. -
there exist multisamples, which wrap this to generate sets of wavetables for different frequency ranges (currently 1 per octave). For each table, this adjusts
cutoff
such that, when the table is repitched to the range's highest frequency, the scaled harmonics do not exceed Nyquist frequency. -
one can plot a multisamples with
sfizz_test_wavetables
and option-m
. Pictured below.
When all is well, the final range of 10-20kHz reduces the signal to a single sine wave.
-
the demo program permits to listen to an oscillator generated in realtime with a frequency sweep.
When frequency modulation causes a jump from a wavetable to another, this creates a discontinuity, but I don't find it very perceptible.
A thing of note: in Cakewalk's oscillators, there exists a quality setting calledDual-High
, which permits to interpolate from 2 adjacent wavetables of a multisample, and avoids discontinuity created by such jumps. -
regarding custom oscillators from sound files, it's not too hard to modify the system to add it.
Example: sample=period.wav oscillator=on
The process is like this:
- receive a sound file as a float span, compute its FFT
(this FFT will likely needs scaling ; divide by the signal size)
- create an instance of a subclass of HarmonicProfile
, that will return each component for indices in bounds of the FFT array just computed, otherwise 0
- invoke the method createForHarmonicProfile
, like for any other profile of the predefined waves
from sfizz.
Merged in #61
from sfizz.
Related Issues (20)
- ⚠️ Feature requests | non-bug issues in Discussions ⚠️
- bug when off_by is involved and the two midi notes are played exactly at the same time HOT 4
- Transpose vs tune HOT 4
- RAM usage : Samples are continuously loaded in RAM while playing HOT 2
- Error building Arch AUR makepkg HOT 3
- Note-On performance issue
- Support `lotimer` / `hitimer` HOT 4
- Tests fails with the latest Abseil HOT 7
- Invalid output when the number of output is above 1 and using effects
- Compatibility with catch2 >= 3
- Issues when Note on/off at the maximum delay HOT 2
- Ardour freezes for a long time after stopping playback
- All voices are always active after sustain is released HOT 2
- overriding default_path for each sfz mapping HOT 2
- Segfault during use of `sfizz_render` HOT 2
- ampeg_delay make the note play indefinitely HOT 1
- error: no member named 'StrCat' in namespace 'absl' HOT 11
- [question] Is LV2 support present? HOT 2
- Support lotimer / hitimer on release regions
- Add `eqN_keytrack` & `eqN_keycenter`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sfizz.