Sunday, January 13, 2008

Psytrance in Csound. 4 - Score Macros

Something is bugging me a little bit. So far, I've been auditioning only one bar of music and it's hard to get a good view of the soundscape in one bar. Four bars would be more in context with this project. Csound has a simple provision for macros. Here's what I did:

;=== SCORE ===

f 1 0 8192 10 1

t 0 150

#define KICK #
; p1 p2 p3 p4 p5 p6
; start dur freq level reverb
i 1 0 .5 44 .8 .01
i 1 1 .5 44 .8 .01
i 1 2 .5 44 .8 .01
i 1 3 .5 44 .8 .01
#

#define BASS #
; p1 p2 p3 p4 p5 p6
; start dur pitch level reverb
i 2 0.50 6 5.09 .8 .04
i 2 1.50 6 6.09 .8 .04
i 2 2.50 6 5.09 .8 .04
i 2 2.75 6 6.07 .8 .04
i 2 3.50 6 6.09 .8 .04
#

$KICK.
$BASS.
b 4
$KICK.
$BASS.
b 8
$KICK.
$BASS.
b 12
$KICK.
$BASS.

e

Listen (psy4-1.mp3) or Download Code & WAV (psy4-1.zip)

The b in the score creates a beat offset in the macro code that follows. So instead of 0, 1, 2 and 3, after "b 4" it turns the start times into 0+4, 1+4, 2+4 and 3+4.

Now it's starting to sound like a song!

11 comments:

g.p.macklin said...

Keep up the good work. This topic is really interesting.

Anonymous said...

hey bro ... wats is csound ... i am sorry but where can i find info on it ... please post a comment back ...

Joe Maffei said...

makky, you can find more info about Csound at www.Csounds.com

Also, search Google for info. You never know what might pop up.

thumbuki said...

First, I want to say both your kick and bass instruments sound amazing.

Second, I have a csound instrument that may be of some help in sequencing drum patterns:

Drum Sequencer Event Generator


That version of dseq is a bit old. I can prepare the latest version for you if you'd like.

Joe Maffei said...

thumbuki, I played around with dseq and it would be great for this psytrance project. In fact, with a little modification, you could turn it into a melodic sequencer as well (think two lines: one for pitch, the other for octave. Maybe other lines for duration, amplitude, portamento, etc).

I *really* like your hi-hat instrument. I tried creating something similar from an 808 diagram but it didn't sound that good. I'll have to modify yours to use with my project :) Any ideas on how I could make it stereo, so that there are two slightly different hi-hats on the left and right channels? Maybe with a parameter to control stereo width?

By the way, if anyone reading this blog has anything they'd like to contribute -- I'm still looking for a good trancey snare (might have to use a sample), leads, effects, etc. I'm a little discouraged right now because I'm not too happy with the bass and can't come up with very good lead sounds. Besides, I received a few discouraging comments on the Isratrance forum.

Sure, this will be a lot of work. I just wanted to show that it can be done.

thumbuki said...

joe, I'm currently in the process of writing an article for the Csound journal involving a newer version of the dseq instrument I linked to here. I would like to include both your kick and bass instruments, with your permission. They would need some modifications to make them compatible with the new dseq. I could easily do it myself, or if your up to the challenge. :)

I also made a simple instrument that plays notes rather just percussion sounds. The instrument is called "simpleRez" and you can download it here.

That file also has details about contributing instruments or musical examples to the article, if you decide to do it. I will absolutely give credit where credit is due. Anyone else reading this is invited to give it a go as well.

In those files, I changed the hihats a little giving them more of a stereo sound. Though I have yet to wire in a parameter for stereo width.

Joe Maffei said...

thumbuki, thanks for all the kudos. Go ahead and use my source code. I'd really appreciate it if you would please add a comment line saying something like "based on an instrument coded by Joe Maffei. www.joemaffei.com"

Thanks! Maybe this will catch on with the psytrance community.

Joe Maffei said...

thumbuki, I checked out your new dseq file and I really like it. It's a promising new approach to Csound sequencing!

thumbuki said...

joe, I've converted your two instruments and score. Here's the file:

dseq_psy.csd

I did my best to preserve your code and coding style as best as possible. Though I did make a few superficial changes. Let me know what you think.

Joe Maffei said...

thumbuki, nicely done. For a future version of dseq, maybe "nseq" for "note sequencer", I have some suggestions:
- instead of using the quoted part for velocity, you could use it for pitch. I don't know how difficult it would be to implement, but you could have a separate sequencer for velocity and other control values such as filter cutoff, etc.
- for note names and octaves, you could use a hexadecimal version of the x.xx format where pitch is defined by 0-B, octave from 0-F. (i.e. 64 is F#, octave 4). Or you could use the QWERTY format where ZXCVBNM correspond to the white keys on a keyboard and SDGHJ are the black ones.
Then again, maybe that would be overkill.

thumbuki said...

joe, as of now, dseq is being used to control pitch rather than velocity in the psyBass instrument. If you've already noticed, you can skip to the last paragraph. :) Here's a line from the score:

i $dseq 0 1 $psyBass 0.8 5.09 0.04 0 0 "..0. ..c. ..0a ..c."

In this instance, p-field equals 5.09, establishing the base pitch. The values in the string (0, a, c) are hexadecimal numbers that represent notes.

Assuming the base pitch is 5.09... When the string character is a "0", the pitch will be 5.09. When the character is "1", the pitch will be 5.10. When the character is "c", hexadecimal for 12, the pitch will be 6.09.

This may not be the most flexible solution, as it is limited to a range of 15 notes. But it works for now. And it is possible to design an instrument that utilizes two or more rows, such as pitch and velocity. I'll come up with an example today.

I will eventually create a new sequencer design specifically for pitches. So if you have any more suggestions, I'm taking notes. As for dseq, I think I'm going to set the syntax in stone in the next couple of days. The last thing that will be implemented is swing. Which I have working in a limited capacity. And btw, I like the qwerty idea, since I personally haves roots in trackers.