Hi guys, I was looking at chuck manual, talking about LFO and then FM came to my mind. But...How? I was thinking to a very simple FM like this: 1) SinOsc alpha carrier 2) SinOsc beta modulator 3) SinOsc gamma beta's amplitude modulator So i thought something like this SinOsc alpha => dac; SinOsc beta => blackhole; SinOsc gamma => blackhole; then oscillators frequencies 220 => alpha.freq; 4 => gamma.freq; while (20::ms => now ) { (gamma.last () ) + 2 => beta.freq; in this way I've got my amplitude modulation on beta. Then I have to Beta.freq + alpha.freq => alpha.freq - Frequencies sum. - } This is just an idea..... Could it work ? And how can I make beta and alpha's sum? May I have to use fun like fun void ( int freqalpha, int freqbeta ) or something like this? Thankssssss
Ok I've looked into the web and found a similar question and found a
similar (but working )solution.
The difference is in modulator.
https://lists.cs.princeton.edu/pipermail/chuck-users/2012-August/006885.html
On Thu, Oct 4, 2012 at 5:10 PM, Alberto Alassio
A SinOsc constantly oscillates between -1 and 1, according to the frequency
set. The frequence is stored in/retrieved from m.freq (e.g. 200 for 200
Hz), and the constantly changing/oscillating value (between -1.0 and 1.0)
can be retrieved from m.last().
On Fri, Oct 5, 2012 at 1:09 PM, Alberto Alassio
-- Release me, insect, or I will destroy the Cosmos!
On Fri, Oct 05, 2012 at 02:25:40PM +0200, Stefan Blixt wrote:
All true. In this case -1 to 1 clearly is rather a small range for all but the most subtle of modulations. You can multiply by "index" every sample as in the posted examples, but personally I'd simply set the modulator's .gain() to the value of the index. While we are at it; I'd also use the fm input to the carrier set by the .sync() member function. That leaves the centre frequency, I'd sum the modulator with a Step UGen set to that value. This will greatly simplify the code (no need to manually loop) and because of that decrease the CPU cost. For educational purposes I won't write out the code, shout if more hints are needed ;-). This, BTW, will only fly if we are modulating a plain oscillator, if something else, which lacks a .sync() member and thus the fm input, needs to be modulated the strategy of the past few mails will be the way to go. Yours, Kas.
Kass said : "In this case -1 to 1 clearly is rather a small range for all but the
so you just make index * m.gain() ? Kas said: "While we are at it; I'd also use the fm input to the carrier set by
the .sync() member function."
I'm not succeeding because I'm not able to use .sync. There's written something about in the manual, is it correct to write 2 => c.sync ? Cause at SinOsc page it is written : " (2) fm synth " . Kas said: "That leaves the centre frequency, I'd sum the modulator with a Step UGen set to that value.
This will greatly simplify the code (no need to manually loop) and because of that decrease the CPU cost. "
And what about Step? you put it in the blackhole also and you set it at carrier frequency? I'M SHOUTING!!
On Fri, Oct 05, 2012 at 03:45:48PM +0200, Alberto Alassio wrote:
so you just make index * m.gain() ?
Almost. I'd use; m.gain(index); or; index => m.gain; Note that this sets the amplitude of the osc's output to something far beyond the normal amplitude. That is desired here, but not the kind of signal you'd want to listen to directly. For signals we intend to listen to we'd set it to something between 0 and 1.
yes; http://chuck.cs.princeton.edu/doc/program/ugen_full.html#sinosc This configures how the SinOsc deals with signals at its input. So; SinOSc lfo => SinOsc sound => dac; //signal chain 2 => sound.sync; //fm synth //set amplitude and freq for the lfo here
And what about Step? you put it in the blackhole also and you set it at carrier frequency?
ok. to continue the above example; Step centre_freq => sound; //add it to the lfo 440 => centre_freq.next; //set the centre to A4
I'M SHOUTING!!
Relax. All will be fine :-). Yours, Kas.
So the first part will be something like SinOsc c => dac; SinOsc m => blackhole; Step centre_freq => c; 440 => centre_freq.next ; 2 => c.sync ? Thank you Kas for being so patient
On Fri, Oct 05, 2012 at 04:16:19PM +0200, Alberto Alassio wrote:
Almost. We will put the signal of m into c. This is because m is affecting (modulating) c. This modulation happens in a way set by the .sync() function. So, the top two lines should be replaced by; SinOsc m => SinOsc c => dac; //m affects what c plays. We listen to c. All of the rest is right. If you set up m with something like; 110 => m.gain; //amplitude and thus modulation depth 3 => m.freq; //lfo frequency Then it should work. Once it works you can consider adding a envelope and maybe a loop that plays a melody using your new sound.
Thank you Kas for being so patient
No problem. BTW; we do not need blackhole in this case because m is connected to c and c is connected to the DAC. Anything that connects from the DAC will be generating values because of that. We only need blackhole when we want something to generate values (for example to use with .last()) but do not need to connected (indirectly) to the DAC. I think the manual entry on blackhole should explain that. Hope that helps explain the underlying reasoning. Yours, Kas.
participants (3)
-
Alberto Alassio
-
Kassen
-
Stefan Blixt