Author |
Message |
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
Posted: Sat Sep 20, 2008 3:15 am Post subject:
Kijjaz's Thunder Subject description: Make my guitar play a thunderstorm! |
|
|
Haha, got your attention with that one kijjaz? Here is a class that you wrote for use in my Guitar Lab (now ChucK Lab) program:
Code: | // An attempt at thunder fro kijjaz, modified by myself somewhat
class kjz_thunder {
// Main sound source
Noise s1 => LPF f1 => Gain env1 => SinOsc overdrive1 => LPF f1_1 => NRev rev1 => Gain go;
f1.set(160, .5);
f1_1.set(120, .5);
3 => env1.op;
1 => overdrive1.sync;
.1 => rev1.mix;
.3 => rev1.gain;
// Amp envelope
Impulse i2 => Gain g2_1 => Gain g2_1_fb => g2_1 => Gain g2_2 => Gain g2_2_fb => g2_2 => LPF f2 => env1;
f2.set(3, 1);
.992 => g2_1_fb.gain => g2_2_fb.gain;
80 => f2.gain;
}
|
I am posting because I have been having an awesome time creating ChucK programs that perform guitar effects. Not just any effects, but effects that work in response to the accelerometer-based guitar motion sensor that I'm helping to develop.
So long story short, I'd like to find a way to combine the guitar's signal sent on the line-in jack (adc input in ChucK) with the motion sensor (joystick HID input in ChucK) such that it produces a thunderstorm effect.
This could involve assigning the X, Y, and Z axes of the sensor to three parameters of kijjaz's thunder and then sending the guitar signal into the thunder, or some other mind-blowing fantasia like that.
So I'm asking for ideas, especially from the thunderstorm feedback master himself, kijjaz, about how to do this. Probably I should not be so dang lazy and get off my butt and study how kijjaz's thunder actually works, too, shouldn't I? OK, I will go do that as well.
Ideas and suggestions are welcome from all, thanks. _________________ "Let's make noise for peace." - Kijjaz |
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
Posted: Sat Sep 20, 2008 10:32 am Post subject:
|
|
|
Well, I've figured out from the diagram that the filtered noise source on the upper left is the actual thunder sound reference, the impulse on the lower left is what actually triggers the thunder, and the two feedback loops on the bottom chain somehow shape the envelope of the thunder. Further, the SinOsc handles large multiplication results of the env1 Gain stage and the NRev makes the thunder echo and roll.
What I haven't figured out is how to make the thing respond to a guitar waveform. I suppose the first thing to try might be to inject the guitar into the two feedback blocks in place of the impulse source. Then perhaps I can modulate the feedback gains with the accelerometer data. I dunno, just thinking out loud and hoping for suggestions. Maybe I should just try it, eh? _________________ "Let's make noise for peace." - Kijjaz |
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
|
Back to top
|
|
|
rogan
Joined: Dec 16, 2007 Posts: 83 Location: Urbana, IL
Audio files: 5
|
Posted: Sat Sep 20, 2008 12:46 pm Post subject:
|
|
|
That is pretty awesome. Kijjaz seems pretty good at creating crazy sounds from networked UGens. |
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
Posted: Sat Sep 20, 2008 1:33 pm Post subject:
|
|
|
rogan wrote: | That is pretty awesome. Kijjaz seems pretty good at creating crazy sounds from networked UGens. |
Thanks rogan. Yeah, I'm impressed with kijjaz's abilities. I also enjoy seeing the various accomplishments of other ChucKists. Different programmers show their abilities in different ways.
I added wppk's binaural rain and put in some filters to shape the sound, plus I played around with various patch paramters and also added an X^2 function to the thunder input. The result is pretty good, audio file and source code attached.
Description: |
|
Download |
Filename: |
GMS_thunder2.mp3 |
Filesize: |
717.55 KB |
Downloaded: |
1218 Time(s) |
Description: |
|
Download |
Filename: |
Thunder1.ck |
Filesize: |
4.74 KB |
Downloaded: |
593 Time(s) |
_________________ "Let's make noise for peace." - Kijjaz |
|
Back to top
|
|
|
kijjaz
Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Sat Sep 20, 2008 4:13 pm Post subject:
|
|
|
thank you all for developing more. i'm very happy to see all our ideas combined.
this is real community power.
and let me say it again: "let's make noise for peace"
hmm.. i'm no master, but there are already many masters around here.
i'm just... crazy -_-
Inventor, i'm very interested in applying the accelerometer.
how does it sense and transmit into ChucK?
are they treated as analog signal fed into the audio interface?
i haven't seen the thunder idea quite a long time ago.
the two Gain feedback system there is interesting.
it produces some kind of a rise-then-fall something-exponential value.
i hope that'd be a nice envelope.
i'll have to build intruments to perform very soon.
(hopefully by combining outside input / control and working with ChucK or maybe PureData)
this thread is inspiring. |
|
Back to top
|
|
|
kijjaz
Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Sat Sep 20, 2008 4:25 pm Post subject:
|
|
|
to celebrate (before going to bed)
i've made this patch for fun after reading this thread,
so i guess i'll have to give it to this thread heheeh.
Code: | /*
chuck code: kijjaz - Electric Pump and a hot Frying Pan
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
see: http://www.gnu.org/licenses/
*/
SinOsc s1 => ZeroX s_zx => Gain g => Gain g_fb => g => Gain master => dac;
SinOsc s2 => s_zx;
Noise n => s_zx;
55.1 => s2.freq;
.05 => n.gain;
1.0 - 3000/(second/samp) => g_fb.gain;
.8 => master.gain;
day => now; |
|
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Sat Sep 20, 2008 4:37 pm Post subject:
|
|
|
kijjaz wrote: | and let me say it again: "let's make noise for peace"
|
Word. _________________ Kassen |
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
Posted: Sat Sep 20, 2008 5:20 pm Post subject:
|
|
|
kijjaz wrote: | Inventor, i'm very interested in applying the accelerometer.
how does it sense and transmit into ChucK?
are they treated as analog signal fed into the audio interface?
|
Hi kijjaz, glad you like the thread. I've been wanting to play a thunderstorm on my guitar for a long time and now I can!
The sensor is currently entering production and should be available soon at a reasonable price from www.ultimarc.com. It looks just like a joystick except that the three axis readings are acceleration values instead of stick position values. If you take a look at the previously posted code you will see how easy it is to interface to it.
The miniature circuit board also contains an expansion interface header for attaching buttons, switches, or potentiometers. You can also do analog or digital input at slow rates.
What happened was that I wanted to create a guitar motion sensor so I designed one and it occurred to me that the company providing the USB interface was optimally positioned to add such a device to their product line. I sent an email to them suggesting that they consider creating the product and much to my surprise they were excited about the idea. So I've been working with Ultimarc for about six weeks now and the product is almost ready for sale. You can read all about the project and it's history on my Guitar Motion Sensor web page which is here:
http://www.freedomodds.com/music/gms.html
The sensor will be sold as a computer gaming controller, but it can be used on any musical instrument or just by itself, and it plays nice with ChucK. I am so excited about the project that I am planning to do other projects like it in the future, either with Ultimarc or by myself or possibly in collaboration with other electro-music.com members.
I'm having a good time with this stuff. Thanks for the thunder! _________________ "Let's make noise for peace." - Kijjaz |
|
Back to top
|
|
|
rogan
Joined: Dec 16, 2007 Posts: 83 Location: Urbana, IL
Audio files: 5
|
Posted: Sat Sep 20, 2008 5:43 pm Post subject:
|
|
|
Kassen wrote:
Quote: |
kijjaz wrote:
Quote: | and let me say it again: "let's make noise for peace" |
Word.
|
I'll third that.
...
I really liked the sound of the "grease" in the "frying pan." Is there any way to isolate it? I've tried throwing a HPF in the works, but it only dims the "Electric Pump."
Code: |
SinOsc s1 => ZeroX s_zx => Gain g => Gain g_fb => g => Gain master => HPF hpf => dac;
8000 => hpf.freq;
SinOsc s2 => s_zx;
Noise n => s_zx;
55.1 => s2.freq;
.05 => n.gain;
1.0 - 3000/(second/samp) => g_fb.gain;
.8 => master.gain;
day => now;
|
Thoughts? I've been trying to find good ways of making nice crackling sounds. |
|
Back to top
|
|
|
kijjaz
Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Sat Sep 20, 2008 9:10 pm Post subject:
|
|
|
Inventor,
wow! that's exciting.
can't wait to hear the news of the Guitar Motion Sensor.
i'd like to have one soon.
rogan,
Code: | Noise n => LPF f => ZeroX zx => Gain master => dac;
500 => f.freq; // adjust this to adjust grease density
.5 => f.Q; // if this is huge, the pitch of grease will be closer to f.freq()
.5 => master.gain;
day => now; |
this is closest to that grease for now -_-.
i'll work more on this.
maybe some envelope can help do something. |
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
|
Back to top
|
|
|
rogan
Joined: Dec 16, 2007 Posts: 83 Location: Urbana, IL
Audio files: 5
|
Posted: Sat Sep 20, 2008 10:10 pm Post subject:
|
|
|
Hi Inventor -- no prob. I'll figure out someday how to get the perfect click. For now, I've run Kijjaz's code through some reverb to create a noisy space.
I'm not super happy with my reverb, but it's in the right direction.
My goal is basically to have some sort of nice, random clicking passed through a good reverb to create a noisy space. I want to be able to have events modulate the noisiness. For example, if I were using a drum machine, a bass drum hit would increase the noise floor, and it would gradually decay to the background level, so that the drum hit causes a shower of noise.
Hmm. I'm having trouble recording this correctly, so I think it's my bedtime. Maybe I'll post an mp3 later?
Description: |
|
Download |
Filename: |
Allpass.ck |
Filesize: |
1.19 KB |
Downloaded: |
400 Time(s) |
Description: |
|
Download |
Filename: |
Gardner_LargeRoom.ck |
Filesize: |
1.96 KB |
Downloaded: |
450 Time(s) |
Description: |
|
Download |
Filename: |
Gardner_MediumRoom.ck |
Filesize: |
1.93 KB |
Downloaded: |
418 Time(s) |
Description: |
|
Download |
Filename: |
Kijjaz Clicks through My Reverb.ck |
Filesize: |
1.46 KB |
Downloaded: |
441 Time(s) |
|
|
Back to top
|
|
|
rogan
Joined: Dec 16, 2007 Posts: 83 Location: Urbana, IL
Audio files: 5
|
Posted: Sat Sep 20, 2008 10:13 pm Post subject:
|
|
|
Inventor -- I like this. It's pretty rad. It definitely gives the guitar a huge space. |
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
Posted: Sun Sep 21, 2008 5:10 am Post subject:
|
|
|
rogan wrote: | My goal is basically to have some sort of nice, random clicking passed through a good reverb to create a noisy space. I want to be able to have events modulate the noisiness. For example, if I were using a drum machine, a bass drum hit would increase the noise floor, and it would gradually decay to the background level, so that the drum hit causes a shower of noise. |
rogan, glad you liked the guitar file. As to the events modulating the noisiness that you would like to create, perhaps kijjaz's thunder model will do the job. If you examine the block diagram and look at the code I posted earlier in this thread (The thunderstorm code), you will see that the basic structure of the thunder works in the same way.
The inputs are noise and impulse for thunder itself. I modified the feedback loops to have delays in them and that way they responded to the guitar's analog output signal. In your case you would take my modification and apply your clicks or whatever in place of the noise, then apply the drums or other events to the guitar input.
The way it works is that the delayed feedback sustains and echoes the control input, then the output of that multiplies the desired audio source. I hope that all made sense, anyway study it and you'll get the idea.
Also, I looked at your files, my compliments on writing such well structured OOP code. It is cleaner than my stuff for sure. I would like to hear some mp3 files of the audio. Cheers. _________________ "Let's make noise for peace." - Kijjaz |
|
Back to top
|
|
|
rogan
Joined: Dec 16, 2007 Posts: 83 Location: Urbana, IL
Audio files: 5
|
Posted: Sun Sep 21, 2008 8:47 am Post subject:
|
|
|
I have a little question about feedback. If you look at this patch,
Code: |
Impulse i2 => Gain g2_1 => Gain g2_1_fb => g2_1 => Gain g2_2 => Gain g2_2_fb => g2_2 => LPF f2 => env1;
|
, you see that g_21 and g_22 are being fed back into themselves.
What is the actual response of such a system? By default, the Gain ugen sums, so doesn't this actually just add a gain of >1 with no waveform cancellation?
edit
For example, look at the series
Code: |
Gain g => Gain g_fb => g.
|
To me, the final gain on any input signal should be
(g.gain * g_fb.gain) * g.gain, or (g.gain)^2 * g_fb.gain
assuming that each ugen just gets one evaluation per entry in the series. |
|
Back to top
|
|
|
kijjaz
Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Sun Sep 21, 2008 10:08 am Post subject:
|
|
|
Is this kind of feedback in ChucK,
the result that is fed as feedback into a UGen is delayed by 1 sample.
let's look at a simplest example:
Gain g => g;
this means "add g's result to g for the next sample"
so let's try this
Code: | Gain g => g; // connect Gain g to g
g => blackhole; // force g to calculate
// in this condition, g will always stay 0
Impulse i => g; // prepare to feed impulse into g
Report();
1 => i.next; // this will cause i to be 1 for only 1 sample
samp => now;
Report();
.5 => i.next;
samp => now;
Report();
-2 => i.next;
samp => now;
Report();
ms => now;
Report();
fun void Report()
{
<<< "i.last() = ", i.last() >>>;
<<< "g.last() = ", g.last() >>>;
} |
so with this simplest form, g=>g adds anything to its system.
and the value stays if nothing is fed into it.
let's look at one way to put this to a good use: using this as a summation tool
(everything fed into g will be summed)
Code: | Gain g => g => blackhole;
SinOsc s => g;
.5 => s.freq;
second => now;
<<< "g.last() = ", g.last() >>>;
<<< "g.last() / sample rate = ", g.last() / (second/samp) >>>; |
after 1 second, for each sample, s's result will be added to g
so if we divide it with sample rate, you'll have an integrator.
- - -
but if we set this up instead:
Gain g => Gain g_fb => g;
and we set g_fb 's gain, g value can grow or decay with g_fb's rate:
Code: | Impulse i => Gain g => Gain g_fb => g => blackhole;
.5 => g_fb.gain;
64 => i.next;
samp => now;
Report();
second => now; // make it decay till almost 0
<<< "- - -", "" >>>;
2 => g_fb.gain;
1 => i.next;
samp => now;
Report();
<<< "- - -", "" >>>;
0 => g_fb.gain; // make g falls to 0
samp => now;
-1 => g_fb.gain;
1 => i.next;
samp => now;
Report();
fun void Report()
{
for(int i; i < 10; i++)
{
<<< "i = ", i, " g.last() = ", g.last() >>>;
samp => now;
}
} |
|
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
Posted: Sun Sep 21, 2008 10:11 am Post subject:
|
|
|
rogan, In this case there is a subtle difference: the time delay. Each gain block delays by one sample if I understand it correctly. The input is an impulse which has a duration of one sample, then two samples later it gets reapplied with a gain of less than one, and so on creating an exponential decay.
For use with the guitar's input signal which is not an impulse, I used an actual delay line inside of each feedback loop. That is what you would need to do for use with drum input or whatever. Well, that or use a ZeroX at the input.
Note also that my feedback loops are chained together in series while kijjaz's are tapped at the input node, a subtle difference.
Although I could easily be dazed and confused, I believe all of the above is correct. Enjoy! _________________ "Let's make noise for peace." - Kijjaz |
|
Back to top
|
|
|
rogan
Joined: Dec 16, 2007 Posts: 83 Location: Urbana, IL
Audio files: 5
|
Posted: Sun Sep 21, 2008 11:12 am Post subject:
|
|
|
Ah, that's some cool stuff. Thanks, guys! |
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
|
Back to top
|
|
|
rogan
Joined: Dec 16, 2007 Posts: 83 Location: Urbana, IL
Audio files: 5
|
Posted: Mon Sep 22, 2008 10:25 am Post subject:
|
|
|
I like the effects. It sounds a lot like King Tubby kicking his spring-loaded reverb kit. |
|
Back to top
|
|
|
|