Start of new music using ABC and Csound.

Two basic, unfinished songs, written in ABC notation are added. The Makefile
will convert the .abc files to MIDI files, which are rendered using Csound. At
the moment, Csound is set up to use the Fluidsynth engine to render sound using
soundfonts, and the reverbsc opcode is used to add a reverb effect.

ABC notation is much easier to write music in than using "raw" Csound score
notation. Also, the abcm2ps utility can create very nice sheet music from ABC
files.
This commit is contained in:
Guus Sliepen 2012-03-01 00:07:13 +01:00
parent c72fa54344
commit 3be6a63fd8
5 changed files with 146 additions and 0 deletions

26
music/Makefile Normal file
View File

@ -0,0 +1,26 @@
SONGS = space drums
OGG = $(SONGS:%=%.ogg)
WAV = $(SONGS:%=%.wav)
MID = $(SONGS:%=%.mid)
PDF = $(SONGS:%=%.pdf)
all: $(OGG)
%.ogg: %.wav
oggenc $<
%.mid: %.abc
abc2midi $< -o $@
%.wav: %.mid %.csd
csound -d -o $@ -T -F $< `basename $< .mid`.csd
%.pdf: %.abc
abcm2ps -B 4 -O - $< | ps2pdf - $@
pdf: $(PDF)
clean:
rm -f $(OGG) $(WAV) $(MID) $(PDF)
.PHONY: all clean

37
music/drums.abc Normal file
View File

@ -0,0 +1,37 @@
X:1
T:Drums & Bass
C:Guus Sliepen
M:4/4
L:1/4
Q:150
K:Bb
%%MIDI drummap C 36
%%MIDI drummap E 40
%%MIDI drummap ^F 42
%%MIDI drummap ^G 44
%%MIDI drummap ^A 46
%%MIDI drummap ^c 49
V:1 clef=treble
%%MIDI channel 10
| CCCC | CCCC | CCCC | Czz/z//C//C/C/
| CCCC | CCCC | CCCC | Czz/z//C//C/C/
| CCCC | CCCC | CCCC | Czz/z//C//C/C/
| CCCC | CCCC | CCCC | Czz/z//C//C/C/
V:2 clef=treble
%%MIDI channel 10
| z4 | z4 | z4 | z4
| z4 | z4 | z4 | z4
| z4 | z4 | z4 | z2 ^c2
| zEzE | zEzE | zEzE | z!p!^c!f!^c!fff!^c
V:3 clef=treble transpose=-36
%%MIDI channel 1
| z4 | z4 | z4 | z _e d _d
| c/c/c/c/c/c/c/c/ | c/c/c/c/c/c/c/_B/ | c/c/c/c/c/c/c/c/ | _B _B _B _B
| c/c/c/c/c/c/c/c/ | c/c/c/c/c/c/c/_B/ | c/c/c/c/c/c/c/c/ | _B _B _B _B
| c/c/c/c/c/c/c/c/ | c/c/c/c/c/c/c/_B/ | c/c/c/c/c/c/c/c/ | _B _B _B _B
V:4 clef=treble
%%MIDI channel 2
| z4 | z4 | z4 | z4
| z4 | z4 | z4 | z4
| z[CEG]/z//[CEG]//z[CEG]/z/ | z[CEG]/z//[CEG]//z[CEG]/z/ | z[CEG]/z//[CEG]//z[CEG]/z/ | z[B,DF]/z/z2
| z[CEG]/z//[CEG]//z[CEG]/z/ | z[CEG]/z//[CEG]//z[CEG]/z/ | z[CEG]/z//[CEG]//z[CEG]/z/ | z[B,DF]/z/z2

32
music/drums.csd Normal file
View File

@ -0,0 +1,32 @@
<CsoundSynthesizer>
<CsInstruments>
sr = 48000
ksmps = 32
nchnls = 2
0dbfs = 1
; Use Fluidsynth to render the score using soundfonts
gifluid fluidEngine; start fluidsynth engine
ifont fluidLoad "/usr/share/sounds/sf2/FluidR3_GM.sf2", gifluid, 1
fluidProgramSelect gifluid, 1, ifont, 0, 38 ;Synth bass 1
fluidProgramSelect gifluid, 2, ifont, 0, 29 ;Distortion guitar
fluidProgramSelect gifluid, 10, ifont, 128, 25 ;TR-808 drums
instr 1, 2, 10
ikey notnum
ivel ampmidi 127
fluidNote gifluid, p1, ikey, ivel
endin
instr 99
al, ar fluidOut gifluid
al, ar reverbsc al, ar, 0.6, 10000
outs al, ar
endin
</CsInstruments>
<CsScore>
i 99 0 3600
e 1
</CsScore>
</CsoundSynthesizer>

20
music/space.abc Normal file
View File

@ -0,0 +1,20 @@
X:1
T:Space (Starfighter intro)
C:Guus Sliepen
M:2/2
L:1/8
Q:120
K:Bb
V:1 clef=treble
%%MIDI channel 1
%%MIDI gchordoff
[| z8 | z8 | z8 | z8
|| "Eb" e6 dc | f4 d4 | "Cm" e6 dc | f4 d4 | "Gm" B6 AG | d4 B4 | "F" A8- | "Dm" A8
| "Eb" e6 dc | f4 d4 | "Cm" e6 dc | g4 e4 | "Gm" d6 cB | f4 d4 | "F" c8 | "Bb" d8
|]
V:2 clef=treble
%%MIDI channel 2
[| C8- | [CF]8- | [CFB]8- | [CFBe]8
|| [EGB]8- | [EGB]8 | [CEG]8- | [CEG]8 | [B,DG]8- | [B,DG]8 | [A,CF]8- | [A,DF]8
| [EGB]8- | [EGB]8 | [CEG]8- | [CEG]8 | [B,DG]8- | [B,DG]8 | [A,CF]8- | [B,DF]8
|]

31
music/space.csd Normal file
View File

@ -0,0 +1,31 @@
<CsoundSynthesizer>
<CsInstruments>
sr = 48000
ksmps = 32
nchnls = 2
0dbfs = 1
; Use Fluidsynth to render the score using soundfonts
gifluid fluidEngine; start fluidsynth engine
ifont fluidLoad "/usr/share/sounds/sf2/FluidR3_GM.sf2", gifluid, 1
fluidProgramSelect gifluid, 1, ifont, 0, 98 ; Crystal
fluidProgramSelect gifluid, 2, ifont, 0, 89 ; Warm pad
instr 1, 2
ikey notnum
ivel ampmidi 127
fluidNote gifluid, p1, ikey, ivel
endin
instr 99
al, ar fluidOut gifluid
al, ar reverbsc al * 0.5, ar * 0.5, 0.9, 10000
outs al, ar
endin
</CsInstruments>
<CsScore>
i 99 0 3600
e 1
</CsScore>
</CsoundSynthesizer>