electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
Rockin' with ChucK
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [24 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Mon Oct 22, 2007 3:08 am    Post subject: Rockin' with ChucK
Subject description: How do you make Rock and Roll?
Reply with quote  Mark this post and the followings unread

So far in the past two weeks of being a newbie ChucKist, I have experimented with collections of sinusoids, plucked filters, and now some chuck instruments including Heavy Metal. While it has been quite interesting and fun exploring music composition with these instruments, they are not giving me what I really want which is rock-and-roll.

When I do an FFT on chuck instruments, I get peaks with harmonics. This is fine enough because the instruments sound great, but when I do an FFT on a rock song I get a full spectrum of sound, not peaks. Are there any techniques for creating this full spectrum? I want ChucK to Rock!
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Mon Oct 22, 2007 4:37 am    Post subject: Reply with quote  Mark this post and the followings unread

Ouch, that's mainly a mix-down question, I think.

I don't think there is any way around simply creating all the instruments in a rock band. I'd keep the drums&bass at a steady uptempo 4/4 and try to write a algorithem for the metal guitars that creates riffs. Riffs are quite hard to do well in any case and algorithmic riffs are very hard but on the positive side this project will take you through a lot of music and engineering topics....

It can work very well, I'd need to dig it up but somewhere I have some very nice Microsound-Deathmetal crossover that this guy I met in Paris made in MAX/MSP.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Mon Oct 22, 2007 1:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks, Kassen, that gave me just the information I needed. Based on what you said, I put together a band of instruments using Bowed for the guitars and plucked filters for the drums. I also made three copies of each of those instruments at subharmonic intervals and it really filled up the spectrum nicely and made pretty good sound. The lead guitar riff is not so good, as you said - they are hard to do, but that's ok for now. I still have the clarinet and the heavy metal instrument in there, so they all add up nicely. I now have something a lot closer to the sound that I want.
Back to top
View user's profile Send private message Send e-mail
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Mon Oct 22, 2007 4:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

I have one simple way to create a rock-n-roll guitar sound in chuck easily..

Mandolin string1 => SinOsc waveshaping => ... ;
Mandolin string 2 => waveshaping => ...;
etc.. (add more strings)

then waveshaping.sync(1);

this is one simple distortion we mentioned before,
and it's a very small code.
I guess a nice warm distortion is what we need here to get back to the 60's rock and roll heheh.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Mon Oct 22, 2007 4:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

I have just created one example that uses LPFs as the oscillators
and feed into a SinOsc waveshaper.
this example sounds quite soft
but if some notes can be played more simultenously..
or with faster decay,
it can rock out quite easily.

But for me if you wanna have that overdrived guitar sound,
Mandolin is the easiest. ^_^

Code:
Impulse pick[3]; // create 3 picks
LPF str[3]; // create 3 harp strings
SinOsc ws => NRev r => dac; // connect overdrive to reverb to dac
r.mix(0.1);
r.gain(0.8);

for(int i; i < 3; i++) {
   pick[i] => str[i] => ws; // connect picks to all strings to overdrive
   str[i].Q(1000); // set string decay rate
}
1 => ws.sync; // make SinOsc perform waveshaping with sin as a transfer function

140.0 => float BPM;
minute / BPM => dur beat;
56 => int BaseNote;
   
[[0, 0],[1, 7], [2, 12], [1, 7], [0, 0],[1, 8], [2, 12], [1, 8], [0, 0],
[1, 9], [2, 12], [1, 15], [0, 0],[1, 7], [2, 12], [1, 5]] @=> int PlaySequence[][];
// the first number is the string number, the second is the note to play on the string

while(true) {
   for(int i; i < PlaySequence.cap(); i++) {
      2 => pick[PlaySequence[i][0]].next; // pick the string
      PlaySequence[i][1] + BaseNote => Std.mtof =>  str[PlaySequence[i][0]].freq; // set string note
      beat => now; // wait for 1 beat
   }
}
      
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Mon Oct 22, 2007 11:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

but the above sounds too angelic .. (harp-like)
now this one's by Mandolin, and sounds more like Stratocaster. hahah.

Code:
// Mandolin as the electric guitar test: by kijjaz (kijjaz@yahoo.com)
// feel free to use, modify, publish

Mandolin str[3]; // create mandolin strings
SinOsc overdrive => NRev rev => dac; // create overdrive to reverb to dac
overdrive.sync(1); // make overdrive do Sine waveshaping
rev.mix(0.02); // set reverb mix
rev.gain(0.6); // set master gain

// connect strings, set string damping
for(int i; i < 3; i++) {
   str[i] => overdrive;
   .9 => str[i].stringDamping;
}

// note sequence
[[40, 40+7, 40+12], [37, 37+7, 37+12], [36, 36+7, 36+12], [36, 36+7, 36+10]] @=> int Sequence1[][];

// for each bar
while(true) {
   for(int i; i < Sequence1.cap(); i++) {
      // set string notes
      for(int j; j < 3; j++) Sequence1[i][j] => Std.mtof => str[j].freq;
      // strum
      for(int j; j < 3; j++) .8 => str[j].pluck;
      // wait and listen
      2::second => now;
   }
}   
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Oct 23, 2007 3:17 am    Post subject: Reply with quote  Mark this post and the followings unread

Fortunately we know quite a bit about rifs.

For one thing we know that notes in riffs tend to come in bursts/groups instead of a continual baroque-like stream and we also know riffs tend to get repeated followed by modified versions instead of something etirely new so that would be the aproach I'd take to my algorithem.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Oct 23, 2007 6:51 am    Post subject: Reply with quote  Mark this post and the followings unread

kijjaz wrote:
but the above sounds too angelic .. (harp-like)
now this one's by Mandolin, and sounds more like Stratocaster. hahah.



Thanks for the example, kijjaz, I tried to implement this from your earlier post with no success. I really like the overdrive in this example. Hope you don't mind if I make use of your code.

Also Kassen, thanks for those hints about riffs, I'm already starting to think about ways to do them in my Boolean sequencing using kijjaz's Stratocaster.
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Oct 23, 2007 8:14 am    Post subject: Reply with quote  Mark this post and the followings unread

That wasn't a hint so much as a apreceation for how hard the problem is Smile

I find riff-like alkgorithmic notes quite hard.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Oct 23, 2007 8:20 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks to kijjaz and Kassen, I was able to create the attached file, "guitar_riff_lab.ck". It contains kijjaz's Stratocastor and my base n sequencing method (or whoever came up with it before me) combined together, including a sample riff. Now I can experiment with plucking logic expressions and algebraic frequencies.

The sample riff is just the binary count with the OR of every other bit ANDED for the plucking and the sum of all the bits times a base frequency for the frequency. To create other riffs, just change the logic pattern and/or the frequency algebra. I like the sample riff because it satisfies both of Kassen's features of a good riff: a catchy pattern repeated with changes. If you let it play for a while, you will hear the same repeated phrases, but with variations as time unfolds.

note: I should add some amplitude control, eh?

Cheers!


guitar_riff_lab.ck
 Description:
A test file for creating guitar riffs using Boolean sequencing as the algorithmic composition method

Download
 Filename:  guitar_riff_lab.ck
 Filesize:  2.19 KB
 Downloaded:  613 Time(s)

Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Oct 23, 2007 9:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

I have added two more guitar riffs, which I will post later. Now I would like to make a drum lab too, but I'm not too aware of how to make good drums in ChucK. I had some success with plucked bandpass filters with high Q, is that the best way to do it? How do you make drums in ChucK?
Back to top
View user's profile Send private message Send e-mail
Icetron



Joined: Oct 21, 2007
Posts: 3
Location: Nebraska, USA

PostPosted: Tue Oct 23, 2007 9:50 pm    Post subject: Reply with quote  Mark this post and the followings unread

Wow some of this stuff I am seeing people do with chuck is amazing. I love your use of Boolean sequencing. To me its like making music out of counting up in binary. very clever.
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Wed Oct 24, 2007 4:42 am    Post subject: Reply with quote  Mark this post and the followings unread

Icetron wrote:
Wow some of this stuff I am seeing people do with chuck is amazing. I love your use of Boolean sequencing. To me its like making music out of counting up in binary. very clever.


Wow, what a pleasant thing to wake up to, a compliment! To me it seems natural because music already has binary-like features. For example, we speak of an "octave" in frequency which if i recall correctly really is a difference of twice the frequency. Then we divide this up into eight notes, again if memory serves me. So the entire musical scale is really just a base two count with each note being three digits to the RIGHT of the decimal place and each octave being the digits to the LEFT of the decimal place.

In fact, if you listen to that guitar riff for a while, which I have done now, there is a haunting familiarity to it. Some of those beats are common in music somewhere, I just don't know where.

What is even more surprising to me is that when you change n to say 3, it still sounds good even though 3 is not a binary multiple. Or maybe it is just my untrained ear, hearing good where there is a terrible clash, haha. Anyway, thanks a lot!
Back to top
View user's profile Send private message Send e-mail
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Wed Oct 24, 2007 4:47 am    Post subject: Reply with quote  Mark this post and the followings unread

Inventor: Wow..! This one makes a very wonderful chord patterns.
sounds more to the Rock zone indeed!

one idea I usually do to come up with this kind of pattern is using modulo..

for example..

int i;
{
((i * 7) % 8 + (i * 5) % 16) => put it to use somewhere somehow...
i++;
}
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Wed Oct 24, 2007 4:59 am    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
I have added two more guitar riffs, which I will post later. Now I would like to make a drum lab too, but I'm not too aware of how to make good drums in ChucK. I had some success with plucked bandpass filters with high Q, is that the best way to do it? How do you make drums in ChucK?


Real drum synthesis is quite hard so many people cheat&use samples Smile

But not all is lost;
link

that's a archive of decent articles on synthesis, the feb-sept2002 topics deal with percussive sounds and should provide a decent starting place.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Wed Oct 24, 2007 5:59 am    Post subject: Reply with quote  Mark this post and the followings unread

I'll work on some more CPU-efficient garage drum sounds

here comes the first one, my kjzSnare101
i try to make it quite easy to use & cpu efficient.

the decay is made of Gain and Gain feedback (thus will create an exponential decay)
the slowable attack is made of LPF of the amplitude

Code:
// easy white noise snare
class kjzSnare101 {
    // note: connect output to external sources to connect
    Noise s => Gain s_env => LPF s_f => Gain output; // white noise source
    Impulse i => Gain g => Gain g_fb => g => LPF g_f => s_env;
   
    3 => s_env.op; // make s envelope a multiplier
    s_f.set(3000, 4); // set default drum filter
    g_fb.gain(1.0 - 1.0/3000); // set default drum decay
    g_f.set(200, 1); // set default drum attack
   
    fun void setFilter(float f, float Q)
    {
        s_f.set(f, Q);
    }
    fun void setDecay(float decay)
    {
        g_fb.gain(1.0 - 1.0 / decay); // decay unit: samples!
    }
    fun void setAttack(float attack)
    {
        g_f.freq(attack); // attack unit: Hz!
    }
    fun void hit(float velocity)
    {
        velocity => i.next;
    }
}

kjzSnare101 A;
A.output => dac;
A.hit(0.8);
2::second => now;
A.setDecay(10000);
A.setFilter(5000, 5);
A.hit(0.8);
2::second => now;


and this another feature-added version: 102
added comb filter for the ringing of the snare

Code:
// with some approvements from 101: snare ringing in the body
class kjzSnare102 {
    // note: connect output to external sources to connect
    Noise s => Gain s_env => LPF s_f => Gain output; // white noise source
    Impulse i => Gain g => Gain g_fb => g => LPF g_f => s_env;
   
    s_env => DelayA ringing => Gain ringing_fb => ringing => LPF ringing_f => output;   
   
    3 => s_env.op; // make s envelope a multiplier
    s_f.set(3000, 4); // set default drum filter
    g_fb.gain(1.0 - 1.0/3000); // set default drum decay
    g_f.set(200, 1); // set default drum attack
   
    ringing.max(second);
    ringing.delay((1.0 / 440) :: second); // set default: base ringing frequency = 440Hz
    ringing_fb.gain(0.35); // set default ringing feedback
    ringing_f.set(1500, 1); // set default ringing LPF
    ringing_f.gain(0.6); // set default ringing vol
   
    fun void setFilter(float f, float Q)
    {
        s_f.set(f, Q);
    }
    fun void setDecay(float decay)
    {
        g_fb.gain(1.0 - 1.0 / decay); // decay unit: samples!
    }
    fun void setAttack(float attack)
    {
        g_f.freq(attack); // attack unit: Hz!
    }
    fun void hit(float velocity)
    {
        velocity => i.next;
    }
   
    fun void setRingingGain(float g)
    {
        g => ringing_f.gain;
    }
    fun void setRingingFreq(float f)
    {
        (1.0 / f)::second => ringing.delay;
    }
    fun void setRingingFeedback(float g)
    {
        g => ringing_fb.gain;
    }
    fun void setRingingFilter(float f, float Q)
    {
        ringing_f.set(f, Q);
    }
}

kjzSnare102 A;
A.output => dac;
A.hit(0.8);
1::second => now;
A.setRingingFeedback(.995);
A.setRingingFilter(500, 1);
A.hit(0.8);
3::second => now;
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Wed Oct 24, 2007 6:33 am    Post subject: Reply with quote  Mark this post and the followings unread

Great, I am already checking out those Synth Secrets. The math is just a little bit over my head - I survived through undergrad math and the math-based engineering classes with mostly B's and a few A's, but the grad stuff went whoosh over my head, and that was 20 years ago. Still, I can get the general ideas and put them into practice hapahazardly.

I'm happy to read that you will work on some drum sounds, kijjaz, this is beginning to become a bit of a collaboration! To that end, I simply must post guitar_riff_lab2.ck now because I am so very pleased with the third riff, riff 3. I put in a riff selector switch so the file can become littered with riffs and you just select the one you want.

The reason I am so happy with riff 3 is that it starts out with a western sounding guitar like you might hear in - oh, i don't know, makes me think of the that old TV show Bonanza or their theme song or whatever - and then it transitions to an eastern sound like you might hear in a Chinese festival or something. Because of the nature of the binary count, these "west to east" phrases exist in microcosm and marocosm, with short little transitions from west to east underlying larger-scale long-term transitions that are more dramatic. If you watch the binary count scroll by, when it rolls over the odometer so to speak it will make a sudden east-to west transition. So i call the riff "east meets west".

The file is all set up to play riff 3: "east meets west" in base 2, so you can just load it up in ChucK and have a listen if you like, enjoy!


guitar_riff_lab2.ck
 Description:
File for experimenting with Boolean-sequenced guitar riffs, includes riff 3: "east meets west".

Download
 Filename:  guitar_riff_lab2.ck
 Filesize:  3.95 KB
 Downloaded:  470 Time(s)

Back to top
View user's profile Send private message Send e-mail
chuckles



Joined: Apr 02, 2007
Posts: 72
Location: San Diego, California

PostPosted: Wed Oct 24, 2007 12:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

Last year, as an experiment, I created a simple drum kit (kick, snare, tom, hi hat) in Ableton Live using only white noise which you can create using the "Crackle" feature in the Vinyl Distortion processor. I resampled this noise and found that you can get pretty good drum sounds by reloading it into the Simpler sampler, and using EQ and other audio tools in Live. Certainly as good as many of the standby drum machines that have been used for years on countless records.

You can even branch into other percussion like woodblocks, claves, congas and many others using the same basis. The SoS articles linked to above are also good grist for study. Even if back issues are not available it's great that SoS has made all those issues available, mostly on line and even on a DVDROM.

I have complete confidence that kijjaz and the other wizards who haunt this board will come up with an amazing array of emulated percussion.
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Wed Oct 24, 2007 1:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

kijjaz wrote:
I'll work on some more CPU-efficient garage drum sounds

here comes the first one, my kjzSnare101
i try to make it quite easy to use & cpu efficient.


kijjaz, your snares are terrific! They sound just like the real thing, and you put them into OOP classes too, so they are nice and compartmentalized little chunks of code that I could just paste into my program without changes, great! Well, I did have to rename the instance B instead of A, but that was it. I can see that you have good programming skills and a good knowledge of ChucK, so my compliments to you.

The next most natural thing to do was to create the attached file, drum_beat_lab.ck. I set it up with a variable called "snare" that acts as a selector switch for the various snares. As we add more drum-type instruments I can add a different selector switch for each type of drum. That way we can have multiple drum-type instruments playing at once. I also used ChucK's feature of playing multiple files to play a guitar riff as well as your snares, so now we have a band forming thanks to the creators of ChucK.

kijjaz, I am curious about the code, would you mind explaining what parameters to change to vary the sound and what are reasonable value to use in them? I see that you provided "set" methods within the classes for varying these parameters, but what does each one do and what are good values? Then I can encode the Boolean sequence into the parameters nicely, I think. Also, I am eagerly awaiting your future instruments - keep up the good work, we will create something fun and exciting!


drum_beat_lab.ck
 Description:
A "laboratory" for creating drum beat sequences using the Boolean sequencing technique. This first version has only the two snare examples from kijjaz.

Download
 Filename:  drum_beat_lab.ck
 Filesize:  4.41 KB
 Downloaded:  436 Time(s)

Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Wed Oct 24, 2007 6:02 pm    Post subject: Reply with quote  Mark this post and the followings unread

I added some minor new features:

1. put an OOP class wrapper around kijjaz's guitar code.
2. made both a bass guitar instance and a lead guitar instance.
3. added separate control switches for bass and lead guitars.
4. put bass guitar on left channel and lead guitar on right channel.

Now with the headphones on I can hear the bass guitar to the left, drums in the center, and lead guitar to the right. Before I couldn't make out the bass guitar. Now I'm starting to listen to the piece as I would listen to one of my iTunes songs, just to hear it not to compose it, and there are two things I noticed that lead to some questions.

1. the bass guitar is good, but it gets boring just hearing the same thing drone on and on like it is now.
2. the lead guitar is too dominant and complex, it never rests.

So the questions are:

1. do bass guitars have riffs?
2. should the lead guitar have rest breaks in it?

It is almost kind of lopsided, hearing all this beautiful complexity on the right and the same simple thing on the left. Actually the bass guitar does sort of change-up just a little and I like that part. Maybe I could create a sequence for the bass guitar that is similar to the lead guitar algorithmically, just deeper slower and simpler.

Also now that I hear the guitars clearly on the left and the right, I want to make them move around in my head by varying the phase and amplitude of the left and the right. In fact, that should be worked into the sequencing as well. I'm not sure how to put that into the code, but maybe I'll give it a try tonight.

Heh, I probably shouldn't ramble on like this on a forum - this isn't my blog. Just felt like writing my ideas out somewhere. So what are your answers to the two questions?
Back to top
View user's profile Send private message Send e-mail
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Wed Oct 24, 2007 9:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

Inventor: Thanks! It's just like we've just teamed up in this hread hahaha.
Thanks for commenting on the snare codes also, i'll try to add some more features
or transform into some other drum pieces (eg. HiHat)
I'll add more CPU-efficient bass drums and toms soon.

I'll start a thread for designing quite-simple chuck drum sounds soon
and will explain the ideas behind those UGens.

Some more suggestions on the drum sounds:
- you can 'compress' these snare sound to get a more punchy attack.
- or HPF it to filter out the lows for thinner sound (and by this can create a hihat also)
- and change decay time during the song for alternating between close & open hihat
- feed the output of the drum object into a waveshaper
(for example, by using SinOsc and set sync to 1, just like what I did for the overdrive)
to make the beginning of the drum sound more punchy / with wider spectrum.

Talk to you all soon. I'm working on some music scores for an all-girl brass section Shocked .
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Thu Oct 25, 2007 1:11 am    Post subject: Reply with quote  Mark this post and the followings unread

I used left and right fades to make the guitars run across the stage. The lead starts in your right ear (i hear it inside my head) and slowly move to your left ear, while the bass guitar makes the opposite trip. The drums stay in the center. Sometime later I would like to learn how to control the phase as well since that can make the sound move in circles around your head, or so I recall, but that's too difficult for the moment - there are other things to do.

I also added exclusive or bass guitar, lead guitar, and drums. It makes a good rock sound that I might call "XOR". The more I listen to this stuff the more I like it.
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sun Jul 24, 2011 3:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

Bumping this thread for a new ChucKist who want to learn ChucKology.

Les

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Schoktra



Joined: Jun 02, 2012
Posts: 1
Location: Illinois

PostPosted: Sat Jun 02, 2012 5:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

I have modified the earliest sample using the mandolin to make the intro to Metallica's nothing else matters with Chuck!

Code:


// Nothing Else Matters (copyright Metallica) intro: by Schoktra (schoktra@gmail.com)
// Derived from: Mandolin as the electric guitar test: by kijjaz (kijjaz@yahoo.com)
// feel free to use, modify, publish

0 => int withRev;             // boolean value for reverb on/off

Mandolin str[6];              // create mandolin strings
SinOsc overdrive;
overdrive.sync(1);            // make overdrive do Sine waveshaping

if( withRev ) {
  <<< "With REVERB!" >>>;
  overdrive => NRev r => dac; // overdrive to reverb to dac
  r.mix(0.05);                // set Master mix
  r.gain(0.6);                // set Master gain
}
else {
  <<< "W/O REVERB!" >>>;
  overdrive => dac;           // create overdrive to dac 
}

/*
 * eb Bb Gb Db Ab Eb string frequencies for Guitar
 * reversed order because usually the tuning order is reverse string order
 * and I wanted to put the sequence in string order for ease of reading.
 */
[311.12, 233.1, 185, 138.6, 103.86, 77.78] @=> float freqs[];
// Loop frequencies and set string frequencies accordingly.
for(int i; i < 6; i++) freqs[i] => str[i].freq;

// connect strings, set string damping
for(int i; i < 6; i++) {
   str[i] => overdrive;
   .5 => str[i].stringDamping;
   if(!withRev) .6 => str[i].gain; //if there's no reverb set string gain
}

// string pluck sequence
[5, 2, 1, 0, 1, 2] @=> int seq[];

// Infinite loop to continuously loop through the intro
while(true) {
    // Loop through string sequence and pluck corresponding string
    for(int j; j < 6; j++) {
        .8 => str[seq[j]].pluck;
        .5::second => now;
    }
}



NEM.ck
 Description:
My chuck file with the working intro to Metallica's Nothing Else Matters

Download
 Filename:  NEM.ck
 Filesize:  1.6 KB
 Downloaded:  357 Time(s)

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [24 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use