electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks GalleryGallery 
 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
Electric Guitar => ChucK => Amp => Speaker
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [11 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Inventor



Joined: Oct 13, 2007
Posts: 1700
Location: Florida, USA
Audio files: 67

PostPosted: Tue Mar 25, 2008 5:03 am    Post subject: Electric Guitar => ChucK => Amp => Speaker
Subject description: What is a good ChucK/Guitar set up?
Reply with quote  Mark this post and the followings unread

I'm thinking of getting an electric guitar in July. It's March now, so I have a lot of time to plan, but a few months will go by quickly. Of course it is a requirement to route the Guitar into ChucK so I can do all kinds of fun stuff with it and post-process the sound.

What do you think is the easiest/best way to get the sound in and out of a Mac or a notebook PC, and what types of things would you do with ChucK in this application? Actually I never use the notebook, so that part isn't necessary.

Also I think I'd like to view the guitar's signals with my old scope as well, so I guess I need to make a little break-out box with the jacks and some terminals... Just thinking out loud... Suggestions?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kassen
Janitor
Janitor


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

PostPosted: Tue Mar 25, 2008 6:22 am    Post subject: Reply with quote  Mark this post and the followings unread

Get a soundcard with a pre-amp. Guitars (like microphones) need amplification to be brought up to line-level.

Cool things to try might be sampling it, looping that and playing a second part over it on the fly. Another cool thing might be analyzing the signal for pitch and re-synthesizing based on that.

Both of those techniques are available in guitar pedals as well but unlike distortion/compression/flanging/etc they leave a lot open for interpretation and going beyond the ordinary.

_________________
Modern technology offers an endless field day to any deviant strains in our personalities. --J.G.Ballard
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor



Joined: Oct 13, 2007
Posts: 1700
Location: Florida, USA
Audio files: 67

PostPosted: Tue Mar 25, 2008 9:32 am    Post subject: Reply with quote  Mark this post and the followings unread

I have an eMac, so there's no way to add a sound card, but there are interface thingies like this:

http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID?n=io_devices&fnode=home/shop_mac/mac_accessories/music_creation&nplm=TB084LL/A&mco=6843D59D

which are made to connect a guitar to the Mac. That one is $100, which is about what I'd expect to pay for such a gizmo. It comes with software, but would I be able to connect such a creature up to ChucK? There are other brands as well. Would I use OSC to establish the connection?

I like the idea of analyzing the signal for pitch and then doing things with that, plus the looping sounds fun. I'd like to do something original or new if possible. Once the pitch is detected, I guess it would be easy to play another instrument from ChucK's STK at the same pitch. Or I could create a variety of existing stomp box effects in ChucK. There are lots of creative possibilities, but I guess I won't know what's practical until I get there.

Patiently waiting for July (that's when my annual patent royalty check arrives)... It's not much in terms of dollars, but every little bit helps and it's satisfying after all those years of effort to actually get a royalty for inventing something.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kassen
Janitor
Janitor


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

PostPosted: Tue Mar 25, 2008 10:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
I have an eMac, so there's no way to add a sound card,


Oops, sorry. "soundcard" these days often refers to devices that aren't looking like a "card" at all. USB or Firewire connections are a completely normal way of connecting a audio interface to a computer these days.

Quote:
but there are interface thingies like this:

http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID?n=io_devices&fnode=home/shop_mac/mac_accessories/music_creation&nplm=TB084LL/A&mco=6843D59D

which are made to connect a guitar to the Mac. That one is $100, which is about what I'd expect to pay for such a gizmo.


Yeah, M-audio is a brand that's well-known for their affordable audio interfaces. Of course there are people who will claim that nothing short of a 1000$ interface with a pre-amp of the same price will do but to me it sounds like a reasonable price-point for you. You probably won't be able to go far below that price.

Quote:
It comes with software, but would I be able to connect such a creature up to ChucK? There are other brands as well. Would I use OSC to establish the connection?


Well, these interfaces use drivers and from there on the OS will be able to use them straight. ChucK should see it as a ADC and DAC in the "--probe"
listing, no need for OSC. It would be more like your computer's build-in card from the perspective of the OS. You'll likely hear a improvement in the quality of the sound coming from your computer if you use this as a DAC as well. Personally I'm not a great fan of Apple's build in converters (or really any build in cards, for that matter)

Contact Elektro80 on this forum if you are interested in getting the most bang for your buck in Mac soundcards. there's better stuff then M-Audio, MOTU for example has a good rep but good rep's tend to come at higher price points, Stein will be able to help you make that judgement.

Quote:
I like the idea of analyzing the signal for pitch and then doing things with that, plus the looping sounds fun. I'd like to do something original or new if possible. Once the pitch is detected, I guess it would be easy to play another instrument from ChucK's STK at the same pitch. Or I could create a variety of existing stomp box effects in ChucK. There are lots of creative possibilities, but I guess I won't know what's practical until I get there.


Yeah, I agree. Of course you could try building a algorithmic band to jam with... maybe one that tries to figure out what scale you are in and adapt to that. The possibilities are endless.

Quote:
Patiently waiting for July (that's when my annual patent royalty check arrives)... It's not much in terms of dollars, but every little bit helps and it's satisfying after all those years of effort to actually get a royalty for inventing something.


I think I know the feeling you are talking about. Recognition is good for you :¬)

_________________
Modern technology offers an endless field day to any deviant strains in our personalities. --J.G.Ballard
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kijjaz



Joined: Sep 20, 2004
Posts: 568
Location: bangkok, thailand
Audio files: 2

PostPosted: Tue Mar 25, 2008 11:46 am    Post subject: Reply with quote  Mark this post and the followings unread

Yes. I also recommend that kind of audio interfaces.

If you don't have an audio interface, a tube preamp is good also.
(then connect from Tube Preamp to line-in of the onboard soundcard)

There are like millions of ways we can think up to play with live guitar...
Like making effects, doing delays, etc...

But this thing is what I recommend to try out:
Feedback.

That means the sound of the amp is loud enough to vibrate the guitar body so that you can create some altering chaotic effect from altering patches in chuck.
that's very fun to do.

maybe you might want to combine with prepared guitar also.
- - -

Hahahahahah..
it's more to the experimental zone.
i was playing an acoustic guitar plugged into chuck
and what I was using is reverb and some comb-filter with feedback.
it can be very beatiful and nice for ordinary audiences wanting to hear some pop or beatiful tunes.

having a sub-mix handy is gonna be great also.
so you can plug in guitar directly to the mixer,
"send" by aux of the mixer to chuck then back to mixer,
then connect mixer to amp.
with that, you can control the amount of effect quite comfortably during performance.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
radarsat1



Joined: Mar 14, 2008
Posts: 72
Location: Montreal

PostPosted: Tue Mar 25, 2008 1:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

Miller Puckette gave a presentation at the Pd conference in Montreal about filtering his guitar down to a single partial and running it through a hilbert transform to convert the oscillation to a phase value. Then he used the phase to drive other types of synthesis. Pretty fantastic.

He had to build a custom interface to digitize each string seperately do it though, so it's gonna be some hardware work as well as software..
But you might get some cool sounds even out of the polyphonic signal.
Back to top
View user's profile Send private message
Frostburn



Joined: Dec 12, 2007
Posts: 253
Location: Finland
Audio files: 9

PostPosted: Tue Mar 25, 2008 2:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

radarsat1 wrote:
Miller Puckette gave a presentation at the Pd conference in Montreal about filtering his guitar down to a single partial and running it through a hilbert transform to convert the oscillation to a phase value. Then he used the phase to drive other types of synthesis. Pretty fantastic.

I did something like that in chuck but I used whistling and humming for the input. It sounds pretty wierd when you can whistle with a sawtooth wave. Smile

Another way is to use FFT to fetch the frequency information. It fails more often but it sounds more pure and it's easier to work with frequency than phase.

_________________
To boldly go where no man has bothered to go before.
Back to top
View user's profile Send private message
Inventor



Joined: Oct 13, 2007
Posts: 1700
Location: Florida, USA
Audio files: 67

PostPosted: Tue Mar 25, 2008 6:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

You'll hopefully pardon my ignorance of music and math terminology, but what do you mean by a partial, a Hilbert transform, and a phase? I think I have the background to understand what you're talking about and work with it to some extent, but I'm unfamiliar with the definition of those terms.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frostburn



Joined: Dec 12, 2007
Posts: 253
Location: Finland
Audio files: 9

PostPosted: Wed Mar 26, 2008 12:44 am    Post subject: Reply with quote  Mark this post and the followings unread

A loose definition for a partial is a time varying sinewave.
A sound can be seen (and heard) to be composed of many such partials.
You can in principle produce any sound by just summing up the output of many SinOscs but in practice this only works well for more pure sounds. The technique is called additive synthesis.
To get a partial out of a sound signal you can use a bandbass filter. (Only works if you already know the frequency of the partial and that frequency doesn't change, the general case needs a more technical treatment. I use FFT to get the frequency and fractional bin IFFT to do the additive synthesis.)
Partials whose frequencies are integer multiples of a common base frequency are called harmonics.

Phase is just the place where you are at the sinewave curve.
In the formula y = sin( x ):
x is the phase.
The concept of phase applies to any periodic signal. And in ChucK it's always normalized so that when the phase travels from 0 to 1 you get one period of sound from an oscillator.
So in chuck output = sin( 2*pi*phase ) for a SinOsc.

I haven't used a Hilbert transform myself but looking it up on Wikipedia it seems to do a 90 degrees phase shift on the signal (that is 0.25 in chuck phase). With sinewaves it's easy to extract the amplitude and phase once you get such a special pair for the sinewave.
Another way to exract the phase from a sinewave is to normalize it and use an asin function to get the phase. (You need take the slope in to account too, see Waveshaper.asin2() in my library).

Any signal can be broken down in to it's sinewave components but there are many ways to do that meaningfully.
One way is to use the Fast Fourier Transform. It has some length in samples, let's say 512 and it will break a signal down to 255 sine components and 256 cosine components. These sinewave partials are not always nicely aligned with the input signal and care (ie. windowing and overlap) needs to be taken.

If you're dealing with real functions you can calculate a fourier transform that can be seen as infinite collection of complex sinewaves (e to the power of i times omega). It's an integral transformation and it cannot be done exactly on discrete and finite signals like sampled sound.

_________________
To boldly go where no man has bothered to go before.
Back to top
View user's profile Send private message
Inventor



Joined: Oct 13, 2007
Posts: 1700
Location: Florida, USA
Audio files: 67

PostPosted: Wed Mar 26, 2008 2:40 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks for the explanations, Frostburn, I already knew some of that and the rest was informative. I didn't know ChucK used 0-1 as phase, I'll have to change the upper limit on Synth Lab's phase sliders from 2 pi to 1. Also, phase seems to have multiple meanings in music. There is also the phase of a song, varying from 0 to 1 with the duration of the song. Plus I was trained as an engineer to recognize phase as a phase-shift, where the sinusoid is described as sin (2 * pi * f + phase), or was it sin (2 * pi * f - phase)? Doesn't matter, I quit engineering for good and I'm glad I did.

The method that radarsat1 described reminds me of some code I wrote for Acoustic Interloper, a fellow electro-music.com forum member, when I first got started with ChucK. He wanted to detect the frequency of his note plucking on the banjo and then use that frequency do something musical. In that case we were detecting an LFO-type signal in the neighborhood of five to ten Hz.

I'm looking forward to doing such things with Guitar Lab and Synth Lab once I get done optimizing them for speed. All in good time.

p.s. Like my new sig? It's one-line ASCII art!

_________________
For those about to ChucK, we salute you! - Ge Wang
Let's make noise for peace! - kijjaz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor



Joined: Oct 13, 2007
Posts: 1700
Location: Florida, USA
Audio files: 67

PostPosted: Tue Apr 08, 2008 10:31 am    Post subject: Reply with quote  Mark this post and the followings unread

I've been reading and shopping online and have found some solutions.
The sound card that I like is actually a very low-cost, miniature one - just
right for a laptop. It's made by Behringer and sells for $29. It's their
U-Control UCA202 USB audio interface - but I will have to look into that
further as there is no mention of a preamp.

For a guitar I like the entry-level Fender Stratocasters. I looked at the
entry-level Gibson Les Pauls, but then I read that Les Paul actually had
very little input to their design - in fact some of his ideas were rejected.
The Fender has excellent sound and a whammy-bar which seems like fun,
plus dials and a 5-way switch for the three pickups. I don't know whether
to get the one with a humbucker pickup or the one with all three single
pickups yet. These guitars sell for $400, so they are a bit pricey but within
the range.

I looked at the USB guitars from Behringer, which have a direct USB
output to the computer which I really like. The problem is they are $120
guitars and I read some poor things about their construction.

I like kijjaz's suggestion of getting a tube preamp because that way I can
run it on overload *prior* to receiving it in ChucK. This would be a nice
option compared to a tube amp or tube-simulating amp on the output as I
would probably not want the tube distortion on special effects like thunder
and rain. Plus it would look way cool sitting there glowing next to the
computer with the tubes exposed... I bet those aren't $29!

Then I'll need a ton of accessories: guitar stand, guitar strap, picks, tuner,
etc. Oh, and I must not forget: the amp! I like the very low-end Fender
model for under $100, or a couple of notches up from that one. I don't
need a huge 75 Watt amp as that will only aggravate the neighbors! Just a
simple little one will do fine.

I'll keep you posted on my research as it gets closer to July. Gee,
Christmas in July, I can't wait!

_________________
For those about to ChucK, we salute you! - Ge Wang
Let's make noise for peace! - kijjaz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [11 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
Buy N Save

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003, 2004, 2005, 2006 and 2007 by electro-music.com