Comments (18)
hmm oh maybe it's because I use * isntead of + for pitch offset. I need to setup a ratio system / multiplication system rather than use addition.
from rs-met.
hmmm - actually, adding in the (logarithmic) pitch domain sounds right to me. this is mathematically the same as multiplying in the raw frequency domain as logarithms take multiplication to addition: log(a*b) = log(a)+log(b). so when you add a constant in the pitch domain, and then convert to frequency after addeing, this should yield constant frequency ratios.
from rs-met.
maybe i need more details and/or look at your actual code
from rs-met.
it's heavily influenced by amplitude of modulation as well.
from rs-met.
hmm I think it's working correctly (just played with another FM synth to see how it sounds), just the results are not as I want them to be. Not sure what the solution is other than to have per-key settings to fine-tune each key in terms of mod depth and frequency. When I do that I might see a pattern that I could use to have more musical FM.
from rs-met.
maybe some amount of (negative) keytracking of the modulation depth? this would make higher notes more muffled
from rs-met.
naa, that's not the issue. will close!
from rs-met.
re-opening this issue. I'd like to fix this before releasing:
https://puu.sh/wbMeI/9bd9aa25b8.mp4
It's the pitch offset that is bothering me. If you have pitch offset set to -24 -12 0 12 24 etc it works as expected. If you do something like 12.5 or even 13 or ANYTHING that is not a perfect multiple of 12 you get a frequency that is more and more off depending on the note you play.
How would I get a consistent sound with a pitch offset?
from rs-met.
ok here's a clue
.1 semitone offset playing C3 equates to playing C4 with 0.05 semitone offset. So every octave up needs to halve the semitone offset.
from rs-met.
aaahh! i think, i see. maybe...how to explain....you are getting some kind of beating effect there which is perceived in the time domain - like an lfo. and you want the "lfo-frequency" to stay the same throughout the keyrange. but when you let the pitch-offset between the two oscillators stay the same throughout the keyrange, the frequency ratio of the 2 oscs stays the same - and the beating frequency goes up as well. so when you play a note an octave higher, you have also twice the beating frequency...oh my god...i think what i just said sounds very convoluted. but yeah - i think, for constant beating frequency, you need the frequency difference between the two oscs (not the frequency ratio) stay the same throughout the keyrange. ...which is what happens when you divide the pitch-offset by two for each octave you go up
from rs-met.
you could also just add something to the frequency of one osc (after conversion from pitch to frequency), i.e. introduce an additional absolute frequency offset
from rs-met.
ok, yes, a simple frequency offset works.
from rs-met.
also, you have to use to use LINEAR frequency modulation not exponential for FM, if you want things to stay in tune. In other words, I shouldn't be doing pitchToFreq(lfo_mod * depth + tuning); I need to do pitchToFreq(tuning) + lfo_mod * depth
from rs-met.
oh - yes - i think exponential FM creates inharmonic spectra even for simple carrier/modulator ratios (where linear FM produces harmonic spectra)
from rs-met.
or...does it? not sure
from rs-met.
ah: https://www.kvraudio.com/forum/viewtopic.php?t=310508
"The main problem with exponential FM is, as you increase the FM index, the perceived fundamental of the pitch shifts."
from rs-met.
here is a paper about exponential FM: http://recherche.ircam.fr/pub/dafx11/Papers/60_e.pdf it has equations that could probably be used to compensate for this detuning, making exponential FM playable in tune. ...could be interesting to explore....
from rs-met.
I would be musical exponential fm, will return to this topic in the future.
from rs-met.
Related Issues (20)
- Discussion: Denoiser made for plucked and metallic sounds
- Need amplitude matching algorithm ASAP HOT 74
- a new matrix implementation HOT 8
- Distinguishing relevant peaks from the irrelevant ones HOT 28
- Need resampling algorithms. HOT 24
- curve fitting (linear and polynomial regression and more) HOT 5
- function plotting code HOT 8
- Additive synthesis efficient sine? HOT 2
- chaotic algorithms and (in)stability HOT 9
- build errors HOT 1
- How do you get frequencies from HarmonicAnalyser harmonics? HOT 11
- on the amplitude gaps in the spectral models HOT 4
- rsShiftForBestMatch not working for whole waveforms HOT 6
- Locating zero-crossings and extrema with subsample precision HOT 1
- new class rsSingleSineModeler HOT 2
- rootMeanSqaure function is giving wrong value
- Need butterworth order 2 highpass filters for LUFS, code is apparently ommitted? HOT 1
- Need help with rsTimeWarper, seems to be warping off-time HOT 3
- RS_DEBUG_BREAK causes crash in non-debug builds HOT 4
- Please make a 64-bit version of FuncShaper
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 rs-met.