Oscillators Frequency Piano Roll

User avatar
fentras
Posts: 8
Joined: 20 Dec 2019 14:49
Contact:

Oscillators Frequency Piano Roll

Post by fentras »

Hello! (skip this paragraph to get to the question) I recently started making music entirely on Linux and I found this beautiful and so unusual (for me) piece of music production software. I was looking for powerful yet open-source (for now), bug-free and hassle-free (in terms of setting up the environment) DAW to start making my music. And I found Radium. It wasn't so easy to understand at first but due to working with Carla for a bit I figured how to connect everything in Mixer and generate sound. So I decided to stick with this software because it's the most powerful out there.

To challenge myself I thought it would be interesting to make a song using only bundled plugins and sounds. Since I was working for a little while with VCVRack I tried to make a simple patch using LADSPA Sin/Saw Oscillator. But I was stuck with not being able to control the frequency using MIDI Controller or Piano Roll. Seems like generators' pitch/frequency/octave can't be controlled simply by sending notes to the plugin. While looking at other demo songs I saw that it's somehow possible to control variables using Pure Data control (is it?), but I couldn't figure it out. Maybe there is some other way to do it or am I just missing something?

Examples:

If I'm using Saw-VCO I need to control Octave value which has a range between -4 and 4 (float).
IMG_20191220_191019_151.jpg
IMG_20191220_191019_151.jpg (24.78 KiB) Viewed 15237 times
If I'm using C* Sin I need to control Frequency (f) value which has a range between 0 and 2000 (or 20000, I don't remember).
IMG_20191220_191020_808.jpg
IMG_20191220_191020_808.jpg (21.32 KiB) Viewed 15237 times
I'm fine with assigning each key to a specific value, I just need some way to control it through Piano Roll (or my controller keys), not through modulation (or knobs on my controller).
kjetil
Site Admin
Posts: 582
Joined: 20 Jul 2017 20:45

Re: Oscillators Frequency Piano Roll

Post by kjetil »

Yes, you can use Pd to map notes to MIDI CC, if you want to control the effect from pianoroll through MIDI learn. You can also use the Faust instrument. But how about using automation? (Right-click in the track, select "New FX").
User avatar
fentras
Posts: 8
Joined: 20 Dec 2019 14:49
Contact:

Re: Oscillators Frequency Piano Roll

Post by fentras »

I'll try to use Faust, thanks! I want to make a synth using plugins, and controlling it through automation is a bit unusual than using just a piano roll. What if I want to make chords using several oscillators? Controlling all of them using automation will be a huge pain. Or you can assign automation to notes too?
kjetil
Site Admin
Posts: 582
Joined: 20 Jul 2017 20:45

Re: Oscillators Frequency Piano Roll

Post by kjetil »

There are oscillators in Faust, so the best way would be to write faust code. To make a faust instrument, you add these three lines:

Code: Select all

freq = nentry("h:Basic_Parameters/freq [1][unit:Hz] [tooltip:Tone frequency]",120,20,20000,1);
gain = nentry("h:Basic_Parameters/gain [1][tooltip:Gain (value between 0 and 1)]",1,0,1,0.01); 
gate = button("h:Basic_Parameters/gate [1][tooltip:noteOn = 1, noteOff = 0]");
(you need a "freq", a "gain", and a "gate").

Either you add oscillators directly in the faust code (that's the right way), or you can convert input data to automation data by sending out control values through audio to a modulator, and set "Type" to "Audio Input" in the modulator. It should be possible, but probably very frustrating to set up.

If you just want a simple oscillator instrument, one which is incuded in Radium, you can also use the pure data example instrument: Give focus to the editor, press F12, select "New Pd Instrument". But in general, I would recommend using a VST instrument for this since Radium doesn't have simple synthesizers built-in except for things which are there by coinsidence such as the pd example instrument and the ladspa oscillators.
kjetil
Site Admin
Posts: 582
Joined: 20 Jul 2017 20:45

Re: Oscillators Frequency Piano Roll

Post by kjetil »

And yes, using automation seems like the wrong approach for what you want to do. That would probably be a huge pain, as you said. :-)
User avatar
fentras
Posts: 8
Joined: 20 Dec 2019 14:49
Contact:

Re: Oscillators Frequency Piano Roll

Post by fentras »

kjetil wrote: 20 Dec 2019 17:37 The best way would be to write faust code.
Thank you so much for the provided code! It worked as expected and now I have a polyphonic saw oscillator! It didn't worked at first but I found another example and copied some parts of the code and inserted yours in the middle, tweaking a little bit. I will definitely use Faust more now.

PS: I miss this feature where you can set a (e.g. 1/4) countdown before recording input from MIDI while playing. I had to insert another block to imitate the countdown. Or I just didn't find it yet.

Here's the end result (video, audio a little bit compressed):
Radium Faust Sawtooth Oscillator.jpg
Radium Faust Sawtooth Oscillator.jpg (144.33 KiB) Viewed 15223 times
kjetil
Site Admin
Posts: 582
Joined: 20 Jul 2017 20:45

Re: Oscillators Frequency Piano Roll

Post by kjetil »

Very cool! Regarding the metronome countdown, there isn't such a function. Maybe there should be an option for this when right-clicking the "Click" button?

By the way, I did intend to post a complete working example yesterday, but I was in a hurry and could not make it work although I was very certain that my code was correct. Today I found out that the "os.osc" oscillator does not work in "Interp." mode (hardly produces any sound). It does work when using the llvm backend though, so I guess it's a faust bug, but I don't know yet. "os.sawtooth" seem to work with both the interpreter backend and the llvm backend.
kjetil
Site Admin
Posts: 582
Joined: 20 Jul 2017 20:45

Re: Oscillators Frequency Piano Roll

Post by kjetil »

The os.osc bug has been fixed in Faust, so I only need to update Faust in Radium. Hopefully it will be done before the next release.
User avatar
fentras
Posts: 8
Joined: 20 Dec 2019 14:49
Contact:

Re: Oscillators Frequency Piano Roll

Post by fentras »

kjetil wrote: 21 Dec 2019 18:09 Very cool! Regarding the metronome countdown, there isn't such a function. Maybe there should be an option for this when right-clicking the "Click" button?
It would be really great! But I think it's better to put it on "Edit" button because the countdown feature is used mostly when recording.

kjetil wrote: 21 Dec 2019 21:57 The os.osc bug has been fixed in Faust, so I only need to update Faust in Radium. Hopefully it will be done before the next release.
Oh, sounds awesome!
kjetil
Site Admin
Posts: 582
Joined: 20 Jul 2017 20:45

Re: Oscillators Frequency Piano Roll

Post by kjetil »

kjetil wrote: 21 Dec 2019 18:09 Very cool! Regarding the metronome countdown, there isn't such a function. Maybe there should be an option for this when right-clicking the "Click" button?
It would be really great! But I think it's better to put it on "Edit" button because the countdown feature is used mostly when recording.
Good idea, guess I'll just put it in the popup menus of both buttons.

Perhaps you have a more detailed idea about how this should work? For instance about the interface, and for instance how to select how many beats to count down and other things like that? The less time I have to think about interface design and how the countdown works, the faster it is for me to implement. The implementation itself often doesn't take that long. :-)

kjetil wrote: 21 Dec 2019 21:57 The os.osc bug has been fixed in Faust, so I only need to update Faust in Radium. Hopefully it will be done before the next release.
Oh, sounds awesome!
It's a pretty big bug unfortunately. Faust DSP Classes are not initialized for instruments in the interpreter backend (lookup tables and so forth). If possible, you should only use the LLVM backend for instruments until the next release.
Post Reply