Welcome to the ChucK Guitar Lab page. Here you will find information about the ChucK program called Guitar Lab including a history of its development, instructions for use, and of course the source code. If you have been thinking of ChucKing yourself, but were concerned that the learning curve would be too steep, you will read here just how easy it was for me to go from a complete ChucK newbie to having a useful mini-application completely coded and working. Also, if you are interested in making guitar riffs, then you might find the guitar lab to be just what you need. It's a fun little application that has very little learning curve and I find it enjoyable to operate.
|
My ChucK JourneyI first noticed the ChucK miniAudicle on the Apple Computer Downloads website. Being a novice in the music world, I was unaware that such programs existed and I quickly downloaded the software and ran some example files. I was hooked. At first I didn't know how to play single notes using ChucK, and nobody told me to use one of the provided instruments (duh) so I started to make my own sounds using basic building blocks called unit generators (the simpler ones like SinOsc and BPF). I started reading the ChucK Forum at www.electromusic.com, and soon posted some of my early results. Thanks to encouragement from the folks there, I felt good about my new hobby and continued to explore it more. At this point I could only make notes and I wanted whole songs, so I sat and thought about how to make a seqence of notes. Being an electrical engineer, the first natural thing I thought of was some logic sequence of some sort. I thought: "What if I play the notes when the logic expression is "true", would that make a sequence?". Sure enough it did, I wrote a simple binary counter and made a logic expression from it, then played the notes of my crude instruments only when the logic was "true". It worked! But that was always the same note, just sometimes present and sometimes not - what I needed was something to change the frequency of the notes. For that I turned to algebra. The regular kind of alebra, not Boolean algebra, base 10 algebra. I gave each bit a value from say -4 to 4, and then if that counter bit was "true", I added that value in to a total. Then I gave the total an offset to prevent negative frequencies, and a multiplier to put it in a reasonably audible frequency range. It also worked! Then I did some reading in some places on the www.electromusic.com Forum, and I learned that there was this thing called "sequencing", which is basically what I had just stumbled upon - the method by which you play the notes. Little did I know, there are many sequencing techniques out there, all with their various properties that make them unique. This was just another one of those things, aha! Along the way of my ChucK journey, I also made various ChucK programs that made other music. I also made ChucK programs that create videos, and created some short video animations, but that was rather cumbersome and not very ChucK related. At least I had some video though. I posted most of this work to the www.electromusic.com and got positive feedback, so I continued creating. I was making enough stuff to make my own ChucK web page, which is here. Then one day I felt like all my music was fairly - well - synthy, not "realistic" like a guitar for example. I listened to all my rock songs on iTunes and I thought: ChucK should rock like that. So I posted to the www.electromusic.com Forum that I wanted to make ChucK rock, and in response a fellow ChucKist named kijjaz posted a realistic sounding guitar! Right away I wanted to make songs with this guitar, so I wrote Guitar Lab, which combined the Boolean Sequencing with the new guitar. This worked great, but I had one problem. To change the song, you had to edit a text file, so there was no interactive way to hear the music change as you adjusted parameters. Things were slow but they worked. And then finally Princeton released the latest version of the ChucK miniAudicle, which had a set of user interface tools called MAUI. Now I could make a user interface for ChucK to make it easier to adjust things and also to get real-time response from the adjustments. Thus, MAUI Guitar Lab was born. I am quite pleased with these MAUI user interface elements, they are simple, easy to use, and powerful, just like the rest of ChucK. That brings us up to today, having just completed the current version of MAUI guitar lab I am sitting here listening to it play a good riff while I write this html. So give the new code a try, you'll like it I promise! |
Guitar LabSo what is this Guitar Lab? It's a ChucK program that lets you create guitar riffs by clicking on buttons and moving sliders. Actually it also has Flute, Snare, Drum, and Mandolin instruments, but the main purpose was always guitar riffs. To make a guitar riff, you need to do sequencing, which is how the computer knows when to play the notes. For that I am using a technique called Boolean Sequencing that I rediscovered along my ChucK journeys. In addition to the instruments and the sequencing, Guitar Lab has sliders for adjusting various parameters that affect the music. Boolean SequencingHow Boolean Sequencing works is this: you have a binary (or base-n) counter and you form Boolean logic expressions from it. Then you OR all of the Boolean logic outputs together, and if that value is "true", then a note is played. For example, let's say our logic expression is the AND of bit 0 and bit 1, the least significant bits. In this case for all counts ending in 00 we get a 0 output and no note is played, 01 we get 0, 10 we get 0, and finally at 11 we get 1 and a note is played. This repeats throughout the count so that every fourth note gets played. From that very simple example, you can probably imagine the incredibly complex sequences that you can get using Boolean Sequencing. I have found that it works pretty well and from a music amateur's standpoint, it's really easy to make good guitar riffs this way. More on this topic later. SlidersAs to the sliders, I will leave you to figure out most of them yourself as they are obviously labeled, so you can easily tell what they do. I have found that the base should be left at 2 usually because Boolean algebra really only works on base 2. I just provided the other bases because it was easy to do in the programming. If you want a really long riff, like greater than 40 seconds, then try base 3. For the guitar sounds, my favorite is to set body size on 0.2 and reverb on 0.3, making a dramatic, deep guitar sound. ButtonsThe upper left button is the start/stop button which does what you think it will. Progressing clockwise around the user interface, we have the clear button which clears the base-n count, the or/xor button which decides how the ANDed terms are combined together, and then on the right there are the instrument buttons. Press any instrument button to add it to the orchestra. More on Boolean SequencingAs you play around with Guitar Lab, creating riffs by clicking on buttons and sliders, you will notice that most sequences sound OK. Nothing great but not bad either. It would be nice to have some way of getting different sub-sequences that change over time. That way you could start out with a certain riff that changes along the way. I figured out how to do this, and you can see it in the photo to the upper left of this page. Looking at the left two columns in the Boolean Sequencing matrix, you see the ! and the & characters, plus some blank buttons. These are arranged as a binary count, starting with !! and ending with &&, so that in the first 1/4 of the sequence the !! term plays and in the last 1/4 of the sequence the && term plays. So now we have a beginning and an end, what about the middle? Well, the !& term plays second quarter and the &! term plays third quarter. That completes a song but what about the !-blank and &-blank terms? The !-blank term plays the entire first half while the &-blank term plays the whole second half. In this way we have some continuity because there are four sections, but the first pair and the second pair both share common sub-sequences. It works out quite nicely. What about the bits to the right? Those define the sub-sequences that get played at the various portions of the riff. I have found that to make a good riff, one technique that works is to click the subsequence boxes in such a way as to form a geometric pattern on the buttons, like an "X" or a "/", or an "O". Somehow the sequences that result from such patterns sound like they are working together in various combinations of each other, I'm not sure of the real musicology term for that effect, but geometry works well in this tool. Also the bottom two rows are the frequency part of the sequencing. I like to set them at 4,4,3,3,2,2,1,1 with a frequency offset slider setting of 0 or 1 or 2. This way the song starts out with low freqencies and gets to higher frequencies later in the sequence. It also causes early notes to be close to each other in frequency, while later notes are further apart. You can also try negative numbers as long as the freqency offet slider is greater than the sum of all the negative numbers so that you don't generate a negative frequency, which sounds horrible in the middle of your riff. For example you could try 1,1,1,1,-1,-1,-1,-1 with frequency offset greater than 4. ConclusionI enjoyed writing this Guitar Lab software for people to use, and I'm particularly thankful to the folks at www.electromusic.com for all their free information, advice, and encouragement. Also I must thank the ChucK team in its entirety for creating such a wonderful and powerful music tool that is so easy to use. So give the Guitar Lab a try, you'll like it! |
Logic Matrix PanelThe front panel now features a 12x8 logic matrix, which produces songs around 10 minutes long (depending on your Notes per Second setting). Above the logic matrix is the instrument selection scroller, and to the right of it is the page scroller. At the bottom left you'll find the bit weights for the frequency algebra, and to the bottom right are two frequency control sliders. Above those are some other sliders and the control buttons. Thankfully, there is now a record feature which writes to the file Guitar_Lab.wav in your root directory.
|
Instrument Slider PanelThere are so many parameters that these five instruments filled up a whole page. Later I'm planning to expand this to multiple pages with categories of instruments like "Strings", "Percussion", and "Wind", etcc., but for now these will do nicely. You'll notice that each instrument has its own volume control just below it's on/off button, and the sliders to the right of that button are associated with that instrument. My favorite thing to do with the Giutar and Mandolin sliders is set the String Damping up high and the String Detuning on zero. These settings make a good electric guitar sound, though most settings are quite guitar-like in sound.
|
|
copyright 2007 Les Hall
My stuff: Sports Prediction, Oscillator, Music, HS TechSpy, and Dome Homes. |
Hit Counters |
Contact me inventor-66@comcast.net |