Skip to content

Commit

Permalink
Added abc2mp3, abc2pdf.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Nov 6, 2010
1 parent cfcf9ec commit 813e512
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README
@@ -1,5 +1,11 @@
A collection of small scripts that serve various purposes. 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 backup
remote backup script, wrapping duplicity remote backup script, wrapping duplicity


Expand Down
11 changes: 11 additions & 0 deletions 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
10 changes: 10 additions & 0 deletions 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.