| Author |
Message |
chuckles
Joined: Apr 02, 2007 Posts: 66 Location: San Diego, California
|
Posted: Wed Oct 31, 2007 12:18 pm Post subject:
Can someone explain... |
 |
|
As I was looking through one of Inventor's files, I noticed that he had this construction
| Code: | Impulse i1 => BPF f1 => JCRev r1 => dac;
i1 => BPF f2 => r1 => dac;
i1 => BPF f3 => r1 => dac;
i1 => BPF f4 => r1 => dac;
i1 => BPF f5 => r1 => dac; |
I know I should experiment with this and try to figure out what it means in terms of sound, but I would like to ask a ChucK expert if they could explain this to me.
In fact, what would it mean to do something like this:
| Code: | Impulse i1 => dac;
i1 => dac;
i1 => dac; |
etc.
Is this even meaningful?
Thanks a lot for whatever light you can shed on this,
[and for those of you where it's observed...
HAPPY HALLOWEEN]
 |
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 6443 Location: The Hague, NL
G2 patch files: 3
|
Posted: Wed Oct 31, 2007 1:49 pm Post subject:
|
 |
|
I'm not sure what you want to know exactly, but what you have there is a single impulse that gets processed by a set of independent filters. After that the whole thing is treated with reverb.
The idea is that BPF's will "ring" to a certain degree after getting "excited" by the impulse so basically you have a set of similar sound sources that all get activated at the same time by the same source to create a sort of "chord" .
Sending the same impulse to the dac multiple times, like in your example, will do the same as having the same signal on a mixer several times (let's disregard effects and eq on mixers here) so that will just result in more volume.
As for how useful doing almost the same thing several times in paralel as compared to the *exact same* thing several times is you can consider for example choirs. Get the nearest girl (asuming your a boy) and sing a simple song with her together or try to hit two pans at the same time using one large wooden spoon (that last example is exactly what we have here).
I could tell you more but I'm not sure exactly what you'd like to know, excuse me if this was trivial. _________________ Modern technology offers an endless field day to any deviant strains in our personalities. --J.G.Ballard |
|
|
Back to top
|
|
 |
chuckles
Joined: Apr 02, 2007 Posts: 66 Location: San Diego, California
|
Posted: Wed Oct 31, 2007 3:03 pm Post subject:
|
 |
|
Thanks Kassen; I knew I would get a quick and thorough answer here. Everything you explained seems to make sense. Maybe I'm making things too complicated. The confusion in my mind I guess would be if instead of the same impulse i1 being fed into the filters/reverbs/dacs, what would be the difference if instead of repetitions of i1 they were replaced with Impulse i2, Impulse i3, etc. That would confuse me if they did exactly the same thing. Using a single Impulse UG i1 would seem to be the more efficient way to go, if so.
A side question would be: is it legal to create an array of Impulse UGs like other UGs?
I hope I am explaining this coherently. And thanks in advance again! |
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 6443 Location: The Hague, NL
G2 patch files: 3
|
Posted: Wed Oct 31, 2007 4:09 pm Post subject:
|
 |
|
Well, in a precise and explicit programing language like ChucK when you have two "identical" things they will behave the same way, exactly.
This is different from some digital modulars like for example Clavia's Nord Modular series where using three identical oscillators will give you a fairly complex wave thanks to the engine randomising the phase at which they start. Clavia uses that as it's a realistic emulation of what happens in "real" synths, if you want that sort of behaviour in ChucK you will have to define exactly what sort of behaviour you want, ChucK is (or rather aims to be) very predictable and consistent.
So; using two impulse fired off at the same time and summed yields the *exact* same result as a single one with a gain of 2. Here Inventor used a single one (as well as a single reverb) in order to save the cpu. Obviously one is also easier to control then five.
About arrays; yes you can! To go even further you can have arrays of anything that's a primitive or a object. Maybe things like "dac" and "blackhole" are exceptions but you can, for example, have a array of Events or strings or Impulse Ugens. If you define your own class you can also have a array of instances of that. You can't, however, have a array of functions, those aren't objects.
So; to create a group of line&file soldiers;
| Code: | //define a soldier
class soldier
{
string name;
//default name in case we send them to war before giving them one
"john doe" => name;
fun void fire()
{
<<<"boom!">>>;
}
}
//a small army in rank and file
soldier army[10][10];
//have them all fire!
for (0 => int n; n<10; n++)
{
for (0 => int m; m< 10; m++)
{
army[n][m].fire();
}
}
|
See? you can have arrays of anything and when you have a lot of objects (like a 100) it's quite convenient. Doing the same thing by hand and without classes would literally take you 100's of lines. _________________ Modern technology offers an endless field day to any deviant strains in our personalities. --J.G.Ballard |
|
|
Back to top
|
|
 |
kkissinger

Joined: Mar 28, 2006 Posts: 384 Location: Kansas City, Mo USA
Audio files: 2
|
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 6443 Location: The Hague, NL
G2 patch files: 3
|
Posted: Wed Oct 31, 2007 6:38 pm Post subject:
|
 |
|
Funny!
Extending the soldier with a .hop() function would be easy enough but then we run into the issue that ChucK lacks a appropriate (ready made) structure to put kangaroos in, that would have to be more like a group , flock or set then like orderly rank&file.
Such a data structure would be quite good for grains as well, perhaps somebody should make one :¬).
I'm strongly opposed to outfitting ChucK with stinger missiles, at least until stability improves. (I wanted a explosion emoticon here but can't find one quickly') _________________ Modern technology offers an endless field day to any deviant strains in our personalities. --J.G.Ballard |
|
|
Back to top
|
|
 |
dewdrop_world

Joined: Aug 28, 2006 Posts: 577 Location: NoVA, USA
Audio files: 2
|
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 482 Location: bangkok, thailand
Audio files: 2
|
Posted: Wed Oct 31, 2007 10:48 pm Post subject:
|
 |
|
One thing we have to consider here..
is that rechucking (chucking a chucked pair of UGens)
like doing r1 => dac; then r1 => dac; later
.. would not do anything.
You can investigate into this patch and see how it performs.
It will show you that rechucking does nothing new.
But using a Gain, we can make a duplicate of a signal and use it as another source to chuck.
| Code: | Step one => Gain g1 => blackhole;
1 => one.next;
samp => now; <<< "after time passed," , "" >>>;
<<< "one step : ", one.last() >>>;
<<< "g1 : ", g1.last() >>>;
one => g1;
samp => now; <<< "after rechucking one to g1,", "" >>>;
<<< "g1 : ", g1.last() >>>;
one => Gain duplicate => g1;
samp => now; <<< "after adding a duplicate,", "" >>>;
<<< "g1 : ", g1.last() >>>;
.4 => one.next;
samp => now; <<< "with this method, it'd add the inputs.", "" >>>;
<<< "one =", one.last(), " duplicate =", duplicate.last(), " g1 =", g1.last() >>>;
3 => g1.op;
samp => now; <<< "or with gain option = 3, it'd multiply.", "" >>>;
<<< "one =", one.last(), " duplicate =", duplicate.last(), " g1 =", g1.last() >>>;
// that's all folks! |
result:
| Code: | after time passed,
one step : 1.000000
g1 : 1.000000
after rechucking one to g1,
g1 : 1.000000
after adding a duplicate,
g1 : 2.000000
with this method, it'd add the inputs.
one = 0.400000 duplicate = 0.400000 g1 = 0.800000
or with gain option = 3, it'd multiply.
one = 0.400000 duplicate = 0.400000 g1 = 0.160000 |
|
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 6443 Location: The Hague, NL
G2 patch files: 3
|
Posted: Wed Oct 31, 2007 11:05 pm Post subject:
|
 |
|
| kijjaz wrote: | One thing we have to consider here..
is that rechucking (chucking a chucked pair of UGens)
like doing r1 => dac; then r1 => dac; later
.. would not do anything.
|
OOOOOOPS! my fault, thanks for pointing that out. _________________ Modern technology offers an endless field day to any deviant strains in our personalities. --J.G.Ballard |
|
|
Back to top
|
|
 |
Inventor

Joined: Oct 13, 2007 Posts: 1410 Location: Florida, USA
Audio files: 54
|
Posted: Wed Oct 31, 2007 11:37 pm Post subject:
Re: Can someone explain... |
 |
|
| chuckles wrote: | As I was looking through one of Inventor's files, I noticed that he had this construction
| Code: | Impulse i1 => BPF f1 => JCRev r1 => dac;
i1 => BPF f2 => r1 => dac;
i1 => BPF f3 => r1 => dac;
i1 => BPF f4 => r1 => dac;
i1 => BPF f5 => r1 => dac; |
I know I should experiment with this and try to figure out what it means in terms of sound, but I would like to ask a ChucK expert if they could explain this to me.
|
Hi chuckles, I'm sorry I slept through your post and everyone answered your question! In my own words, I was trying to create harmonics of a plucked bandpass filter. You will notice later in the file that the Q of the filters is very high and their frequency, if I recall correctly, is set to harmonic multiples. So I wanted a single pluck to drive all five filters and being so new to ChucK this is how I did it. Now I know to use arrays for the same thing. Looking back, I'm kind of pleased how the whole sound turned out with those plucked bandpass filters and I may use them again!
Cheers and happy halloween! |
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 482 Location: bangkok, thailand
Audio files: 2
|
Posted: Thu Nov 01, 2007 12:40 am Post subject:
|
 |
|
| Kassen: Cheers ^_^ |
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 6443 Location: The Hague, NL
G2 patch files: 3
|
Posted: Thu Nov 01, 2007 1:05 am Post subject:
|
 |
|
Inventor; I'm not sure if you're aware of this already but what you are doing is basically "modal synthesis" and is a known way of emulating struck or plucked objects. What you have is roughly a physical model of a string.
What you can also do is emulate the exact pluck-position by tweaking the relative volume of the BPF's. For example, if you would pluck the string at a third of it's length that would exite the second harmonic (three times the fundamental) more then the others. One of the fun things of the way this way of synthesis works is that it's not at all prone to aliasing. _________________ Modern technology offers an endless field day to any deviant strains in our personalities. --J.G.Ballard |
|
|
Back to top
|
|
 |
Inventor

Joined: Oct 13, 2007 Posts: 1410 Location: Florida, USA
Audio files: 54
|
Posted: Thu Nov 01, 2007 3:44 am Post subject:
|
 |
|
| Aha! So it's called modal synthesis, that is good to know. I had not thought of changing the harmonic content in that way either, I must give that a try. |
|
|
Back to top
|
|
 |
|