Permalink
Browse files

Added abc2mp3, abc2pdf.

  • Loading branch information...
1 parent cfcf9ec commit 813e512e320b78066249a4f88b3f5dc72e8951bf @jgm committed Nov 6, 2010
Showing with 27 additions and 0 deletions.
  1. +6 −0 README
  2. +11 −0 abc2mp3
  3. +10 −0 abc2pdf
View
6 README
@@ -1,5 +1,11 @@
A collection of small scripts that serve various purposes.
+abc2mp3
+ convert abc musical notation to mp3 (wraps abc2ps, lame)
+
+abc2pdf
+ convert abc musical notation to PDF (wraps abc2ps)
+
backup
remote backup script, wrapping duplicity
View
11 abc2mp3
@@ -0,0 +1,11 @@
+#!/bin/sh
+# Convert a text file with abc music notation (abcnotation.com)
+# to MP3, suing abc2ps and lame.
+PID=$$
+TITLE=$(abc2ps -L "$1" | sed -n '2s/\s*\S*\s*\S*\s*\S*\s*\(.*\)/\1/p')
+WAV=Abc.wav
+MP3="${1%.abc}.mp3"
+abc2ps -a -Q ${BPM:=120} -W -A "$@"
+lame --tt "${TITLE}" $WAV $MP3
+echo "Created $MP3 for $TITLE"
+rm $WAV
View
10 abc2pdf
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Convert a text file with abc musical notation (abcnotation.com)
+# to a PDF, using abc2ps.
+PID=$$
+TMPPS="/tmp/${1%.abc}-$PID.ps"
+PDF="${1%.abc}.pdf"
+abc2ps "$@" -maxs 2000 -O $TMPPS
+ps2pdf $TMPPS $PDF
+echo "Created $PDF"
+rm $TMPPS

0 comments on commit 813e512

Please sign in to comment.