LFO freq can no longer be accurately set to 4-LPC by pattern effect co

If I place a pattern effect command ( 16xx ) to control an LFO devices frequency slider :

163F sets the frequency at 4.048 lines per cycle.

1640 sets the frequency at 3.984 lines per cycle.

Setting LFO frequency at exactly 4 lines per cycle is not possible with the use of pattern effect commands.

Why?

Shouldnt the LFO frequency be exact, by lines or ticks?

Its one of the most important things to automate.

It can still be set to exactly 4LPC by typing the automation point LPC value into the value box in automation lanes.

Hi!

I have made a formula device preset, that allows you to control the LFO speed by pattern commands, it is exact (at least the LFO device displays the anticipated values). It was a surprisingly simple formula (1/x).

Drag&drop the .xrdp file onto your renoise track where the effects are. Link it to the LFO frequency. Automate the first control of the formula with pattern commands.

You can set up a multiplier to control the LFO speed in ticks to achieve fractional resolution, or use coarser resolution by setting it larger than one.

Seems like I cannot attach .xrdp to this forum section, so in the spoiler below is some text to copy in browser and paste into track. It will spawn the formula device you should link to the LFO.

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





true

true

LFO Pattern FX Freq Seq

Bundled Content

false



1.0

Device only





1/(A255Multiplier)





–pattern command resolution Multiplier

local Multiplier = 1.0



PatternFX

B

C

true



0.0

Device only





0.0

Device only





0.0

Device only





-1

Device only





-1

Device only





-1

Device only





This looks cool.

I tried LFO-beatsynced.

I set the destination to LFO-frequecy, and the LFO destination to Filter-Cutoff.

at 120E and 1210, the cycles seem to slow down a bit over time.

I’m not sure if I know how to use this properly.

This is the first time I have tried to use the formula device.

I dont really understand fully.

In the ‘LFO-Beatsynced’ description it says :

This formula shows how to beat sync an LFO
– via the ‘BEATS’ variable. Play the song to
– see the LFO moving.

Is the ‘beats’ variable lines per cycle in the LFO, or the ‘speed’ slider in the formula device?

Sorry I am 100% noob with formula device.

formula device will just transform or generate slider control with lua code.

The “LFO beatsynced” preset is an lfo by itself - it will generate a sine lfo based on song position in very simple way by itself. Only while song is playing. I think it is rather a quick demo of how the variables are used, not thought to be a complete lfo. You can code pretty complex stuff using this device.

My formula you get when copy/paste stuff in spoiler in above post to track is different. It will just translate the values, so you can select exact LPC values in a LFO by pattern commands. It should have as formula “1/(A255Multiplier)”. You hook this device into a lfo speed, not some other fomula. Then you set the first slider “PatternFX” to values from pattern data.

It will wrap the values such that a pattern command like “1101” onto the “pattern FX” slider will set the LFO speed slider to 1.000 lines per cycle, using “1105” will set it to 5.000 LPC, “1110” to 16 LPC. So you can control speed exactly in number of lines by the hex value of the pattern comand, from 1 to 255 lines. I thought that was what you wanted. You can edit the “local Multiplier = 1.0” to for example “local Multiplier = 0.5” and then you double the resolution, so “1105” is 0.5*5 = 2.500 LPC. You can use any number or expression… for example “1/3” will give 1/3rd line resolution, though the first three values will of course result in speed 1LPC because the LFO cannot go faster. I think I should also add an offset function.

Or it could also get a table, such that any value like “1101” “1102” “1103” etc would set the LFO to a LPC value you define yoursef…but then you need to edit the code to input your LPC values. But you need not code, you just need to know how to define numbers in text.

You of course also need to reset the LFO to get it in sync, the formula will only change the speed.

I understand now that works nicely, thanks.

For a clean 8 line cycle I can put an ‘1108’ formula device, slider 1 command with an LFO reset command, ‘1800’ alongside ( when using the formula you wrote ).

Its a shame that pattern effect command ( 16xx ) can not set an exact number of lines to control an LFO devices frequency slider, but I can always use your formula or automation lanes with points ( not forgetting the LFO reset ‘1800’ with every LPC change ).

It seems the ‘up’ and ‘down’ arrows next to the automation lanes value box are not accurate enough to set exact LPCs, so the value must be typed into the box.

Here I made the table thing.

It works like the other. But instead of line speed, each number will access a value in a table. Go to the code section of the formula device, look into the lines in the text editor, it is a small one and will scroll down. you can add your own values or delete some, just as you wish. You can skip values. The “0x” in front will tell it its a hex number just like the pattern commands use - you can assign each of the 256 possible pattern fx command states its own speed or leave it blank. You can program your own LFO speed command with custom values. If value is 0.0 or undefined, it will set the LFO into -inf mode so frozen. In example I defined the command zero to freezing the LFO.

Have good fun…

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





true

true

LFO-Speed-Slots

User Library

true



1.0

Device only





func(A)





local slots = {}

– 0.0 = -inf speed

slots[0x0]=0.0

slots[0x1]=8

slots[0x2]=16

slots[0x3]=24

slots[0x4]=5.3984572364283457236

slots[0x8]=(13/5)8

slots[0x9]=13 + 1/3

slots[0xA]=1024

slots[0xB]=64

–add up to 0xff

function func(s)

local freq=slots[floor(s
255+0.5)]

if freq == nil or freq==0.0 then return 0.0 else return 1/freq end

end



Command

B

C

true



0.00392156886

Device only





0.0

Device only





0.0

Device only





-1

Device only





-1

Device only





-1

Device only





Thanks for making and posting this.

Its a great introduction to the formula device.

Nice examples of how to make custom commands to control LFO frequency.

Looks like there should be no concern about the accuracy of of the LFO frequency as is can be defined up to 19 decimal places.

– 0.0 = -inf speed 1100 = -inf LPC ( frozen )

slots[0x4]=5.3984572364283457236 1104 = 5.3984572364283457236 LPC

I guess the straight LFO cycles would all be 64 divided by 2, 4, 8, 16, 32, 64, 128, 256 ( if pattern length was 64 ).

If I type a number with 19 decimal places ( like the number in [0x4] example ) into the value box in automation lanes, will it remain but only show 3 decimal places, or will it round the number up to 3 decimal places?

I only ask because 8 lines divided by 3 ( a half-note / minim triplet, if LPB is 4?? ) is 2.6666666666666666.

Glad you like it. As I said you can remove/skip/add numbers to your liking, and they don’t have to be defined in the right order. You build your own LFO speed command.

Renoise effects will crop the number display, but internally they will work with much more precise numbers. So you can use stuff like “64/3”, I think it will stay as exact as 32bit floating point numbers will allow. This is also true for number you enter with numberical keyboard after clicking on the values. You can see exact used number by for example copy the device, then paste into a text editor, or use scripting functions to read out the values.

Btw the numbers is the number of lines that one LFO cycle will last. So low numbers are fast, and large numbers will be very slow. So if pattern length is 64, that value will make the LFO cycle once during a pattern. The 64/3 will of course make it cycle three times during a pattern.

Yes, nice one! Also was just looking for a easy way to automate my lfo freq. :slight_smile:
Thanks for this OopslFly

Renoise effects will crop the number display, but internally they will work with much more precise numbers. So you can use stuff like “64/3”, I think it will stay as exact as 32bit floating point numbers will allow.

Thanks. This is good information to know.