From 3be6a63fd81a0435e62f44fba66f89cf734d75a3 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 1 Mar 2012 00:07:13 +0100 Subject: [PATCH] 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. --- music/Makefile | 26 ++++++++++++++++++++++++++ music/drums.abc | 37 +++++++++++++++++++++++++++++++++++++ music/drums.csd | 32 ++++++++++++++++++++++++++++++++ music/space.abc | 20 ++++++++++++++++++++ music/space.csd | 31 +++++++++++++++++++++++++++++++ 5 files changed, 146 insertions(+) create mode 100644 music/Makefile create mode 100644 music/drums.abc create mode 100644 music/drums.csd create mode 100644 music/space.abc create mode 100644 music/space.csd diff --git a/music/Makefile b/music/Makefile new file mode 100644 index 0000000..21a030b --- /dev/null +++ b/music/Makefile @@ -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 diff --git a/music/drums.abc b/music/drums.abc new file mode 100644 index 0000000..b639b40 --- /dev/null +++ b/music/drums.abc @@ -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 diff --git a/music/drums.csd b/music/drums.csd new file mode 100644 index 0000000..b9fa48e --- /dev/null +++ b/music/drums.csd @@ -0,0 +1,32 @@ + + +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 + + +i 99 0 3600 +e 1 + + diff --git a/music/space.abc b/music/space.abc new file mode 100644 index 0000000..72fdac9 --- /dev/null +++ b/music/space.abc @@ -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 +|] diff --git a/music/space.csd b/music/space.csd new file mode 100644 index 0000000..82f42cd --- /dev/null +++ b/music/space.csd @@ -0,0 +1,31 @@ + + +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 + + +i 99 0 3600 +e 1 + +