Very experimental tool - Native synth/oscillator effort

I was messing around with writing sample data live and came up with this tool. It uses the LFO meta device to write sample values into Instrument 1 on the fly. I’m no expert on synthesis but I think its a kind of oscillator, however it sounds awful (or experimental) and is full of digital artefacts, this is probably down to with the way I have implemented it (v0.2 sounds much better). I thought I would share it here anyway as I haven’t seen this done before, maybe someone better than me at coding can help me improve on it?

To make this work you will need some kind of midi loopback driver, I use the IAC driver on the Mac and am not sure what the best option for Windows is. You may also need a midi controller to do the mapping or use the attached .XRNS file where I have mapped the controls already.
Edit: v0.2 no longer needs a loopback driver

How to set it up and a quick demo are in the last video below.
A word of warning, this generates lots of high frequency pops, crackles noises etc.
Keep the volume low or don’t bother, I will not be held responsible for any damage to your ears or speakers!

Note: I found out most of the pops and crackles are down to the screen recording interfering with the tool, it doesn’t sound this bad if you use it without screen recording - v0.2 has hardly any glitches

Original version 0.1 using a loopback driver:


http://www.youtube.com/watch?v=SuYzphwzSGs

Some better sounds with version 0.1:


http://www.youtube.com/watch?v=euPZfUzhGg8

Version 0.2 - No longer needs a loopback driver, works with native LFO directly:

http://www.youtube.com/watch?v=lfQgC4ifNvY

Now things are starting to get interesting…

http://www.youtube.com/watch?v=5lAqXPICrxc

Hmmmm…

http://www.youtube.com/watch?v=fGMdShMmo9M

Nice effort, but a very questionable tool indeed. I’ll explain.

If you want to generate waves to the instrument samples, just use math in LUA and preprocess the waveform. A tool like this has been done here: http://www.renoise.com/tools/custom-wave-synth

Some things to consider about the effort:

  1. LFO’s run in the low frequency range so the oscillator will at best play deep bass if you have really high bpm (like 999)
  2. Midi will not provide you with 44100hz of resolution so you will loose packets of data through the routing this may be some of the artifacts
  3. LUA does not operate on the realtime thread so LUA itself cannot handle the 44100hz frequency you’re trying to operate at. This will also provide some artifacts
  4. You are reading and writing to a buffer, your read playhead and your write playhead will not be in sync as they operate on different threads.

But! What you could do is just skip lua all together and just do this in renoise.

Try routing three devices in a DSP chain as follows:
#Line Input -> DC Offset -> LFO

Set the #Line Input to -INF volume, we want silence to be sent through the channel so renoise computes all the dsp action.

Route the LFO to dc offset’s dc offset. The dc offset will be your sample value on the channel now oscillated by the LFO

Set your BPM to 999 and LPB to 24 and you should hear a tone that can be changed with the LFO frequency

You can also take a look at “DemoSong - Neurotix - Nivi” that has no instruments and generates it’s sounds through the DSP chain.

p.s. your manifest.xml has incorrect version formatting according to my renoise (2.8.0 Os X)

Thanks for the feedback mogue, I agree it is questionable as a tool, its really more of an experiment and it won’t be released on the tools page. I wasn’t initially going to share it but I thought it was interesting , before trying this I didn’t think I could generate any sound with scripting.

That is a cool trick and yes it does the same thing as my tool (in a much better way and it can be rendered too) although they do sound different. I am aware of the pre processed approach but I was trying to do something that worked in realtime by processing one sample at a time. What I really would like to do is have the lfo in the script and avoid all the midi loopback stuff but I couldn’t work out how to do it with scripting without making Renoise get stuck in a loop, and anyway as far as I can tell Lua doesn’t run quick enough for that.

Thanks for pointing that out, fixed now. I’ve also posted another vid that has some better sounds on it.

Cheers

Indeed, this is an experiment in an alternative approach.

You can do this if you are careful. My synth tool (ReSynth4) allows you to change any parameters (with the exception of the programmable arpeggiator) in realtime and it will affect any currently playing notes. Load up a Resynth instrument in an instrument slot, hold down some keys on a midi keyboard and adjust the oscillator / envelope / filter controls to hear it affecting the current notes. However, changing oscillator type will stop that oscillator on any held notes.

You could try reading the “Reset” parameter of the LFO device. It is a “hidden” parameter that sets the phase position of the LFO from other meta devices, I haven’t tried reading it from LUA but I’m guessing it’s doable.

This can be done at regular intervals (couple of ms.) within the app_idle_notifier function.

An idea for smoothing the sound; You could calculate the time between updates (calls to app_idle_notifier) in samples and interpolate the values for the last time frame.

But a great experiment, I like it. Second video has some interesting sounds, glitchy is good :)

the idea is similar to this experiment I have made a while ago

ReSynth is amazing, i didn’t realise you could adjust its parameters on the fly, I just had a play with the PW setting while it was playing… nice!
Although Renoise gets a bit laggy if I change it too quickly, what’s happening here? Is it writing 208 frames of sample data every time the dial is adjusted?

Is it possible to get an LFO to modulate the PW within the tool or would I need to use some kind of midi loopback like I have done in my tool?

Thanks mogue, agreed glitchy is good :) I don’t know about the app_idle_notifier, I’ll look it up. Can the reset lfo be set with a script?

I just realised that a major cause of the glitches was down to the screen recording. Without that running the sound is a lot better, so no more demo vids of this I’m afraid :(

I’ve also found that a sample size of 44 frames results in a sound that is in tune, and that also lower lfo values sound better than higher values, in fact the lfo seems to be adjusting the volume envelope more than anything else. Not sure whats really going on in this but the sound is only generated as you change the lfo value…

Anyway with a bit (ok a lot) of processing it doesn’t sound half bad, here’s a quick demo song I made, its starts of with the raw sound and you can hear the effects gradually all added upto 1:18

http://soundcloud.com/afta8/renoise-oscillator-tool-test

That looks awesome, I can’t get it to work though, it says its incompatible with 2.8, is their a simple way to tweak this so it works with 2.8?

From reading the instructions it sounds like your tool manages to use a CC device to control tool parameters? How do you do this without using a loopback driver? Could the same technique be used to control say the PW parameter on ReSynth?

I thought it relied on the Midi CC device which got renamed in the later Renoise editions (from midicc to something like midicontrol).
If you change those references, i think it will work again.

Thanks Vv I shall investigate…

After further tweaking I have made this work without the need for a midi loopback, see video below. This time I have a notifier triggering triggering the sample draw function every time the lfo parameter changes, I feel a bit silly now given this was much easier to do and sounds better with no glitches.
Maybe this thread should be relegated to the beginners forum as a lesson on looking for the simplest solution rather than the most convoluted!

Apologies to old timers who may have seen all this kind of thing before, it’s all exciting new frontiers to a noob like me!

Cheers :)

Using the notifier technique to create a pulse wave with its width modulated by the native lfo… sweeet

http://www.youtube.com/watch?v=EqPq5uoZDto

Make sure you create an lfo and hydra on track 1 before running this or it will throw up an error.

Nice example, but remember that it is still GUI thread timing :)

I’m actually trying to use this issue to its advantage by exploring what kind of novel sounds can be achieved that aren’t found in VST’s. My view is that limitations can lead to more innovation, and to be honest some of the artefacts due to it being in the GUI thread sound quite pleasing to me. Why else would I bother to do this when there are so many VST’s around that can do this stuff already? :)

Still, its all good learning and I’m loving the doors opened up by scripting. I’m having way more fun with this than I ever did with MAX/MSP or Reaktor :)

I just need to try and eliminate the few crackles I get every now and then… next stop is to get my head around app idle.

Use this device chain to control the load on the GUI thread. It uses a formula device to scale the LFO that controls the pulsewidth (use the resolution slider on the formula device) and therefore vastly reduces the number of notifiers being fired off to the script. This has really improved the sound quality as it allows for bigger sample sizes and also less clicks…

Click to view contents <?xml version="1.0" encoding="UTF-8"?>









true

false

Init

true

true

Mixer



0.5

Device only





0.465944469

Device only





0.0

Device only





0.5

Device only





0.18045257

Device only



true





true

true

Init

true

true



-1

Device only





3

Device only





0.0

Device only





0.920000076

Device only





2.98023224e-08

Device only





1.87500012

Device only





0.0

Device only





Linear

16

0.0

Unipolar



0,0.0

15,0.933333337

26,0.233333334

63,1.0





false

true





true

false

Init

true

true

PW Control

1



0.519999981

Mixer and Device





-1

Device only





-1

Device only





-1

Device only





0.0

Device only





1.0

Device only



Linear



-1

Device only





-1

Device only





-1

Device only





0.0

Device only





1.0

Device only



Linear



-1

Device only





-1

Device only





-1

Device only





0.0

Device only





1.0

Device only



Linear



-1

Device only





-1

Device only





-1

Device only





0.0

Device only





1.0

Device only



Linear



-1

Device only





-1

Device only





-1

Device only





0.0

Device only





1.0

Device only



Linear



-1

Device only





-1

Device only





-1

Device only





0.0

Device only





1.0

Device only



Linear



-1

Device only





-1

Device only





-1

Device only





0.0

Device only





1.0

Device only



Linear



-1

Device only





-1

Device only





-1

Device only





0.0

Device only





1.0

Device only



Linear



-1

Device only





-1

Device only





-1

Device only





0.0

Device only





1.0

Device only



Linear





true

false

Init

true

true

Notifier res scale



(ceil(A*(100*B))/(100*B))











Input

Resolution

-

true

0



0.490066826

Mixer and Device





0.5

Mixer and Device





0.0

Device only





-1

Device only





2

Device only





0.0

Device only









Thanks.

The reason for the laggyness on certain parameters is Renoise’s sample undo buffer. When you change certain parameters, that sample will be rerendered. However, due to the resolution of the controls, this occurs many times. If the sample editor undo is enabled, each of these intermediate states will be remembered as an undo point. Disabling the sample editor undo should make it much more responsive.

There is a lua programmed LFO for pulse width in VA oscillator mode. Adjacent to the pulse width control are controls for speed and depth. These will prerender LFO affects into the pulse width of the oscillator sample.

I like it! Thx

Have you considered adding a timer option that watches if certain values of these controls haven’t changed after half of a second and then push the value through if this condition is met?
In that way the undo buffer is also not overloaded with data.