_
__ _ _ _| |_ ___ ___ ___ _ __ ___ _ __
/ _` | | | | __/ _ \ / __/ \| ' ` \| ' \
| (_| | |_| | || (_) | (_| (_) | | | | | | |_) |
\__,_|\__,_|\__\___/ \___\___/|_| |_| || ._/
|_| v0.0.5
Autocomp takes as input a text file containing chord changes, plus time signature and bpm information, and outputs a csound .sco file containing a simple arrangement of those changes. A sample .orc file containing a bass instrument, a selection of keyboard instruments and a small sample-based drumkit is provided.
The idea is not to produce music that you would want to listen to, necessarily, but rather to produce something that you could jam along to and practise with using a fake book. The syntax of the text file is such that you can pretty much type in the chords directly, and so long as you get the barlines in the right place, and the right number of chords in each bar, autocomp will know what you mean and do the right thing.
Currently, there is only one musical style of output, 'Swing', which is a pastiche of a swing style, with a simple walking bass, a vaguely 'swinging' drum part, and rudimentary keyboard stabs.
There is also a 'Debug' style, which writes out the chords that autocomp thinks it's been asked to play, followed by a dump of the contents of the data structure representing the tune, using Data::Dumper.
By default, the output contains drums, bass and a rhodes part. You can optionally turn off any of those parts, or change the keyboard instrument to a Hammond organ-like thing, a Wurlitzer-like thing, or a vibraphone like thing.
You can also optionally have a count-in of as many bars as you ask for, and/or get Autocomp to repeat the whole tune several times.
Requirements/Installation
You need a working Perl (http://www.perl.org) and Csound (http://www.csounds.com). That should be it.
Unpack the tarball somewhere, and leave everything where it is - for now, autocomp.pl expects to find the Autocomp modules in the same directory as itself.
Usage
autocomp.pl [-v -h] -i <infile> [-s <style> -o <outfile>]
[-d <0|1> -b <0|1> -k <0-4> -r <n> -c <n>]
-v - prints version number and exits
-h - prints help info and exits
-i - sets input filename
-s - optionally set style (defaults to Swing)
-o - optionally set output filename (defaults to input filename with
the extension stripped and .sco appended)
-d - drums toggle (0 - off, 1 - on, default on) -b - bass toggle (0 - off, 1 - on, default on) -k - keys switch (0 - no keys, 1 - rhodes, 2 - wurlitzer, 3 - hammond,
4 - vibes, default rhodes)
-r - number of times to repeat whole tune (default 0) -c - number of bars count-in (default 0)
- Eg
autocomp.pl -i autumnleaves.txt
This creates a .sco file called autumnleaves.sco with the default Swing style.
To hear the file, you need to invoke csound on it, something like:
csound -o devaudio comp.orc autumnleaves.sco
Various example input files are included with the distribution - autumnleaves.txt, allofme.txt, astimegoesby.txt, bluetrane.txt, georgia.txt, giantsteps.txt, howhighthemoon.txt, macktheknife.txt, misty.txt, rhythmchanges.txt, takefive.txt, taketheatrain.txt
Input syntax
All chords and barlines must be surrounded by whitespace.
| - bar line
|: - begin repeat section
:| - end repeat section
|1 - first time repeat section
|2 - second time repeat section
|| - end
C - major chord
C6 - sixth chord
C7 - dominant seventh chord
Cmaj7 - major seventh chord
C9 - ninth chord
C7b9 - dominant seventh with flattened ninth
Cm - minor chord
Cm7 - minor seventh chord
Cm7b5 - minor seventh with flattened fifth
Cdim - diminished chord
% - repeat last chord
NB - I know there are more chords than this. I haven't got around to implementing them yet. Autocomp tries to do something reasonably sane with chords it doesn't know about, but may not succeed.
Lines beginning '#' are comments. Empty lines are ignored.
There are two keywords, TS and BPM, each of which must appear on a line by themselves, followed by a colon, as follows:
TS:n/n - time signature (default to 4/4) BPM:n - beats per minute (default to 120)
You should be able to change time signature and/or bpm in the middle of a tune - see georgia.txt for an example.
Within each bar, autocomp assumes that all chords take the same amount of time - the % can be used to get rhythmic chord changes within a bar right (eg | C % % G7 | to get a change on the last measure of the bar, etc).
- Eg
Autumn Leaves (Johnny Mercer)
TS:4/4
BPM:100
|: Am7 | D7 | Gmaj7 | Cmaj7 | Fm7b5 |1 B7 | Em | % :|2 B7 | Em | % |
Fm7b5 | B7b9 | Em | % | Am7 | D7 | Gmaj7 | % |
Fm7b5 | B7b9 | Em7 Eb7 | Dm7 Db7 | Cmaj7 | B7b9 | Em | % ||
To Do
- Styles
-
- More styles
- Better walking bass
- Better swing drum part
- Better keyboard parts
- Better bass sound
- Better drum samples
- Handle changing style within a tune?
- Handle stops, and NoChord
- Better, more sequencer-like interface to styles - should be able to set phrase length (when fills come), to tell it about stops etc, and have at least two kinds of rhythm and two fills per style. More code should be in Style.pm, and there should be some kind of translator to emit code from simple input files for new Style subclasses.
- General
-
- Support more chords
- and keep doing so until we run out. I see no reason why any chord that can be notated should not be supported.
- Direct audio, .wav, .aiff, .mp3, midi output
- audio, wav/aiff: call csound directly
- mp3: make a wav, then convert to mp3
- midi: dunno.
- Handle more than one level of repeating (can only do second time for now)
- Support more chords
Bugs
Sounds well dodgy.
Author
Wayne Myers (waz@easynet.co.uk), http://www.waz.easynet.co.uk/
Thanks and Acknowledgements
- Firstly, all due credit and kudos to Larry Wall and the Perl people, and to Barry Vercoe, Richard Boulanger and the Csound people, without whom none of this would have been possible.
- The rhythmchanges.txt chords are from Mark Sabatella's excellent Jazz improvisation tutorial on http://www.chordboard.com/primer/.
- My particular thanks to (superb) trumpet player Kevin G Davy (http://www.lostwishes.com/kevin/) for inspiring me to go out and get a fakebook, my inability to practise alone with which led directly to me writing this software.
- The bass instrument is by Hans Mikelson, as published in the Csound book, on p 371 of my edition. One day I will understand Csound enough to know how and why it works, and then fix the range problems with it. (I'm probably not using it correctly).
- The rhodes, hammond and wurlitzer keyboard sounds are more or less taken directly from Kevin Conder's alternative CSound reference manual examples (http://kevindumpscore.com/docs/csound-manual/)
- I'm 99% certain the wav samples provided are public domain. I am not wholly sure where I got them from though, and will happily remove them from the distribution if you can show me that I should so do. To be honest, I want to replace them with nicer sounding ones anyway.
- If all the above debts of gratitude weren't enough, I must, in conclusion, thank all the musicians, especially the jazz musicians, who have inspired me to learn to play music myself. There are too many to list here, but the history section of Mark Sabatella's tutorial contains the main names. This tool is not intended to replace musicians - far from it. It is a practice tool for musicians, intended to provide an endlessly patient rhythm section so you can hone those chops before going down to the actual session with actual people and trying them out there. Anyone using autocomp for anything else does so at their own risk.
License
Autocomp - an accompaniment generator for Perl and Csound
Copyright (c) 2002 Wayne Myers (waz at easynet.co.uk)
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
