summaryrefslogtreecommitdiff
path: root/audio/xmms-meta-csound
diff options
context:
space:
mode:
authorben <ben@pkgsrc.org>2003-12-24 00:12:50 +0000
committerben <ben@pkgsrc.org>2003-12-24 00:12:50 +0000
commit144996aaeaf02f9db9b1995f28bbf288e7a29cb0 (patch)
tree7012d56fa99b40df9159c24343c130de2ed5cfc5 /audio/xmms-meta-csound
parent69841dfd135ea4de49835bbe5ae3e89607e8f7dc (diff)
downloadpkgsrc-144996aaeaf02f9db9b1995f28bbf288e7a29cb0.tar.gz
Import xmms-meta-csound-0.1, a XMMS meta input script for csound.
This allows XMMS to play unified Csound scores. An example unified Csound score may be found at ftp://ftp.netbsd.org/pub/NetBSD/misc/ben/example.csd.gz Many Csound songs are distributed in separate orchestra, score, and sample files. A script to convert these to a unified Csound score file is at ftp://ftp.netbsd.org/pub/NetBSD/misc/ben/orcsco2csd.sh
Diffstat (limited to 'audio/xmms-meta-csound')
-rw-r--r--audio/xmms-meta-csound/DESCR9
-rw-r--r--audio/xmms-meta-csound/Makefile27
-rw-r--r--audio/xmms-meta-csound/PLIST2
-rw-r--r--audio/xmms-meta-csound/distinfo1
-rwxr-xr-xaudio/xmms-meta-csound/files/csound.sh70
5 files changed, 109 insertions, 0 deletions
diff --git a/audio/xmms-meta-csound/DESCR b/audio/xmms-meta-csound/DESCR
new file mode 100644
index 00000000000..f4701b626f4
--- /dev/null
+++ b/audio/xmms-meta-csound/DESCR
@@ -0,0 +1,9 @@
+This is an input script for xmms-meta-input which allows xmms to play
+unified Csound scores using csound.
+
+An example unified Csound score may be found at
+ftp://ftp.netbsd.org/pub/NetBSD/misc/ben/example.csd.gz
+
+Many Csound songs are distributed in separate orchestra, score, and sample
+files. A script to convert these to a unified Csound score file is at
+ftp://ftp.netbsd.org/pub/NetBSD/misc/ben/orcsco2csd.sh
diff --git a/audio/xmms-meta-csound/Makefile b/audio/xmms-meta-csound/Makefile
new file mode 100644
index 00000000000..49f32c79fae
--- /dev/null
+++ b/audio/xmms-meta-csound/Makefile
@@ -0,0 +1,27 @@
+# $NetBSD: Makefile,v 1.1.1.1 2003/12/24 00:12:50 ben Exp $
+#
+
+DISTNAME= xmms-meta-csound-0.1
+WRKSRC= ${WRKDIR}
+CATEGORIES= audio
+MASTER_SITES= # empty
+DISTFILES= # empty
+
+MAINTAINER= ben@netbsd.org
+HOMEPAGE= # empty
+COMMENT= XMMS meta input script for csound
+
+DEPENDS+= csound-dev-[0-9]*:../../audio/csound-dev
+DEPENDS+= sox-[0-9]*:../../audio/sox
+
+USE_BUILDLINK2= yes
+
+do-build:
+ ${SED} "s,XXXPREFIXXXX,${PREFIX},g" \
+ <${FILESDIR}/csound.sh >${WRKSRC}/csound.sh
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/csound.sh ${PREFIX}/lib/xmms/Input/Meta
+
+.include "../../audio/xmms-meta-input/buildlink2.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/audio/xmms-meta-csound/PLIST b/audio/xmms-meta-csound/PLIST
new file mode 100644
index 00000000000..23f2aafe892
--- /dev/null
+++ b/audio/xmms-meta-csound/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2003/12/24 00:12:50 ben Exp $
+lib/xmms/Input/Meta/csound.sh
diff --git a/audio/xmms-meta-csound/distinfo b/audio/xmms-meta-csound/distinfo
new file mode 100644
index 00000000000..8ded3efa885
--- /dev/null
+++ b/audio/xmms-meta-csound/distinfo
@@ -0,0 +1 @@
+$NetBSD: distinfo,v 1.1.1.1 2003/12/24 00:12:50 ben Exp $
diff --git a/audio/xmms-meta-csound/files/csound.sh b/audio/xmms-meta-csound/files/csound.sh
new file mode 100755
index 00000000000..4dcebf244a6
--- /dev/null
+++ b/audio/xmms-meta-csound/files/csound.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+case "$1" in
+play)
+ file - <"$2" | grep -q gzip
+ if [ $? -eq 0 ]
+ then
+ tempfile="$$.csd"
+ gzip -dc <"$2" >"$tempfile"
+ i="$tempfile"
+ else
+ unset tempfile
+ i="$2"
+ fi
+ channels=1
+ grep -q '^nchnls[[:space:]=]' "$i"
+ if [ $? -eq 0 ]
+ then
+ channels=$(sed -n '/^nchnls/s/.* \([0-9]\)*$/\1/p' <"$i")
+ fi
+ if [ $channels -lt 1 -o $channels -gt 2 ]
+ then
+ echo "Unsupported number of channels." >&2
+ if [ ! -z "$tempfile" ]
+ then
+ rm -f "$tempfile"
+ fi
+ exit 1
+ fi
+ if [ $channels -eq 1 ]
+ then
+ XXXPREFIXXXX/bin/csound32 -d -ostdout -h -s -r 44100 -k 4410 \
+ "$i" 2>/dev/null | XXXPREFIXXXX/bin/sox -t raw \
+ -r 44100 -s -w -c 1 - -t raw -r 44100 -s -w -c 2 -
+ else
+ XXXPREFIXXXX/bin/csound32 -d -ostdout -h -s -r 44100 -k 4410 \
+ "$i" 2>/dev/null
+ fi
+ if [ ! -z "$tempfile" ]
+ then
+ rm -f "$tempfile"
+ fi
+ exit 0
+ ;;
+isOurFile)
+ file - <"$2" | grep -q gzip
+ if [ $? -eq 0 ]
+ then
+ tempfile="$$.csd"
+ gzip -dc <"$2" >"$tempfile"
+ i="$tempfile"
+ else
+ unset tempfile
+ i="$2"
+ fi
+ if [ $(dd if="$i" bs=19 count=1 2>/dev/null | strings) = \
+ "<CsoundSynthesizer>" ]
+ then
+ retval=0
+ else
+ retval=1
+ fi
+ if [ ! -z "$tempfile" ]
+ then
+ rm -f "$tempfile"
+ fi
+ exit $retval
+ ;;
+esac
+exit 1