home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-05-15 | 60.7 KB | 2,327 lines |
- Newsgroups: comp.sources.misc
- From: durian@advtech.uswest.com (Mike Durian)
- Subject: v37i046: tclm - TCL extensions for MIDI file manipulation, Part04/05
- Message-ID: <1993May10.215416.4532@sparky.imd.sterling.com>
- X-Md4-Signature: 7e0fe133c839fcae8a4e9e0d41e2664a
- Date: Mon, 10 May 1993 21:54:16 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: durian@advtech.uswest.com (Mike Durian)
- Posting-number: Volume 37, Issue 46
- Archive-name: tclm/part04
- Environment: BSD/386, Esix SV4, SunOS, TCL 6.x
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: tclm-1.0/Blurb tclm-1.0/INSTALL tclm-1.0/Makefile
- # tclm-1.0/README tclm-1.0/doc/Makefile tclm-1.0/doc/README
- # tclm-1.0/doc/infom.1 tclm-1.0/doc/midiconfig.3
- # tclm-1.0/doc/midifixtovar.3 tclm-1.0/doc/midimake.3
- # tclm-1.0/doc/midimerge.3 tclm-1.0/doc/midiplay.3
- # tclm-1.0/doc/midiplayable.3 tclm-1.0/doc/midiread.3
- # tclm-1.0/doc/midirecord.3 tclm-1.0/doc/midirewind.3
- # tclm-1.0/doc/midistop.3 tclm-1.0/doc/miditiming.3
- # tclm-1.0/doc/midivartofix.3 tclm-1.0/doc/midiwrite.3
- # tclm-1.0/doc/mplay.1 tclm-1.0/doc/mrecord.1 tclm-1.0/doc/tclm.1
- # tclm-1.0/m1to0 tclm-1.0/mlib/DEVICES tclm-1.0/mlib/mdevice.h
- # tclm-1.0/mplay tclm-1.0/mseq.BNF tclm-1.0/tclmPlay.h
- # Wrapped by kent@sparky on Mon May 10 09:43:33 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 4 (of 5)."'
- if test -f 'tclm-1.0/Blurb' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/Blurb'\"
- else
- echo shar: Extracting \"'tclm-1.0/Blurb'\" \(733 characters\)
- sed "s/^X//" >'tclm-1.0/Blurb' <<'END_OF_FILE'
- X Tclm is an extended version of John Ousterhout's tcl (Tool Command
- XLanguage) package. The extensions are designed to allow easy
- Xmanipulation of Standard MIDI Files. The combination of the easy
- Xto use tcl interpreted language and the MIDI extensions makes it
- Xvery simple to write you own MIDI applications.
- X If you've played with tclm-0.1, you'll find 1.0 a lot different.
- XI think it is much easier to use and a lot more powerful, but then
- Xmy opinion might be a bit biased.
- X Included with tclm are a few scripts that use tclm. These include
- Xscripts to play and record record MIDI files as well as a simple
- Xtext based sequencer. There is also a pair of scripts that convert
- Xa MIDI file into human readable form and back again.
- END_OF_FILE
- if test 733 -ne `wc -c <'tclm-1.0/Blurb'`; then
- echo shar: \"'tclm-1.0/Blurb'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/Blurb'
- fi
- if test -f 'tclm-1.0/INSTALL' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/INSTALL'\"
- else
- echo shar: Extracting \"'tclm-1.0/INSTALL'\" \(2432 characters\)
- sed "s/^X//" >'tclm-1.0/INSTALL' <<'END_OF_FILE'
- X Installation for tclm-1.0 May 5, 1993
- X
- X 1) Get tcl. As of today, the latest version of tcl
- Xis tcl6.7. It is available at sprite.berkeley.edu.
- XIf you use X11 you might want to pick up tk3.2 instead
- Xas it contains tcl6.7 and some cool X stuff (plus you'll
- Xbe able to run xdrum if you want).
- X If you are not already familiar with tcl you might
- Xalso want to pick up the first three parts of John
- XOusterhout's book on tcl and tk. They are easy to read
- Xand do a very good job of explaining how to use them.
- X
- X 2) Build and install the aforementioned packages. See
- Xtheir documentation on how to do this.
- X
- X 3) Edit the Makefile. Check out the stuff near the top
- Xand change the paths as necessary. If you change the install
- Xdirectory, you'll also have to change the first line of
- Xthe tclm scripts to point to the correct location of tclm.
- X Most of the important variables get passed down to
- Xthe mlib directory for the Makefile there, but if you
- Xsuspect problems, edit that make file too.
- X One very important thing to check is the DEFS line
- Xand the DRIVER line. If MIDIPLAY is not defined, you will
- Xnot be able to use the midiplay, midirecord and midistop
- Xcommands. This in turn means you won't be able to run
- Xmplay or mrecord.
- X Unfortunately, if you define MIDIPLAY, you must also
- Xsupply an interface between tclm and the MIDI device.
- XCurrently I only supply the interface for the latest BSD/386
- XMIDI driver, but I hear one is in the works for Linux.
- X You can of course, write your own. See the man page
- Xtclm_interface(3) on how to do this, and check out mpu_bsd386.c
- Xfor an example of how it was done in one case. If you do
- Xwrite an interface, why not send me a copy and I'll incorporate
- Xit into future releases of tclm.
- X The above being said, you shouldn't give up hope of using
- Xtclm if you don't have an interface. There are still useful
- Xthings you can do. The mseq, minfo, infom and m1to0 scripts
- Xare examples.
- X
- X 4) make
- X
- X 5) make install
- X
- X 6) If you want to install you man pages, either
- Xmake install-man-cooked (the default) or make install-man-raw.
- Xinstall-man-cooked formats the man pages and copies the
- Xformatted document to the man dir. install-man-raw installs
- Xthe unformatted document.
- X You probably want to use the cooked option, as the man pages
- Xuse the mdoc macros and not the older man macros. I don't think
- Xman(1) knows to process the files with mdoc.
- X
- X 7) You're done.
- END_OF_FILE
- if test 2432 -ne `wc -c <'tclm-1.0/INSTALL'`; then
- echo shar: \"'tclm-1.0/INSTALL'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/INSTALL'
- fi
- if test -f 'tclm-1.0/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/Makefile'\"
- else
- echo shar: Extracting \"'tclm-1.0/Makefile'\" \(2967 characters\)
- sed "s/^X//" >'tclm-1.0/Makefile' <<'END_OF_FILE'
- X#
- X# set TCLSRCDIR to the location of the tcl source
- X#
- XTCLSRCDIR = /usr/local/src/tk3.2/tcl
- X
- X#
- X# add -DMIDIPLAY to defines if you wish to compile in the ability to
- X# play standard MIDI files. This will only work on systems
- X# equipped with a MIDI interface and systems with an interface
- X# between tclm and the MIDI device. See the DRIVER define
- X# for a list of currently available interfaces.
- X#
- X# add -DUNION_WAIT if your wait3(2) system call needs a
- X# union wait and not an int.
- X#
- X# DEFS = -DUNION_WAIT
- XDEFS = -DMIDIPLAY
- X
- X#
- X# add driver type. This only matters if PLAYMIDI is defined
- X# current choices are:
- X# mpu_bsd386.o MPU-401 compatibles on BSD/386
- X#
- X# DRIVER =
- XDRIVER = mpu_bsd386.o
- X
- X#
- X# set RANLIB to ranlib if your system has it - otherwise set it to
- X# true
- X#
- X# RANLIB = true
- XRANLIB = ranlib
- X
- X#
- X# set INSTALL to be your install program
- X#
- X# INSTALL = cp
- XINSTALL = install
- X
- X#
- X# set INSTALLEXECFLAG to be flags needed when installing
- X# executables
- X#
- XINSTALLEXECFLAG = -c -m 755
- X
- X#
- X# set INSTALLTEXTFLAG to be flags needed when installing
- X# text files
- X#
- XINSTALLTEXTFLAG = -c -m 644
- X
- X#
- X# set BINDIR to the directory where the executables should go
- X#
- XBINDIR = /usr/local/bin
- X
- X#
- X# set LIBDIR to the directory where libtclm.a and libmutil.a should go
- X#
- XLIBDIR = /usr/local/lib
- X
- X#
- X# set INCDIR to the directory where the .h files should go
- X#
- XINCDIR = /usr/local/include
- X
- X#
- X# tclm library stuff
- X#
- XTCLMLIB = libtclm.a
- XTCLMLIBOBJS = tclmCmd.o tclmPlay.o
- X
- X#
- X# stuff for a tclm executable
- X#
- XTCLMSRC = main.c
- XTCLMOBJ = main.o
- XTCLMEXEC = tclm
- X
- X#
- X# some sample scripts
- X#
- XTCLMSCRIPTS = mplay minfo mseq m1to0 infom mrecord
- X
- X#
- X# where the MIDI library routines are located
- X#
- XMIDILIBDIR = ./mlib
- XMIDILIB = $(MIDILIBDIR)/libmutil.a
- X
- X#
- X# flags and libraries
- X# using the -lm flag in case someone has tclx which wants pow(3)
- X#
- XLIBS = -ltcl -ltclm -lmutil -lm
- XLDFLAGS = -L. -L$(MIDILIBDIR) -L$(LIBDIR) $(LIBS)
- XCFLAGS = $(DEFS) -O -I$(TCLSRCDIR) -I$(MIDILIBDIR)
- XCC = cc
- X
- X
- X$(TCLMEXEC): $(MIDILIB) $(TCLMLIB) $(TCLMOBJ)
- X $(CC) -o $(TCLMEXEC) $(TCLMOBJ) $(LDFLAGS)
- X
- X$(TCLMLIB): $(TCLMLIBOBJS)
- X rm -f $(TCLMLIB)
- X ar cr $(TCLMLIB) $(TCLMLIBOBJS)
- X $(RANLIB) $(TCLMLIB)
- X
- X$(MIDILIB): FORCE
- X cd $(MIDILIBDIR); \
- X $(MAKE) DEFS=$(DEFS) RANLIB=$(RANLIB) DRIVER=$(DRIVER)
- X
- Xinstall: $(TCLMEXEC) $(TCLMSCRIPTS)
- X $(INSTALL) $(INSTALLEXECFLAG) $(TCLMEXEC) $(TCLMSCRIPTS) $(BINDIR)
- X $(INSTALL) $(INSTALLTEXTFLAG) $(TCLMLIB) $(LIBDIR)
- X $(RANLIB) $(LIBDIR)/$(TCLMLIB)
- X $(INSTALL) $(INSTALLTEXTFLAG) tclm.h tclmPlay.h $(INCDIR)
- X cd $(MIDILIBDIR); \
- X $(MAKE) install \
- X LIBDIR="$(LIBDIR)" \
- X RANLIB="$(RANLIB)" \
- X INCDIR="$(INCDIR)" \
- X INSTALL="$(INSTALL)" \
- X INSTALLEXECFLAG="$(INSTALLEXECFLAG)" \
- X INSTALLTEXTFLAG="$(INSTALLTEXTFLAG)"
- X
- Xinstall-man-cooked:
- X cd doc; $(MAKE) install-man-cooked
- X
- Xinstall-man-raw:
- X cd doc; $(MAKE) install-man-raw
- X
- Xclean:
- X rm -f $(TCLMEXEC) $(TCLMLIB) $(TCLMLIBOBJS) $(TCLMOBJ)
- X cd $(MIDILIBDIR); $(MAKE) clean
- X cd doc; $(MAKE) clean
- X
- XFORCE:
- END_OF_FILE
- if test 2967 -ne `wc -c <'tclm-1.0/Makefile'`; then
- echo shar: \"'tclm-1.0/Makefile'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/Makefile'
- fi
- if test -f 'tclm-1.0/README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/README'\"
- else
- echo shar: Extracting \"'tclm-1.0/README'\" \(2005 characters\)
- sed "s/^X//" >'tclm-1.0/README' <<'END_OF_FILE'
- X tclm-1.0 May 5, 1993
- X
- X If you are looking in this file only to find out how
- Xto install tclm, take a look at the INSTALL file.
- X Tclm is an extension of John Ousterhout's tcl (Tool Command
- XLanguage) package. The extension are designed to allow
- Xeasy manipulation of Standard MIDI Files. The combination
- Xof the easy to use tcl interpreted language and the MIDI
- Xextensions makes it very simple to write you own MIDI
- Xapplications.
- X If you've played with tclm-0.1, you'll find 1.0 a lot
- Xdifferent. I think it is much easier to use and a lot
- Xmore powerful, but then my opinion might be a bit
- Xbiased.
- X Included with tclm are some scripts that use tclm.
- XSome script that don't depend on having a MIDI device include
- Xminfo and infom. The first, minfo, prints a MIDI file
- Xin human readable form. The second converts the output
- Xof minfo to a MIDI file. This allows you to use standard
- Xtools like awk, sed and vi to modify a MIDI file.
- X There is also a simple scripting language implemented
- Xin tclm that allows you to sequence separate MIDI
- Xfiles into one file. It has support for merging files
- Xin parallel and repeating blocks. It's not very sophisticated,
- Xbut it works and might be a good starting place for more
- Xelaborate text based sequencers (hint, hint).
- X There are also a few scripts that take advantage of your
- XMIDI device if it has been integrated into tclm. mplay
- Xplays a MIDI file and mrecord records to a MIDI file.
- XSee the INSTALL file and the tclm_interface man page
- Xfor more information on integrating your MIDI device
- Xinto tclm.
- X Of course what I really hoping is that people will use
- Xtclm to write their own scripts and make those scripts
- Xavailable to the rest of us. If you write one, send it
- Xto me and I'll integrate it into a future release of
- Xtclm if it makes sense.
- X Let me know of any problems, bug, fixes or general
- Xcomments.
- X
- X Special thanks go to Michael Caro (acps7221@ryevm.ryerson.ca)
- Xfor invaluable feedback and suggestions.
- X
- Xmike durian
- Xdurian@advtech.uswest.com
- END_OF_FILE
- if test 2005 -ne `wc -c <'tclm-1.0/README'`; then
- echo shar: \"'tclm-1.0/README'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/README'
- fi
- if test -f 'tclm-1.0/doc/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/Makefile'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/Makefile'\" \(1607 characters\)
- sed "s/^X//" >'tclm-1.0/doc/Makefile' <<'END_OF_FILE'
- X#
- X# NROFF is the command to format the man pages
- X#
- XNROFF = groff -mdoc -Tascii
- X
- X#
- X# MANDIR is the directory when the man pages go
- X#
- XMANDIR = /usr/local/man
- X
- X#
- X# MANSUB is the subdirectory for man pages
- X#
- X# MANSUB = man
- XMANSUB = cat
- X
- X#
- X# MANEXT1 is the extension for man section 1 pages
- X#
- XMANEXT1 = 1
- X
- X#
- X# MANEXT3 is the extension for man section 3 pages
- X#
- XMANEXT3 = 3
- X
- X#
- X# MANOWN is the owner of the man pages
- X#
- XMANOWN = bin
- X
- X#
- X# MANGRP is the group of the man pages
- X#
- XMANGRP = bin
- X
- X#
- X# INSTALL is the program to install the man pagess
- X#
- XINSTALL = install -c -o $(MANOWN) -g $(MANGRP) -m 444
- X
- XMAN1 = infom.1 m1to0.1 minfo.1 mplay.1 mrecord.1 mseq.1 tclm.1
- XMAN3 = midiconfig.3 midifixtovar.3 midifree.3 midiget.3 midimake.3 \
- X midimerge.3 midiplay.3 midiplayable.3 midiput.3 midiread.3 \
- X midirecord.3 midirewind.3 midistop.3 miditiming.3 \
- X midivartofix.3 midiwrite.3 tclmversion.3 tclm_interface.3
- X
- XMAN10 = infom.0 m1to0.0 minfo.0 mplay.0 mrecord.0 mseq.0 tclm.0
- XMAN30 = midiconfig.0 midifixtovar.0 midifree.0 midiget.0 midimake.0 \
- X midimerge.0 midiplay.0 midiplayable.0 midiput.0 midiread.0 \
- X midirecord.0 midirewind.0 midistop.0 miditiming.0 \
- X midivartofix.0 midiwrite.0 tclmversion.0 tclm_interface.0
- X
- X.SUFFIXES: .0 .1 .3
- X
- Xinstall-man-cooked: $(MAN10) $(MAN30)
- X $(INSTALL) $(MAN10) $(MANDIR)/$(MANSUB)$(MANEXT1)
- X $(INSTALL) $(MAN30) $(MANDIR)/$(MANSUB)$(MANEXT3)
- X
- Xinstall-man-raw:
- X $(INSTALL) $(MAN1) $(MANDIR)/$(MANSUB)$(MANEXT1)
- X $(INSTALL) $(MAN3) $(MANDIR)/$(MANSUB)$(MANEXT3)
- X
- Xclean:
- X rm -f $(MAN10) $(MAN30)
- X
- X.1.0:
- X $(NROFF) $< > $@
- X
- X.3.0:
- X $(NROFF) $< > $@
- END_OF_FILE
- if test 1607 -ne `wc -c <'tclm-1.0/doc/Makefile'`; then
- echo shar: \"'tclm-1.0/doc/Makefile'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/Makefile'
- fi
- if test -f 'tclm-1.0/doc/README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/README'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/README'\" \(719 characters\)
- sed "s/^X//" >'tclm-1.0/doc/README' <<'END_OF_FILE'
- X These man pages want to use the mdoc macro package. This is the
- Xnew Berkeley man page formatter. I'm not sure if most systems
- Xhave it these days, but it is included with groff.
- X Just process with *roff -mdoc.
- X You have two choices when installing, install-man-cooked (the
- Xdefault) and install-man-raw. install-man-cooked nroffs the
- Xman pages and then copies the formated files to their home.
- XThis is how BSD does it these days. install-man-raw option copies
- Xcopies the unformated files to their home directly. This is
- Xmore standard, but might cause some problems as I don't believe
- Xman(1) knows to process the files with the mdoc macro package.
- X In both cases, you should edit the Makefile and fix the paths.
- END_OF_FILE
- if test 719 -ne `wc -c <'tclm-1.0/doc/README'`; then
- echo shar: \"'tclm-1.0/doc/README'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/README'
- fi
- if test -f 'tclm-1.0/doc/infom.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/infom.1'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/infom.1'\" \(785 characters\)
- sed "s/^X//" >'tclm-1.0/doc/infom.1' <<'END_OF_FILE'
- X.Dt INFOM 1
- X.Os TCLM
- X.Dd May 4, 1993
- X.Sh NAME
- X.Nm infom
- X.Nd "a tclm script to convert minfo style output to a MIDI file"
- X.Sh SYNOPSIS
- X.Nm
- X.Op info_file Op midi_file
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm 1
- Xscript that converts
- X.Xr minfo 1
- Xstyle output to a Standard
- X.Tn MIDI
- XFile.
- XThis allows one to use
- X.Xr minfo 1
- Xto dump a
- X.Tn MIDI
- Xfile in a form
- Xthat can be edited using standard
- Xutilities like
- X.Xr vi 1 ,
- X.Xr sed 1
- Xor
- X.Xr awk 1 .
- X.Nm
- Xcan then be used to re-create
- Xa
- X.Tn MIDI
- Xfile from the modified
- X.Xr minfo 1
- Xoutput.
- X.Pp
- XIf
- X.Ar midi_file
- Xis not specified on the command
- Xline,
- X.Em stdout
- Xis used.
- XIf
- X.Ar info_file
- Xis not specified as well,
- X.Em stdin
- Xis used.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr minfo 1 ,
- X.Xr vi 1 ,
- X.Xr sed 1 ,
- X.Xr awk 1
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 785 -ne `wc -c <'tclm-1.0/doc/infom.1'`; then
- echo shar: \"'tclm-1.0/doc/infom.1'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/infom.1'
- fi
- if test -f 'tclm-1.0/doc/midiconfig.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/midiconfig.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/midiconfig.3'\" \(1680 characters\)
- sed "s/^X//" >'tclm-1.0/doc/midiconfig.3' <<'END_OF_FILE'
- X.Dt MIDICONFIG 3
- X.Os TCLM
- X.Dd Jan 10, 1993
- X.Sh NAME
- X.Nm midiconfig
- X.Nd "tclm command to get or modify the configuration values of a Standard MIDI File"
- X.Sh SYNOPSIS
- X.Nm
- X.Ar mfileId
- X.Ar {format | division | tracks}
- X.Op value
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm 1
- Xcommand that
- Xgets or modifies the configurations
- Xvalues of
- Xa Standard
- X.Tn MIDI
- XFile.
- X.Pp
- X.Nm
- Xtakes three or four arguments.
- XThe first is a tclm Standard
- X.Tn MIDI
- XFile
- Xdescriptor as
- Xreturned by
- X.Xr midiread 3 ,
- Xor
- X.Xr midimake 3 .
- X.Pp
- XThe second argument specifies which
- Xconfiguration value to manipulate.
- XIt should be either
- X.Ar format ,
- X.Ar division
- Xor
- X.Ar tracks .
- XThe options work as follows:
- X.Bl -tag -width "division" -offset indent
- X.It Nm format
- XThis option
- Xallows you to get or change the
- Xformat value of the Standard
- X.Tn MIDI
- XFile,
- Xand should be either 0, 1 or 2.
- XYou cannot use format 0 if the file contains
- Xmore than one track.
- X.It Nm division
- XThis option allows you to get or set
- Xthe timing for the file in units
- Xper beat.
- X.It Nm tracks
- XThis option
- Xallows you to get or change
- Xthe number of tracks in the file.
- XThis is how you create tracks in an empty
- Xfile generated by
- X.Xr midimake 3 .
- XYou cannot specify more than one track
- Xif the
- X.Tn MIDI
- Xfile is format 0.
- X.El
- X.Pp
- XThe final optional argument specifies
- Xthat the configuration value should be
- Xchanged and contains the new value.
- XWithout this argument,
- X.Nm
- Xreturns the current setting for the
- Xspecified value.
- X.Sh RETURN VALUES
- X.Nm
- Xreturns
- Xthe current setting of the specified
- Xvalue if the forth argument is missing,
- Xotherwise it returns nothing.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midiread 3 ,
- X.Xr midimake 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 1680 -ne `wc -c <'tclm-1.0/doc/midiconfig.3'`; then
- echo shar: \"'tclm-1.0/doc/midiconfig.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/midiconfig.3'
- fi
- if test -f 'tclm-1.0/doc/midifixtovar.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/midifixtovar.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/midifixtovar.3'\" \(802 characters\)
- sed "s/^X//" >'tclm-1.0/doc/midifixtovar.3' <<'END_OF_FILE'
- X.Dt MIDIFIXTOVAR 3
- X.Os TCLM
- X.Dd Jan 10, 1993
- X.Sh NAME
- X.Nm midifixtovar
- X.Nd "tclm command that converts an integer value to a variable length value"
- X.Sh SYNOPSIS
- X.Nm
- X.Ar value
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm 3
- Xcommand that
- Xconverts an integer value to a Standard
- X.Tn MIDI
- XFile
- Xvariable length value.
- XThis command takes only one argument, which is
- Xthe value to be converted.
- XThe value should be representable in a four byte
- Xinteger value (typically a long).
- X.Pp
- XThe value of this command has decreased
- Xsince release 0.1 and it may disappear
- Xin the future.
- X.Sh RETURN VALUES
- X.Nm
- Xreturns a list of bytes representing the
- Xspecified value in variable length form.
- XThe individual bytes are in hex form
- X(0x??).
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midivartofix 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 802 -ne `wc -c <'tclm-1.0/doc/midifixtovar.3'`; then
- echo shar: \"'tclm-1.0/doc/midifixtovar.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/midifixtovar.3'
- fi
- if test -f 'tclm-1.0/doc/midimake.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/midimake.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/midimake.3'\" \(796 characters\)
- sed "s/^X//" >'tclm-1.0/doc/midimake.3' <<'END_OF_FILE'
- X.Dt MIDIMAKE 3
- X.Os TCLM
- X.Dd Jan 10, 1993
- X.Sh NAME
- X.Nm midimake
- X.Nd "tclm command to create an empty Standard MIDI File"
- X.Sh SYNOPSIS
- X.Nm
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm 1
- Xcommand that creates an empty Standard
- X.Tn MIDI
- XFile for
- Xuse by other
- X.Tn MIDI
- Xspecific tclm commands.
- XBy default the Standard
- X.Tn MIDI
- XFile is created with zero
- Xtracks allocated, the format is type one and the division
- Xis 120.
- XThese defaults can then be changed with
- Xthe
- X.Xr midiconfig 3
- Xcommand.
- X.Pp
- XSince
- X.Nm
- Xallocates space for the Standard
- X.Tn MIDI
- XFile,
- X.Xr midifree 3
- Xshould be used
- Xwhen the file is no longer needed.
- X.Sh RETURN VALUES
- X.Nm
- Xreturns a
- X.Tn MIDI
- Xfile
- X.Tn ID
- Xfor use by other
- X.Tn MIDI
- Xspecific
- Xtclm commands.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midiconfig 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 796 -ne `wc -c <'tclm-1.0/doc/midimake.3'`; then
- echo shar: \"'tclm-1.0/doc/midimake.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/midimake.3'
- fi
- if test -f 'tclm-1.0/doc/midimerge.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/midimerge.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/midimerge.3'\" \(2182 characters\)
- sed "s/^X//" >'tclm-1.0/doc/midimerge.3' <<'END_OF_FILE'
- X.Dt MIDIMERGE 3
- X.Os TCLM
- X.Dd Jan 10, 1993
- X.Sh NAME
- X.Nm midimerge
- X.Nd "tclm command to merge multiple tracks of a Standard MIDI File to one track"
- X.Sh SYNOPSIS
- X.Nm
- X.Pf { Ar outmfileId outtrack Ns }
- X.Pf { Pf { Ar inmfile
- X.Ar intrack tscalar Ns }
- X.Pf { Ar inmfile intrack tscalar Ns }
- X.Ar ... Ns }
- X.Ar delta
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm 1
- Xcommand that
- Xmerges one or more input tracks to a single output track
- Xof a Standard
- X.Tn MIDI
- XFile.
- XThe first option is a list that designates output track.
- XThe first element of that list is the Standard
- X.Tn MIDI
- XFile
- X.Tn ID ,
- Xwhile the
- Xsecond element is the track number of that
- X.Tn MIDI
- Xfile.
- X.Pp
- XThe second argument is a list containing the specifications
- Xfor the inputs tracks.
- XEach input track specification is itself a list similar
- Xto the output track designator.
- XThe first element of an input track specification is
- Xthe Standard
- X.Tn MIDI
- XFile
- X.Tn ID
- Xand the second
- Xthe the track number.
- XThe third element is a time scalar.
- XSince tracks from
- X.Tn MIDI
- Xfiles with different
- Xdivisions might be combined, the time scalar can be
- Xused to convert the timings to the same base.
- X.Nm
- Xwill divide each delta time between events in the
- X.Tn MIDI
- Xfile by the tscalar value.
- XThus, a tscalar of 2 would be the same as halving the
- Xdivision for a track.
- X.Pp
- XThe third and final argument to
- X.Nm
- Xis a initial time delta.
- X.Nm
- Xoffsets the first event it merges by
- Xthis value.
- XIt is useful in maintaining the timings between
- Xexisting events in the output track and
- Xthe new events added by the merge.
- X.Pp
- XAll Standard
- X.Tn MIDI
- XFile
- X.Tn ID
- Xshould be
- Xvalues returned by either
- X.Xr midiread 3 ,
- Xor
- X.Xr midimake 3 .
- X.Pp
- X.Nm
- Xstrips all
- X.Dq metaeot
- Xevents in encounters in the input
- Xtracks.
- XThis is to keep the output track from
- Xbeing terminated early and also to
- Xmake it easier to add further events
- Xto the output track.
- XTo maintain timing, the delta time value
- Xto what would have been the last
- X.Dq metaeot
- Xevent is returned by
- X.Nm Ns .
- X.Sh RETURN VALUES
- X.Nm
- Xreturns the delta time to
- Xwhat would have been the final
- X.Dq metaeot
- Xevent in the input tracks.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midiread 3 ,
- X.Xr midimake 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 2182 -ne `wc -c <'tclm-1.0/doc/midimerge.3'`; then
- echo shar: \"'tclm-1.0/doc/midimerge.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/midimerge.3'
- fi
- if test -f 'tclm-1.0/doc/midiplay.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/midiplay.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/midiplay.3'\" \(1875 characters\)
- sed "s/^X//" >'tclm-1.0/doc/midiplay.3' <<'END_OF_FILE'
- X.Dt MIDIPLAY 3
- X.Os TCLM
- X.Dd Jan 10, 1993
- X.Sh NAME
- X.Nm midiplay
- X.Nd "tclm command to play a Standard MIDI File"
- X.Sh SYNOPSIS
- X.Nm
- X.Op bg | background
- X.Op repeat
- X.Op tracks Ar track_list
- X.Op reltempo Ar tempo_scalar
- X.Ar mfileId
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm 3
- Xcommand that plays a Standard
- X.Tn MIDI
- XFile through
- Xa
- X.Tn MIDI
- Xdevice.
- X.Pp
- XIn the most basic form
- X.Nm
- Xtakes no options and only one argument specifying the
- Xfile to be played.
- XThis argument should be a
- X.Tn MIDI
- Xfile
- X.Tn ID
- Xas returned by
- X.Xr midiread 3
- Xor
- X.Xr midimake 3 .
- X.Pp
- XIn the other forms,
- X.Nm
- Xcan take various options to control how
- Xthe file is played.
- XThe usage of the various options is as follows:
- X.Bl -tag -width "bg or background" -offset indent
- X.It Nm bg No or Nm background
- XThese options make
- X.Nm
- Xfork and play the file in a
- Xseparate process.
- XThe call returns immediately.
- XWithout this option
- X.Nm
- Xwill block until the file is
- Xfinished playing.
- X.It Nm repeat
- XThis option causes
- X.Nm
- Xto play the file continuously,
- Xrepeating from the beginning of the file
- Xwhen the end is reached.
- X.It Nm reltempo
- XThis option
- Xtakes one argument which specifies a value
- Xused to scale
- Xany tempos found in the file.
- XThis value should be a float and
- Xshould be in the range 0
- Xto 4 for
- X.Tn MPU-401
- Xcompatible devices.
- X.It Nm tracks
- XThis option takes an argument
- Xconsisting of a list of track numbers.
- XThe list should be enclosed by curly braces
- Xor double quotes.
- XWith this option, only those tracks specified
- Xin the track
- Xlist will be played.
- XTrack 0 is the first track.
- X.El
- X.Sh RETURN VALUES
- X.Nm
- Xreturns 0
- Xwhen called without the
- X.Em bg
- Xoption, and
- Xthe process
- X.Tn ID
- Xof forked process
- Xwhen called with the
- X.Em bg
- Xoption.
- XThis process
- X.Tn ID
- Xcan then be used with the
- X.Xr midistop 3
- Xtclm function.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midiread 3 ,
- X.Xr midimake 3 ,
- X.Xr midistop 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 1875 -ne `wc -c <'tclm-1.0/doc/midiplay.3'`; then
- echo shar: \"'tclm-1.0/doc/midiplay.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/midiplay.3'
- fi
- if test -f 'tclm-1.0/doc/midiplayable.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/midiplayable.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/midiplayable.3'\" \(549 characters\)
- sed "s/^X//" >'tclm-1.0/doc/midiplayable.3' <<'END_OF_FILE'
- X.Dt MIDIPLAYABLE 3
- X.Os TCLM
- X.Dd April 12, 1993
- X.Sh NAME
- X.Nm midiplayable
- X.Nd "tclm command to determine if a MIDI device interface is supported"
- X.Sh SYNOPSIS
- X.Nm
- X.Sh DESCRIPTION
- X.Nm
- Xis a simple
- X.Xr tclm 1
- Xcommand that returns 1 if the device
- Xspecific commands,
- X.Xr midiplay 3
- Xand
- X.Xr midistop 3 ,
- Xare available for use.
- X.Sh RETURN VALUES
- X.Nm
- Xreturns 1 if the commands
- X.Xr midiplay 3
- Xand
- X.Xr midistop 3
- Xare available
- Xand 0 if they are not.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midiplay 3 ,
- X.Xr midistop 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 549 -ne `wc -c <'tclm-1.0/doc/midiplayable.3'`; then
- echo shar: \"'tclm-1.0/doc/midiplayable.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/midiplayable.3'
- fi
- if test -f 'tclm-1.0/doc/midiread.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/midiread.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/midiread.3'\" \(967 characters\)
- sed "s/^X//" >'tclm-1.0/doc/midiread.3' <<'END_OF_FILE'
- X.Dt MIDIREAD 3 TCLM
- X.Os TCLM
- X.Dd Jan 10, 1993
- X.Sh NAME
- X.Nm midiread
- X.Nd "tclm command to read a Standard MIDI File"
- X.Sh SYNOPSIS
- X.Nm
- X.Ar fileId
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm
- Xcommand that reads a Standard
- X.Tn MIDI
- XFile for
- Xlater use by other
- X.Tn MIDI
- Xspecific tclm commands.
- X.Pp
- X.Nm
- Xtakes one argument that specifies a file
- Xdescriptor from which to read the Standard
- X.Tn MIDI
- XFile.
- XThis argument should be a value returned by
- Xthe
- X.Xr open 3
- Xtcl command, or
- X.Dq stdin .
- X.Pp
- XSince
- X.Nm
- Xallocates space for the Standard
- X.Tn MIDI
- XFile,
- X.Xr midifree 3
- Xshould be used
- Xwhen the file is no longer needed.
- X.Sh RETURN VALUES
- X.Nm
- Xreturns a
- X.Tn MIDI
- Xfile
- X.Tn ID
- Xfor use by other
- X.Tn MIDI
- Xspecific
- Xtclm commands.
- XIf there is no data to be read,
- X.Nm
- Xforces an error and returns
- X.Dq EOF.
- XThis facilitates determining
- Xwhen there are no more files
- Xto be read from
- X.Em stdin .
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr open 3 ,
- X.Xr midifree 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 967 -ne `wc -c <'tclm-1.0/doc/midiread.3'`; then
- echo shar: \"'tclm-1.0/doc/midiread.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/midiread.3'
- fi
- if test -f 'tclm-1.0/doc/midirecord.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/midirecord.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/midirecord.3'\" \(2187 characters\)
- sed "s/^X//" >'tclm-1.0/doc/midirecord.3' <<'END_OF_FILE'
- X.Dt MIDIRECORD 3
- X.Os TCLM
- X.Dd April 20, 1993
- X.Sh NAME
- X.Nm midirecord
- X.Nd "tclm command to record a Standard MIDI File"
- X.Sh SYNOPSIS
- X.Nm
- X.Op bg | background
- X.Oo play Ar play_mfileId\
- X.Op repeat
- X.Op tracks Ar track_list
- X.Op reltempo Ar tempo_scalar
- X.Oc
- X.Ar record_mfileId
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm 1
- Xcommand that records a Standard
- X.Tn MIDI
- XFile
- Xfrom a
- X.Tn MIDI
- Xdevice.
- XIt also optionally plays a
- X.Tn MIDI
- Xfile while
- Xrecording.
- X.Pp
- X.Nm
- Xshould be specified with the
- X.Em background
- Xoption, a play file
- Xor with both.
- XWithout one of the above, there is no
- Xway to properly terminate the call.
- XIf a play file is specified, then
- X.Nm
- Xrecords into
- X.Em record_mfileId
- Xuntil
- X.Em play_mfileId
- Xis finished playing.
- X.Em record_mfileId
- Xcan then be used normally.
- X.Pp
- XIf the
- X.Em background
- Xoption is specified,
- Xthen
- X.Nm
- Xwill put itself into the background while
- Xit is recording, and optionally playing.
- XThe recording can then be stopped by
- Xissuing the
- X.Xr midistop 3
- Xcommand with
- X.Em record_mfileId .
- XAfter the
- X.Xr midistop 3 ,
- X.Nm
- Xtransfers the filled record file to
- Xthe file specified as an argument to
- X.Xr midistop 3 .
- XOnly at this point does
- X.Em record_mfileId
- Xbecome valid.
- X.Pp
- XThe options are as follows:
- X.Bl -tag -width "reltempo" -offset indent
- X.It Nm repeat
- XThis option
- Xcauses the play file
- Xto be repeated until the
- X.Xr midistop 3
- Xcommand is issued.
- XIt only makes sense for background recording.
- X.It Nm tracks
- XThis
- Xoption is the same the
- Xoption found in
- X.Xr midiplay 3 .
- XIt is a list of specific tracks from
- Xthe play file to be played,
- Xinstead of the default which is to
- Xplay all the tracks.
- X.It Nm reltempo
- XThis
- Xoption multiplies the tempo
- Xof the play file by
- X.Em tempo_scalar
- Xto make the play file play at a different speed.
- X.El
- X.Pp
- X.Em record_mfileId
- Xshould be a value returned by
- X.Xr midimake 3
- Xor
- X.Xr midiread 3 .
- X.Sh RETURN VALUES
- X.Nm
- Xreturns 0
- Xwhen called without the
- X.Em bg
- Xoption, and
- Xthe process
- X.Tn ID
- Xof forked process
- Xwhen called with the
- X.Em bg
- Xoption.
- XThis process
- X.Tn ID
- Xcan then be used with the
- X.Xr midistop 3
- Xtclm function.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midiplay 3 ,
- X.Xr midiread 3 ,
- X.Xr midimake 3 ,
- X.Xr midistop 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 2187 -ne `wc -c <'tclm-1.0/doc/midirecord.3'`; then
- echo shar: \"'tclm-1.0/doc/midirecord.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/midirecord.3'
- fi
- if test -f 'tclm-1.0/doc/midirewind.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/midirewind.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/midirewind.3'\" \(1011 characters\)
- sed "s/^X//" >'tclm-1.0/doc/midirewind.3' <<'END_OF_FILE'
- X.Dt MIDIREWIND 3
- X.Os TCLM
- X.Dd Jan 10, 1993
- X.Sh NAME
- X.Nm midirewind
- X.Nd "tclm command to reset a Standard MIDI File to the beginning"
- X.Sh SYNOPSIS
- X.Nm
- X.Ar mfileId
- X.Op track_list
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm 1
- Xcommand that
- Xsets the internal place keeper of
- Xspecified tracks of
- Xa Standard
- X.Tn MIDI
- XFile to the beginning.
- XThe next
- X.Xr midiget 3
- Xon one of the specified tracks
- Xwill return an event from
- Xthe start of that track regardless
- Xof the location of any previous
- X.Xr midiget 3
- Xcalls.
- X.Pp
- X.Nm
- Xtakes
- Xone argument specifying a
- XStandard
- X.Tn MIDI
- XFile descriptor as returned
- Xby
- X.Xr midiread 3
- Xor
- X.Xr midimake 3 ,
- Xand one optional
- Xargument specifying a list
- Xof tracks to be rewound.
- XThe track list should be in tcl
- Xform and enclosed in either double-quotes
- Xor curly braces.
- XIf a track list is not specified,
- Xall tracks will be rewound.
- X.Sh RETURN VALUES
- X.Nm
- Xdoes not return anything.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midiread 3 ,
- X.Xr midimake 3 ,
- X.Xr midiget 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 1011 -ne `wc -c <'tclm-1.0/doc/midirewind.3'`; then
- echo shar: \"'tclm-1.0/doc/midirewind.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/midirewind.3'
- fi
- if test -f 'tclm-1.0/doc/midistop.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/midistop.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/midistop.3'\" \(1181 characters\)
- sed "s/^X//" >'tclm-1.0/doc/midistop.3' <<'END_OF_FILE'
- X.Dt MIDISTOP 3
- X.Os TCLM
- X.Dd April 20, 1993
- X.Sh NAME
- X.Nm midistop
- X.Nd "tclm command to stop playing or recording a MIDI file"
- X.Sh SYNOPSIS
- X.Nm
- X.Ar process_ID
- X.Op record_fileId
- X.Sh DESCRIPTION
- X.Nm
- Xis a tclm command that stops a Standard
- X.Tn MIDI
- XFile
- Xplaying in the background.
- X.Pp
- X.Nm
- Xtakes one argument that specifies the process ID
- Xof the process playing the Standard
- X.Tn MIDI
- XFile.
- XThis value can be obtained by using the return code
- Xof the
- X.Xr midiplay 3
- Xor
- X.Xr midirecord 3
- Xcommands.
- X.Pp
- X.Nm
- Xalso takes an optional argument for use
- Xin stopping files being recorded in the background.
- XIf
- X.Em record_fileId
- Xis specified and
- X.Em process_ID
- Xis the process number of a
- X.Xr midirecord 3
- Xcommand, then
- X.Nm
- Xwill put the data from the
- Xrecording into
- X.Em record_fileId
- Xafter it has stopped the recording.
- X.Em record_fileId
- Xcan then be used normally.
- X.Pp
- X.Nm
- Xwill only work on files being played by executing
- X.Xr midiplay 3
- Xor
- X.Xr midirecord 3
- Xwith the
- X.Em bg
- Xoption.
- X.Sh RETURN VALUES
- X.Nm
- Xreturns 1
- Xif it could successfully
- Xstop playing the file.
- XIt returns 0 if the process
- XID does not exist.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midiplay 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 1181 -ne `wc -c <'tclm-1.0/doc/midistop.3'`; then
- echo shar: \"'tclm-1.0/doc/midistop.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/midistop.3'
- fi
- if test -f 'tclm-1.0/doc/miditiming.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/miditiming.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/miditiming.3'\" \(947 characters\)
- sed "s/^X//" >'tclm-1.0/doc/miditiming.3' <<'END_OF_FILE'
- X.Dt MIDITIMING 3
- X.Os TCLM
- X.Dd Jan 10, 1993
- X.Sh NAME
- X.Nm miditiming
- X.Nd "tclm command that gets the timing portion of a Standard MIDI File event"
- X.Sh SYNOPSIS
- X.Nm
- X.Ar event
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm 1
- Xcommand that
- Xreturns the timing portion of a Standard
- X.Tn MIDI
- XFile event.
- XThis command takes only one argument;
- Xa Standard
- X.Tn MIDI
- XFile event.
- XThis argument should be
- Xin tcl list form,
- Xwith each value in the list being
- Xone byte of the event.
- XThe event should be surrounded by
- Xeither double-quotes or curly braces.
- X.Pp
- XThis call only exists for backwards compatibility
- Xwith release 0.1.
- XIt will soon disappear for good.
- X.Sh RETURN VALUES
- X.Nm
- Xreturns the timing portion of the specified
- Xevent.
- XSince Standard
- X.Tn MIDI
- XFile events are in
- Xvariable length form, one to four bytes
- Xmay be returned.
- XThe individual bytes will be in hex notation
- X(0x??).
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midiget 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 947 -ne `wc -c <'tclm-1.0/doc/miditiming.3'`; then
- echo shar: \"'tclm-1.0/doc/miditiming.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/miditiming.3'
- fi
- if test -f 'tclm-1.0/doc/midivartofix.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/midivartofix.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/midivartofix.3'\" \(1215 characters\)
- sed "s/^X//" >'tclm-1.0/doc/midivartofix.3' <<'END_OF_FILE'
- X.Dt MIDIVARTOFIX 3
- X.Os TCLM
- X.Dd Jan 10, 1993
- X.Sh NAME
- X.Nm midivartofix
- X.Nd "tclm command that converts a variable length value to a fixed length value"
- X.Sh SYNOPSIS
- X.Nm
- X.Ar event
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm 1
- Xcommand that
- Xconverts a variable length value specified in a Standard
- X.Tn MIDI
- XFile
- Xevent to a fixed length value.
- XThis command takes only one argument;
- Xa series of bytes forming a
- XStandard
- X.Tn MIDI
- XFile variable length value.
- XAdditional bytes are ignored so complete events can be
- Xpassed to
- X.Nm
- Xto convert the timing portion of the event directly to
- Xa fixed length value.
- XThis argument should be
- Xin tcl list form,
- Xwith each value in the list being
- Xone byte of the event.
- XThe event should be surrounded by
- Xeither double-quotes or curly braces.
- X.Pp
- XThe value of this command has decreased since
- Xrelease 0.1 and it may disappear in the future.
- X.Sh RETURN VALUES
- X.Nm
- Xreturns a four byte integer (typically a long in C)
- Xrepresentation of a Standard
- X.Tn MIDI
- XFile
- Xvariable length value.
- XThough a variable length value could represent
- Xa value that would not fit in a long, this
- Xnever happens in actual usage.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midifixtovar 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 1215 -ne `wc -c <'tclm-1.0/doc/midivartofix.3'`; then
- echo shar: \"'tclm-1.0/doc/midivartofix.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/midivartofix.3'
- fi
- if test -f 'tclm-1.0/doc/midiwrite.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/midiwrite.3'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/midiwrite.3'\" \(692 characters\)
- sed "s/^X//" >'tclm-1.0/doc/midiwrite.3' <<'END_OF_FILE'
- X.Dt MIDIWRITE 3
- X.Os TCLM
- X.Dd Jan 10, 1993
- X.Sh NAME
- X.Nm midiwrite
- X.Nd "tclm command to write a Standard MIDI File"
- X.Sh SYNOPSIS
- X.Nm
- X.Ar mfileId
- X.Ar fileId
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm 1
- Xcommand that writes Standard
- X.Tn MIDI
- XFile to
- Xan open tcl file descriptor.
- X.Pp
- XThis command
- Xtakes two arguments.
- XThe first is a tclm Standard
- X.Tn MIDI
- XFile descriptor
- Xas returned by
- X.Xr midiread 3
- Xor
- X.Xr midimake 3 ,
- Xwhile the second is a tcl file descriptor as
- Xreturned by the
- X.Xr open 3
- Xtcl command
- Xor
- X.Dq stdout
- Xor
- X.Dq stderr .
- X.Sh RETURN VALUES
- X.Nm
- Xdoes not return anything.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr open 3 ,
- X.Xr midiread 3 ,
- X.Xr midimake 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 692 -ne `wc -c <'tclm-1.0/doc/midiwrite.3'`; then
- echo shar: \"'tclm-1.0/doc/midiwrite.3'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/midiwrite.3'
- fi
- if test -f 'tclm-1.0/doc/mplay.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/mplay.1'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/mplay.1'\" \(1395 characters\)
- sed "s/^X//" >'tclm-1.0/doc/mplay.1' <<'END_OF_FILE'
- X.Dt MPLAY 1
- X.Os TCLM
- X.Dd Jan 10, 1993
- X.Sh NAME
- X.Nm mplay
- X.Nd "a tclm script to play Standard MIDI Files"
- X.Sh SYNOPSIS
- X.Nm
- X.Op Fl repeat
- X.Op Fl tracks Ar tracks
- X.Op Fl speed Ar speed
- X.Op file ...
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Xr tclm 1
- Xscript that plays Standard
- X.Tn MIDI
- XFiles.
- XMultiple files may be specified on
- Xthe command line, or files can be
- Xread from
- X.Em stdin .
- XThe options are as follows:
- X.Bl -tag -width Fl repeat -offset indent
- X.It Fl repeat
- XPlay the first file repeatedly.
- XThe playing will continue until the
- Xprocess is killed.
- X.It Fl tracks
- XSpecifies a list of tracks to be played
- Xinstead of the default, which is to play
- Xall tracks.
- XThis option has an argument that lists
- Xthe tracks.
- XThe argument needs to be treated as one argument
- Xinstead of multiple values, and thus should
- Xbe enclosed in double or single quotes.
- X.It Fl speed
- XSpecifies a tempo modifier.
- XThe argument to this option is a float
- Xvalue that acts as
- Xa multiplier for the tempo values found
- Xin the Standard
- X.Tn MIDI
- XFiles.
- X.Tn MPU-401
- Xcompatible devices only use the range
- X0 to 4.
- X.El
- X.Pp
- XSince
- X.Nm
- Xmakes use of the
- X.Xr midiplay 3
- X.Xr tclm 1
- Xcommand,
- Xthis program will only work
- Xif
- X.Xr tclm 1
- Xwas compiled with a device
- Xinterface.
- XThis can be determined at run-time
- Xby using the
- X.Xr midiplayable 3
- Xcommand.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midiplayable 3 ,
- X.Xr midiplay 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 1395 -ne `wc -c <'tclm-1.0/doc/mplay.1'`; then
- echo shar: \"'tclm-1.0/doc/mplay.1'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/mplay.1'
- fi
- if test -f 'tclm-1.0/doc/mrecord.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/mrecord.1'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/mrecord.1'\" \(1894 characters\)
- sed "s/^X//" >'tclm-1.0/doc/mrecord.1' <<'END_OF_FILE'
- X.Dt MRECORD 1
- X.Os TCLM
- X.Dd May 5, 1993
- X.Sh NAME
- X.Nm mrecord
- X.Nd "a tclm script to record a Standard MIDI File"
- X.Sh SYNOPSIS
- X.Nm
- X.Oo
- X.Fl pfile Ar play_file
- X.Op Fl repeat
- X.Op Fl tracks Ar tracks
- X.Op Fl speed Ar speed
- X.Oc
- Xrecord_file
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- X.Nm tcl
- Xscript that records a Standard
- X.Tn MIDI
- XFile.
- XIt will also optionally play a
- X.Tn MIDI
- Xfile
- Xwhile recording.
- XThe options are as follows:
- X.Bl -tag -width Fl repeat -offset indent
- X.It Fl repeat
- XThis option is only valid if a play
- Xfile is specified.
- XWhile recording it will repeat
- Xthe play file until the return
- Xkey is pressed, at which point
- Xrecording will end.
- X.It Fl tracks
- XThis option is only valid if a play
- Xfile is specified.
- XThis option can be used to specify
- Xa list of tracks in the play file
- Xto use.
- XBy default all tracks in the play file
- Xare used.
- XThe argument should be a list enclosed
- Xby double or single quotes.
- X.It Fl speed
- XThis option is only valid if a play
- Xfile is specified.
- XIt specifies a tempo modifier that
- Xis used to multiply any tempos found
- Xin the play file.
- XFor
- X.Tn MPU-401
- Xcompatible devices
- Xit should be a floating point value
- Xin the range 0 to 4.
- X.It Fl pfile
- XThis option specifies a file to play
- Xwhile recording.
- XWhen the file is finished playing,
- Xrecording automatically stops.
- X.El
- X.Pp
- XIf a play file is not specified, recording
- Xwill continue until the return key is
- Xpressed.
- XIf a play file is specified, recording
- Xonly lasts as long as the play file is
- Xstill playing unless
- X.Fl repeat
- Xis specified in which case the return key
- Xshould be pressed to end recording.
- X.Pp
- XSince
- X.Nm
- Xmakes use of the
- X.Xr midirecord 3
- X.Xr tclm 1
- Xcommand,
- Xthis program will only work
- Xif
- X.Xr tclm 1
- Xwas compiled with a device
- Xinterface.
- XThis can be determined at run-time
- Xby using the
- X.Xr midiplayable 3
- Xcommand.
- X.Sh SEE ALSO
- X.Xr tclm 1 ,
- X.Xr midiplayable 3 ,
- X.Xr midirecord 3
- X.Sh AUTHORS
- XMike Durian - durian@advtech.uswest.com
- END_OF_FILE
- if test 1894 -ne `wc -c <'tclm-1.0/doc/mrecord.1'`; then
- echo shar: \"'tclm-1.0/doc/mrecord.1'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/mrecord.1'
- fi
- if test -f 'tclm-1.0/doc/tclm.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/doc/tclm.1'\"
- else
- echo shar: Extracting \"'tclm-1.0/doc/tclm.1'\" \(3089 characters\)
- sed "s/^X//" >'tclm-1.0/doc/tclm.1' <<'END_OF_FILE'
- X.Dt TCLM 1
- X.Os TCLM
- X.Dd Jan 10, 1993
- X.Sh NAME
- X.Nm tclm
- X.Nd "a tcl interpreter with MIDI extensions"
- X.Sh SYNOPSIS
- X.Nm
- X.Op Fl f Op Ar filename
- X.Sh DESCRIPTION
- X.Nm
- Xis a
- Xtcl
- Xinterpreter with
- X.Tn MIDI
- Xextensions allowing
- Xit to manipulate Standard
- X.Tn MIDI
- XFiles and in some
- Xcases play and record Standard
- X.Tn MIDI
- XFiles.
- XTcl
- Xis a Tool Command Language
- Xwritten by John Ousterhout.
- X.Pp
- X.Nm
- Xhas only one option:
- X.Bl -tag -width Fl f -offset indent
- X.It Fl f
- XThis option has one optional argument
- Xthat specifies the name of a file
- Xcontaining tclm commands.
- XThese commands are executed
- Xin place of reading from stdin.
- XWithout the optional argument
- Xcommands are read from
- X.Em stdin .
- X.El
- XWithout the
- X.Fl f
- Xoption
- X.Nm
- Xdisplays a
- X.Dq tclm:
- Xprompt and reads
- Xcommands from
- X.Em stdin .
- X.Ss TCLM EXTENSIONS
- X.Nm
- Xhas a few extensions which
- Xaid in the manipulation of
- XStandard
- X.Tn MIDI
- XFiles
- X.No ( Tn SMF Ns No ).
- XThey are:
- X.Bl -tag -width "midivartofix" -offset indent
- X.It Nm midiconfig
- XChanges configuration values in a
- X.Tn SMF .
- X.It Nm midifixtovar
- XConverts fixed length integers to
- X.Tn SMF
- Xvariable
- Xlength values.
- X.It Nm midifree
- XFrees the space used by
- X.Tn SMF Ns No 's.
- X.It Nm midiget
- XGets one event from a track in a
- X.Tn SMF .
- X.It Nm midimake
- XCreates an empty
- X.Tn SMF .
- X.It Nm midimerge
- XMerges multiple
- X.Tn SMF
- Xtracks
- Xto one track.
- X.It Nm midiplayable
- XChecks to see if a
- X.Nm
- Xto
- X.Tn MIDI
- Xdevice
- Xinterface was included.
- XIf so,
- X.Tn SMF Ns No 's
- Xcan be
- Xplayed and recorded.
- X.It Nm midiput
- XAppends an event to a track in a
- X.Tn SMF .
- X.It Nm midiread
- XReads a
- X.Tn SMF
- Xfrom an open file descriptor.
- X.It Nm midirewind
- XResets a
- X.Tn SMF
- Xto its beginning.
- X.It Nm miditiming
- XGets the timing portion of a
- X.Tn SMF
- Xevent.
- XThis only exists for backward compatibility
- Xwith 0.1 and will soon disappear.
- X.It Nm midivartofix
- XConverts a
- X.Tn SMF
- Xvariable length value to a fixed
- Xlength integer.
- X.It Nm midiwrite
- XWrites a
- X.Tn SMF
- Xto an open file descriptor.
- X.It Nm tclmversion
- XReports the
- X.Tn TCLM
- Xversion number.
- X.El
- X.Pp
- XThere are also three commands available for playing
- Xand recording
- X.Tn SMF Ns No s.
- XSince they are dependent on
- X.Tn MIDI
- Xhardware
- Xthese commands will only be available if a
- X.Nm
- Xto driver interface was written and compiled into
- X.Nm Ns .
- XThe
- X.Xr midiplayable 3
- Xcommand
- Xcan be used to check for these extensions.
- XThese commands are:
- X.Bl -tag -width midirecord -offset indent
- X.It Nm midiplay
- XPlay an
- X.Tn SMF .
- X.It Nm midirecord
- XRecord to an
- X.Tn SMF .
- X.It Nm midistop
- XStop an
- X.Tn SMF
- Xthat is currently playing or recording
- Xin the background.
- XIf the process was recording,
- X.Xr midistop 3
- Xcollects the recorded data.
- X.El
- X.Sh SEE ALSO
- X.Xr midiconfig 3 ,
- X.Xr midifixtovar 3 ,
- X.Xr midifree 3 ,
- X.Xr midiget 3 ,
- X.Xr midimake 3 ,
- X.Xr midimerge 3 ,
- X.Xr midiplay 3 ,
- X.Xr midiplayable 3 ,
- X.Xr midiput 3 ,
- X.Xr midiread 3 ,
- X.Xr midirecord 3 ,
- X.Xr midirewind 3 ,
- X.Xr midistop 3 ,
- X.Xr miditiming 3 ,
- X.Xr midivartofix 3 ,
- X.Xr midiwrite 3 ,
- X.Xr tclmversion 3
- X.Sh AUTHORS
- X.Bl -item -compact
- X.It
- XJohn Ousterhout - ouster@cs.berkeley.edu for the
- X.Tn TCL
- Xstuff
- X.It
- XMike Durian - durian@advtech.uswest.com for the
- X.Tn MIDI
- Xstuff
- X.El
- END_OF_FILE
- if test 3089 -ne `wc -c <'tclm-1.0/doc/tclm.1'`; then
- echo shar: \"'tclm-1.0/doc/tclm.1'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/doc/tclm.1'
- fi
- if test -f 'tclm-1.0/m1to0' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/m1to0'\"
- else
- echo shar: Extracting \"'tclm-1.0/m1to0'\" \(1268 characters\)
- sed "s/^X//" >'tclm-1.0/m1to0' <<'END_OF_FILE'
- X#!/usr/local/bin/tclm -f
- Xif {[string compare [lindex $argv 0] -f] == 0} {
- X set argc [expr {$argc - 2}]
- X set argv [lrange $argv 2 end]
- X}
- X
- Xif {$argc > 2} {
- X puts stderr "usage: m1to0 [infile [outfile]]"
- X exit 1
- X}
- Xset in_file stdin
- Xset out_file stdout
- Xif {$argc > 0} {
- X set in_file_name [lindex $argv 0]
- X if {[catch {open $in_file_name "r"} in_file]} {
- X puts stderr "Couldn't open $in_file_name: $in_file"
- X exit 1
- X }
- X if {$argc > 1} {
- X set out_file_name [lindex $argv 1]
- X if {[catch {open $out_file_name "w"} out_file]} {
- X puts stderr "Couldn't open $out_file_name: $out_file"
- X exit 1
- X }
- X }
- X}
- X
- Xif {[catch {midiread $in_file} in_mfile]} {
- X puts stderr "Couldn't read MIDI file: $in_mfile"
- X exit 1
- X}
- X
- Xset num_tracks [midiconfig $in_mfile tracks]
- X
- Xfor {set i 0} {$i < $num_tracks} {incr i} {
- X lappend track_list "$in_mfile $i 1"
- X}
- X
- Xset out_mfile [midimake]
- Xmidiconfig $out_mfile format 0
- Xmidiconfig $out_mfile tracks 1
- Xmidiconfig $out_mfile division [midiconfig $in_mfile division]
- X
- Xset delta [midimerge "$out_mfile 0" $track_list 0]
- Xmidiput $out_mfile 0 $delta metaeot
- X
- Xif {[catch {midiwrite $out_mfile $out_file} err]} {
- X puts stderr "Couldn't write format 0 MIDI file: $err"
- X exit 1
- X}
- Xmidifree $in_mfile
- Xmidifree $out_mfile
- Xclose $in_file
- Xclose $out_file
- Xexit 0
- END_OF_FILE
- if test 1268 -ne `wc -c <'tclm-1.0/m1to0'`; then
- echo shar: \"'tclm-1.0/m1to0'\" unpacked with wrong size!
- fi
- chmod +x 'tclm-1.0/m1to0'
- # end of 'tclm-1.0/m1to0'
- fi
- if test -f 'tclm-1.0/mlib/DEVICES' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/mlib/DEVICES'\"
- else
- echo shar: Extracting \"'tclm-1.0/mlib/DEVICES'\" \(1430 characters\)
- sed "s/^X//" >'tclm-1.0/mlib/DEVICES' <<'END_OF_FILE'
- X So you want to write an interface between tclm and your
- Xfavorite MIDI driver. I must first warn you of a few caveats.
- XThough I've tried to avoid it, I guessing that the interface
- Xhooks I've set up are geared towards MPU401 compatible
- Xdrivers. This wasn't done intentionally, it's just I don't
- Xknow anything about SoundBlasters or other cards and don't
- Xhave any idea how the interface is designed.
- X It is also possible that the device hooks a oriented at
- Xthe BSD/386 driver. Again I tried to avoid it, but it is
- Xthe only driver I am familiar with.
- X Well, enough warnings, this is what you have to do. Just
- Xcreate a file containing all the routines listed in mdevice.h
- Xand fill them in. Some assumptions were made when I decided
- Xto make this routines the interface points.
- X Assumption one is that the midi device is only one descriptor.
- XThis might seem like a basic assumption, but it was not the case
- Xwith the old BSD/386 MPU-401 driver. BTW, the old driver is no
- Xlong supported.
- X Assumption number two isn't too bad. I've assumed the device
- Xcan make use of the reltempo parameter to the init_midi_device
- Xroutine. If it can't, then just ignore it.
- X Ok, I think that's it, otherwise the routines should allow
- Xsome bit of flexibility in actual implementation. Here are
- Xthe routines, what they should do and their parameters.
- X See the tclm_interfaces(3) man page for information about
- Xthe routines you need to write.
- END_OF_FILE
- if test 1430 -ne `wc -c <'tclm-1.0/mlib/DEVICES'`; then
- echo shar: \"'tclm-1.0/mlib/DEVICES'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/mlib/DEVICES'
- fi
- if test -f 'tclm-1.0/mlib/mdevice.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/mlib/mdevice.h'\"
- else
- echo shar: Extracting \"'tclm-1.0/mlib/mdevice.h'\" \(2424 characters\)
- sed "s/^X//" >'tclm-1.0/mlib/mdevice.h' <<'END_OF_FILE'
- X/*-
- X * Copyright (c) 1993 Michael B. Durian. All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by Michael B. Durian.
- X * 4. The name of the the Author may be used to endorse or promote
- X * products derived from this software without specific prior written
- X * permission.
- X *
- X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X/*
- X * mdevice.h,v 1.5 1993/05/05 01:34:17 durian Exp
- X */
- X#ifndef MDEVICE_H
- X#define MDEVICE_H
- X
- Xtypedef enum {PLAY, RECORD, PLAYRECORD} PlayMode;
- X
- Xextern int play_tracks _ANSI_ARGS_((int dev, TCHUNK *tracks, int *indices,
- X int num, int repeat));
- Xextern int record_tracks _ANSI_ARGS_((int dev, TCHUNK *p_tracks, int *indices,
- X int p_num, TCHUNK *r_track, int repeat));
- Xextern int stop_processing _ANSI_ARGS_((int dev));
- Xextern int open_midi_device _ANSI_ARGS_((PlayMode mode));
- Xextern int init_midi_device _ANSI_ARGS_((int dev, HCHUNK *hd, double reltempo));
- Xextern int start_midi_device _ANSI_ARGS_((int dev, PlayMode mode));
- Xextern int stop_midi_device _ANSI_ARGS_((int dev, PlayMode mode));
- Xextern int close_midi_device _ANSI_ARGS_((int dev));
- X
- X#endif
- END_OF_FILE
- if test 2424 -ne `wc -c <'tclm-1.0/mlib/mdevice.h'`; then
- echo shar: \"'tclm-1.0/mlib/mdevice.h'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/mlib/mdevice.h'
- fi
- if test -f 'tclm-1.0/mplay' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/mplay'\"
- else
- echo shar: Extracting \"'tclm-1.0/mplay'\" \(3284 characters\)
- sed "s/^X//" >'tclm-1.0/mplay' <<'END_OF_FILE'
- X#!/usr/local/bin/tclm -f
- X#
- X# Copyright (c) 1993 Michael B. Durian. All rights reserved.
- X#
- X# Redistribution and use in source and binary forms, with or without
- X# modification, are permitted provided that the following conditions
- X# are met:
- X# 1. Redistributions of source code must retain the above copyright
- X# notice, this list of conditions and the following disclaimer.
- X# 2. Redistributions in binary form must reproduce the above copyright
- X# notice, this list of conditions and the following disclaimer in the
- X# documentation and/or other materials provided with the distribution.
- X# 3. All advertising materials mentioning features or use of this software
- X# must display the following acknowledgement:
- X# This product includes software developed by Michael B. Durian.
- X# 4. The name of the the Author may be used to endorse or promote
- X# products derived from this software without specific prior written
- X# permission.
- X#
- X# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- X# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- X# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- X# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- X# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X# SUCH DAMAGE.
- X
- X# mplay,v 1.7 1993/05/06 21:42:22 durian Exp
- X
- Xif {! [midiplayable]} {
- X puts stderr [concat "Cannot play. Tclm was not compiled with the " \
- X "play functionality turned on."]
- X exit 1
- X}
- X
- Xset repeat 0
- Xset tracks {}
- Xset speed 1.0
- Xset filenames {}
- X
- Xproc parse_arg {args} {
- X global repeat
- X global tracks
- X global speed
- X global filenames
- X
- X # strip away extra {}'s
- X set args [lindex $args 0]
- X set num_args [llength $args]
- X if {$num_args > 1 && [string compare [lindex $args 0] "-f"] == 0} {
- X set i 2
- X } else {
- X set i 0
- X }
- X for {} {$i < $num_args} {incr i} {
- X
- X set arg [lindex $args $i]
- X case $arg in \
- X -repeat {
- X set repeat 1
- X } -tracks {
- X set tracks [lindex $args [incr i]]
- X } -speed {
- X set speed [lindex $args [incr i]]
- X } default {
- X lappend filenames $arg
- X }
- X }
- X}
- X
- Xparse_arg $argv
- X
- Xif {$repeat} {
- X set repeat repeat
- X} else {
- X set repeat ""
- X}
- X
- Xif {[llength $tracks] != 0} {
- X set tracks "tracks \"$tracks\""
- X} else {
- X set tracks ""
- X}
- X
- Xif {$speed != 1.0} {
- X set speed "reltempo $speed"
- X} else {
- X set speed ""
- X}
- X
- Xif {[llength $filenames] == 0} {
- X set midi_file stdin
- X set done 0
- X while {1} {
- X if {[catch {midiread $midi_file} mfile]} {
- X if {[string compare "$mfile" "EOF"] == 0} {
- X exit 0
- X } else {
- X puts stderr $mfile
- X exit 1
- X }
- X }
- X eval "midiplay $repeat $tracks $speed $mfile"
- X midifree $mfile
- X }
- X} else {
- X foreach file $filenames {
- X if {[catch {open $file} midi_file]} {
- X puts stderr $midi_file
- X exit 1
- X }
- X if {[catch {midiread $midi_file} mfile]} {
- X puts stderr $mfile
- X exit 1
- X }
- X eval "midiplay $repeat $tracks $speed $mfile"
- X midifree $mfile
- X close $midi_file
- X }
- X}
- Xexit 0
- END_OF_FILE
- if test 3284 -ne `wc -c <'tclm-1.0/mplay'`; then
- echo shar: \"'tclm-1.0/mplay'\" unpacked with wrong size!
- fi
- chmod +x 'tclm-1.0/mplay'
- # end of 'tclm-1.0/mplay'
- fi
- if test -f 'tclm-1.0/mseq.BNF' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/mseq.BNF'\"
- else
- echo shar: Extracting \"'tclm-1.0/mseq.BNF'\" \(829 characters\)
- sed "s/^X//" >'tclm-1.0/mseq.BNF' <<'END_OF_FILE'
- X I can't quite remember proper BNF format but here's a try.
- XThings in *'s are literals.
- X I'm not going to define numbers or filenames. Guess.
- X
- Xmseq_file :== section+
- Xsection :== *track* statement+
- Xstatement :== labeled sequence | filename | command | comment
- Xlabeled seuqence :== label sequence
- Xlabel :== name*:*
- Xsequence :== block | filename
- Xblock :== *{* sequence+ *}*
- Xcommand :== *repeat* label | *repeat* label multiplier
- Xmultiplier :== number
- Xcomment :== *#* anything to end-of-line
- X
- X Essentially what you want is stuff like:
- X
- Xtrack
- X# This is track 1
- Xpat1.mid
- Xpat2.mid
- XA: {
- X pat3.mid
- X B: { # block B:
- X pat4.mid
- X pat5.mid
- X }
- X pat6.mid
- X repeat B: 3
- X}
- Xpat7.mid
- Xpat8.mid # pattern 8
- X
- X# This is track 2
- Xtrack
- Xpat1.mid
- Xpat2.mid
- XA: {
- X pat3.mid
- X pat4.mid
- X B: pat5.mid
- X pat6.mid
- X repeat B: 6
- X}
- Xpat7.mid
- Xrepeat A:
- END_OF_FILE
- if test 829 -ne `wc -c <'tclm-1.0/mseq.BNF'`; then
- echo shar: \"'tclm-1.0/mseq.BNF'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/mseq.BNF'
- fi
- if test -f 'tclm-1.0/tclmPlay.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tclm-1.0/tclmPlay.h'\"
- else
- echo shar: Extracting \"'tclm-1.0/tclmPlay.h'\" \(2226 characters\)
- sed "s/^X//" >'tclm-1.0/tclmPlay.h' <<'END_OF_FILE'
- X/*-
- X * Copyright (c) 1993 Michael B. Durian. All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by Michael B. Durian.
- X * 4. The name of the the Author may be used to endorse or promote
- X * products derived from this software without specific prior written
- X * permission.
- X *
- X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X/*
- X * tclmPlay.h,v 1.3 1993/04/16 15:39:50 durian Exp
- X */
- X#ifndef TCLMPLAY_H
- X#define TCLMPLAY_H
- X
- Xextern void Tclm_InitPlay _ANSI_ARGS_((Tcl_Interp *));
- Xextern int Tclm_MidiPlay _ANSI_ARGS_((ClientData, Tcl_Interp *, int, char **));
- Xextern int Tclm_MidiRecord _ANSI_ARGS_((ClientData, Tcl_Interp *, int,
- X char **));
- Xextern int Tclm_MidiStop _ANSI_ARGS_((ClientData, Tcl_Interp *, int, char **));
- Xextern void watchdog _ANSI_ARGS_(());
- Xextern void Tclm_CatchStop _ANSI_ARGS_(());
- Xextern int Tclm_ParseTracks _ANSI_ARGS_((Tcl_Interp *, char *, int **));
- X#endif
- END_OF_FILE
- if test 2226 -ne `wc -c <'tclm-1.0/tclmPlay.h'`; then
- echo shar: \"'tclm-1.0/tclmPlay.h'\" unpacked with wrong size!
- fi
- # end of 'tclm-1.0/tclmPlay.h'
- fi
- echo shar: End of archive 4 \(of 5\).
- cp /dev/null ark4isdone
- MISSING=""
- for I in 1 2 3 4 5 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 5 archives.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-