I do like your enthusiasm, Bit_Arts
But I’m not sure if this particular technique will work quite as well as you might hope. Let me share a few of my own thoughts and discoveries…
Like all other meta devices in Renoise, the Formula Device will only produce a unique output value once per tick. Therefore, the frequency of the output generated by the Formula Device is ultimately governed by the following factors: Ticks Per Line, Lines Per Beat and Beats Per Minute.
With TPL, LPB and BPM all set to their highest possible values (16, 256 and 999, respectively), the maximum theoretical ‘meta frequency’ (sampling rate, in other words) you can achieve is: 68198.4 Hz.
You can calculate this with the following formula:
lines_per_second = (beats_per_minute / 60) * lines_per_beat
meta_frequency = lines_per_second * ticks_per_line
If you intend to use this meta output as the basis for any kind of synthesis (driving a DC Offset device to generate a crude waveform, for example), then the highest tone frequency we can generate will be half that sampling rate, according to Nyquist–Shannon sampling theorem. Therefore, our maximum theoretical tone frequency is: 34099.2 Hz.
In reality, you will never get anywhere near this theoretical upper limit using Renoise’s own native devices (and I doubt any external plugins, for that matter), because pretty much every parameter you might want to control is going to be ramped (smoothed) in some way, even if it’s only by a very small amount. This smoothing acts as a kind of lowpass filter, and will greatly reduce the rate at which the parameter can respond to the changes being produced by this “HFO” concept. So while you may in fact be modulating the parameter with a very high frequency signal, it will not actually be able to respond fast enough to produce the kind of high resolution result you desire.
Using the DC Offset device as a synthesis method is a perfect example of this. The DC Offset parameter is smoothed in order to avoid clicks/pops in the output produced by very rapid changes. You can actually modulate this parameter at low frequencies and produce a variety of waveforms this way, but you will quickly run into a speed limit where the output simply becomes quite useless. Essentially, you reach a point where you’re sending parameter changes faster than the actual parameter smoothing can respond, and then it just sort of turns into a blurry, muddy, indistinct mess.
Nevertheless, if you work within some more realistic (ie. lower) frequency limits, then it’s still absolutely possible to do some pretty damn interesting stuff here! You can still definitely modulate DSP parameters to make them do really weird things, to take advantage of strange artifacts and other behavioural quirks, etc.
But using this stuff for complex, real-time synthesis… well, Renoise’s DSP chain and meta devices were simply never designed with this type of usage in mind. You can achieve some technically interesting results, but you will not really be able to directly synthesize complex waveforms this way.
So for now, if you want to explore FM(ish) synthesis, then combining/mixing multiple RingMod devices is probably the best approach in my opinion.
Going back to your original post…
Here’s a forumula (ie. to plug directly into the Formula Device) that you’ll hopefully find useful. It will output a sinewave at the desired frequency (while your song is playing), regardless of your song’s TPL/LPB/BPM settings. Input “A” is assumed to be the Frequency (I’ve scaled mine down to a max of 11025 Hz, but you can tweak this to your liking). Obviously higher TPL/LPB/BPM will produce higher resolution results, but this formula is basically independent of those settings and should behave roughly the same way no matter what.
Formula tab:
((sin((((SAMPLES * (A * 11025)) % SRATE ) / SRATE) * TWOPI) + 1) * 0.5)
User tab:
(no custom functions)
Or here’s the complete DSP device XML if you want to copy/paste into your chain:
<?xml version="1.0" encoding="UTF-8"?>
<filterdeviceclipboard doc_version="0"><br>
<deviceslot type="FormulaMetaDevice"><br>
<isactive>true</isactive><br>
<isselected>true</isselected><br>
<selectedpresetname>Oscillator</selectedpresetname><br>
<selectedpresetismodified>true</selectedpresetismodified><br>
<ismaximized>true</ismaximized><br>
<customdevicename>Oscillator</customdevicename><br>
<formulaparagraphs><br>
<formulaparagraph>((sin((((SAMPLES * (A * 11025)) % SRATE ) / SRATE) * TWOPI) + 1) * 0.5)</formulaparagraph><br>
</formulaparagraphs><br>
<functionsparagraphs><br>
<functionsparagraph></functionsparagraph><br>
</functionsparagraphs><br>
<inputnamea>Frequency</inputnamea><br>
<inputnameb>-</inputnameb><br>
<inputnamec>-</inputnamec><br>
<editorvisible>true</editorvisible><br>
<panelvisible>0</panelvisible><br>
<inputa><br>
<value>0.5</value><br>
<visualization>Mixer and Device</visualization><br>
</inputa><br>
<inputb><br>
<value>0.0</value><br>
<visualization>Mixer and Device</visualization><br>
</inputb><br>
<inputc><br>
<value>0.0</value><br>
<visualization>Mixer and Device</visualization><br>
</inputc><br>
<desttrack><br>
<value>-1</value><br>
<visualization>Device only</visualization><br>
</desttrack><br>
<desteffect><br>
<value>-1</value><br>
<visualization>Device only</visualization><br>
</desteffect><br>
<destparameter><br>
<value>-1</value><br>
<visualization>Device only</visualization><br>
</destparameter><br>
</deviceslot><br>
</filterdeviceclipboard>