home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume43 / tclmidi / part13 < prev    next >
Internet Message Format  |  1994-07-21  |  62KB

  1. From: durian@boogie.com (Mike Durian)
  2. Newsgroups: comp.sources.misc
  3. Subject: v43i121:  tclmidi - A language for manipulating MIDI files, v2.0, Part13/14
  4. Date: 21 Jul 1994 19:28:24 -0500
  5. Organization: Sterling Software
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <30n3r8$79n@sparky.sterling.com>
  9. X-Md4-Signature: 7d1acfb27b02652d4d0008fddf0c1daa
  10.  
  11. Submitted-by: durian@boogie.com (Mike Durian)
  12. Posting-number: Volume 43, Issue 121
  13. Archive-name: tclmidi/part13
  14. Environment: POSIX, (BSDI, NetBSD, LINUX, SVR4 for optional driver), C++, TCL
  15. Supersedes: tclm: Volume 37, Issue 43-47
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  tclmidi-2.0/INSTALL tclmidi-2.0/TclmInterp.h
  22. #   tclmidi-2.0/contrib/msplit tclmidi-2.0/drivers/LINUX/INSTALL
  23. #   tclmidi-2.0/drivers/LINUX/midi.patch
  24. #   tclmidi-2.0/drivers/SVR4/PROBLEMS tclmidi-2.0/events/MetaCue.C
  25. #   tclmidi-2.0/events/MetaEvent.C tclmidi-2.0/events/NoteOff.C
  26. #   tclmidi-2.0/events/NoteOn.C tclmidi-2.0/events/TODO
  27. #   tclmidi-2.0/man/Makefile tclmidi-2.0/man/midiconfig.n
  28. #   tclmidi-2.0/man/midicopy.n tclmidi-2.0/man/mididelete.n
  29. #   tclmidi-2.0/man/mididevice.n tclmidi-2.0/man/midimerge.n
  30. #   tclmidi-2.0/man/midimove.n tclmidi-2.0/man/miditrack.n
  31. #   tclmidi-2.0/man/mrec.1 tclmidi-2.0/rb/list.c tclmidi-2.0/rb/list.h
  32. #   tclmidi-2.0/rb/rb.h tclmidi-2.0/tests/drange.test
  33. #   tclmidi-2.0/tests/putget.test tclmidi-2.0/tests/rw.test
  34. #   tclmidi-2.0/tests/split.test
  35. # Wrapped by kent@sparky on Thu Jul 21 19:05:18 1994
  36. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  37. echo If this archive is complete, you will see the following message:
  38. echo '          "shar: End of archive 13 (of 14)."'
  39. if test -f 'tclmidi-2.0/INSTALL' -a "${1}" != "-c" ; then 
  40.   echo shar: Will not clobber existing file \"'tclmidi-2.0/INSTALL'\"
  41. else
  42.   echo shar: Extracting \"'tclmidi-2.0/INSTALL'\" \(2136 characters\)
  43.   sed "s/^X//" >'tclmidi-2.0/INSTALL' <<'END_OF_FILE'
  44. XINSTALLING THE MPU401 DRIVER
  45. X  Before installing tclmidi-2.0, you will need to decide if you
  46. Xwish to install one of the MPU401 drivers I have supplied.
  47. XCurrently, I have drivers with the same interface for BSD/386,
  48. X386BSD and variants, Linux  and SVR4 variants.  If you wish to install
  49. Xa driver, go to the drivers directory (cd drivers) and
  50. Xthen to the proper subdirectory (BSD, LINUX or SVR4).  Follow
  51. Xthe instructions in the README or INSTALL file.  Unfortunately, I did not
  52. Xfind a tester for SVR4.  The basic code is there, but it probably
  53. Xwill not work.
  54. X  The man page for the driver is in drivers/man.  You can install
  55. Xit with "install man-cooked" or "install man-raw".  The cooked
  56. Xversion will install a preprocessed man page, while the raw version
  57. Xwill install an unprocessed version.
  58. X
  59. XINSTALLING THE TCLMIDI PACKAGE
  60. X  You will need to edit the Makefile and set some definitions
  61. Xnear the top.  You will need to define your C and C++ compilers,
  62. Xranlib if you have it and some paths for installation.  There are
  63. Xsome defines for CFLAGS that also must be set.
  64. X  If you wish to build in support for the MPU401 driver, you
  65. Xwill need to define USE_MPU401 or USE_MPU401COPY.  Without one of
  66. Xthese definitions, you won't be able to play or record.  If you
  67. Xdefine one of these, you must also add a defintion for your system
  68. Xtype (BSD, LINUX or SVR4).  This definiton only controls where
  69. Xthe midi device header file is found, and is not needed if
  70. Xyou haven't also defined one of the USE_* flags.
  71. X  Once you have customized the Makefile, you need only type
  72. X    make
  73. Xand then
  74. X    make install.
  75. X  To install the man pages use
  76. X    make install-man-cooked
  77. Xor
  78. X    make install-man-raw
  79. X
  80. X  The man pages are written using the newer mandoc macros instead of
  81. Xthe man macros.  "Cooking" the man pages involves running them
  82. Xthrough groff (you can use nroff if you want by editing man/Makefile),
  83. Xand then installing the processed man pages.  The raw target installs
  84. Xthe man sources without processing them.
  85. X
  86. X  If you want a version of tclmidi that includes tk support type
  87. X    make tkmidi
  88. Xand then
  89. X    make install-tkmidi
  90. X
  91. X  That should be everything.
  92. END_OF_FILE
  93.   if test 2136 -ne `wc -c <'tclmidi-2.0/INSTALL'`; then
  94.     echo shar: \"'tclmidi-2.0/INSTALL'\" unpacked with wrong size!
  95.   fi
  96.   # end of 'tclmidi-2.0/INSTALL'
  97. fi
  98. if test -f 'tclmidi-2.0/TclmInterp.h' -a "${1}" != "-c" ; then 
  99.   echo shar: Will not clobber existing file \"'tclmidi-2.0/TclmInterp.h'\"
  100. else
  101.   echo shar: Extracting \"'tclmidi-2.0/TclmInterp.h'\" \(2319 characters\)
  102.   sed "s/^X//" >'tclmidi-2.0/TclmInterp.h' <<'END_OF_FILE'
  103. X/*-
  104. X * Copyright (c) 1993, 1994 Michael B. Durian.  All rights reserved.
  105. X *
  106. X * Redistribution and use in source and binary forms, with or without
  107. X * modification, are permitted provided that the following conditions
  108. X * are met:
  109. X * 1. Redistributions of source code must retain the above copyright
  110. X *    notice, this list of conditions and the following disclaimer.
  111. X * 2. Redistributions in binary form must reproduce the above copyright
  112. X *    notice, this list of conditions and the following disclaimer in the
  113. X *    documentation and/or other materials provided with the distribution.
  114. X * 3. All advertising materials mentioning features or use of this software
  115. X *    must display the following acknowledgement:
  116. X *    This product includes software developed by Michael B. Durian.
  117. X * 4. The name of the the Author may be used to endorse or promote 
  118. X *    products derived from this software without specific prior written 
  119. X *    permission.
  120. X *
  121. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 
  122. X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  123. X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
  124. X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
  125. X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  126. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  127. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  128. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  129. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  130. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  131. X * SUCH DAMAGE.
  132. X */
  133. X#ifndef TCLMINTERP_H
  134. X#define TCLMINTERP_H
  135. X
  136. X#include <iostream.h>
  137. X#include "Song.h"
  138. X#include "MidiDevice.h"
  139. X
  140. Xextern "C" {
  141. X#include <tcl.h>
  142. X}
  143. X
  144. Xclass TclmInterp {
  145. Xpublic:
  146. X    TclmInterp();
  147. X    TclmInterp(const TclmInterp &ti);
  148. X    ~TclmInterp();
  149. X
  150. X    Song *GetSong(const char *key) const;
  151. X    char *AddSong(const Song *song);
  152. X    int DeleteSong(const char *key);
  153. X    Event *GetNextEvent(void) const;
  154. X    void SetNextEvent(const Event *event);
  155. X    void SetMidiDevice(MidiDevice *dev);
  156. X    MidiDevice *GetMidiDevice(void) const;
  157. X
  158. X    TclmInterp &operator=(const TclmInterp &ti);
  159. Xprivate:
  160. X    Tcl_HashTable hash_table;
  161. X    int current_song;
  162. X    Event *next_event;
  163. X    MidiDevice *device;
  164. X};
  165. X#endif
  166. END_OF_FILE
  167.   if test 2319 -ne `wc -c <'tclmidi-2.0/TclmInterp.h'`; then
  168.     echo shar: \"'tclmidi-2.0/TclmInterp.h'\" unpacked with wrong size!
  169.   fi
  170.   # end of 'tclmidi-2.0/TclmInterp.h'
  171. fi
  172. if test -f 'tclmidi-2.0/contrib/msplit' -a "${1}" != "-c" ; then 
  173.   echo shar: Will not clobber existing file \"'tclmidi-2.0/contrib/msplit'\"
  174. else
  175.   echo shar: Extracting \"'tclmidi-2.0/contrib/msplit'\" \(1300 characters\)
  176.   sed "s/^X//" >'tclmidi-2.0/contrib/msplit' <<'END_OF_FILE'
  177. X#!/usr/local/bin/tclmidi
  178. X#
  179. X# msplit - type 0 to type 1 SMF conversion filter
  180. X#
  181. X# Copyright (c) 1994 by Luchezar Georgiev, Bulgaria   <lucho@midi.tu-varna.bg>
  182. X#
  183. X# The resulting file contains 18 tracks:
  184. X#    track 0 contains meta events,
  185. X#    tracks 1...16 - events for channels 1...16,
  186. X#    track 17 - SysEx events.
  187. X# If there are no suitable events for a track, it's left empty. Sorry! :-)
  188. X#
  189. Xif {$argc} {
  190. X    puts stderr {Usage: msplit < type0.mid > type1.mid}
  191. X    exit 1
  192. X}
  193. X
  194. Xset imf [midiread stdin]
  195. Xset config [midiconfig $imf]
  196. X
  197. Xif {[lindex [lindex $config 0] 1]} {
  198. X    puts stderr {Input must be type 0}
  199. X    exit -1
  200. X}
  201. Xset division [lindex $config 1]
  202. Xset xmf [midimake]
  203. Xmidiconfig $xmf "format 0" $division "tracks 1"
  204. Xset omf [midimake]
  205. Xmidiconfig $omf "format 1" $division "tracks 18"
  206. X
  207. Xmidisplit "$imf 0" "$omf 0" "$xmf 0"
  208. Xmidirewind $xmf
  209. Xset errMsg ""
  210. X
  211. Xwhile {[set event [midiget $xmf 0 next]] != "EOT"} {
  212. X    switch [lindex $event 1] {
  213. X        "MetaEndOfTrack" {continue}
  214. X        "SystemExclusive" {set trk 17}
  215. X        default {set trk [expr [lindex $event 2] + 1]}
  216. X    }
  217. X    catch {
  218. X        midiput $omf $trk $event
  219. X    } errMsg
  220. X    if {$errMsg != ""} {
  221. X        puts stderr "$errMsg \"$event\""
  222. X    }
  223. X}
  224. X
  225. Xfor {set i 1} {$i < 18} {incr i} {
  226. X    midiput $omf $i "[miditrack $omf $i end] MetaEndOfTrack"
  227. X}
  228. X
  229. Xmidiwrite stdout $omf
  230. Xmidifree $imf
  231. Xmidifree $xmf
  232. Xmidifree $omf
  233. END_OF_FILE
  234.   if test 1300 -ne `wc -c <'tclmidi-2.0/contrib/msplit'`; then
  235.     echo shar: \"'tclmidi-2.0/contrib/msplit'\" unpacked with wrong size!
  236.   fi
  237.   chmod +x 'tclmidi-2.0/contrib/msplit'
  238.   # end of 'tclmidi-2.0/contrib/msplit'
  239. fi
  240. if test -f 'tclmidi-2.0/drivers/LINUX/INSTALL' -a "${1}" != "-c" ; then 
  241.   echo shar: Will not clobber existing file \"'tclmidi-2.0/drivers/LINUX/INSTALL'\"
  242. else
  243.   echo shar: Extracting \"'tclmidi-2.0/drivers/LINUX/INSTALL'\" \(2071 characters\)
  244.   sed "s/^X//" >'tclmidi-2.0/drivers/LINUX/INSTALL' <<'END_OF_FILE'
  245. X-1) Decide if you want the midi driver to be part of the kernel, or
  246. X    a loadable module.  If you want it to be part of the kernel follow
  247. X    the first set of instruction.  If you want it to be a loadable
  248. X    module, follow the second set.  The loadable module stuff hasn't
  249. X    been tested.  I don't know if it will work.
  250. X
  251. XKERNEL BUILTIN
  252. X0) All paths are relative to /usr/src/linux
  253. X1) Put the files midi.c, midiconf.c, quad.c and quad.h in drivers/char
  254. X2) Put midi.h in include/linux
  255. X3) Edit midiconf.c for the correct setup for your MPU401s.
  256. X4) Apply the patches in midi.patch from the /usr/src/linux directory
  257. X     patch -p < midi.patch
  258. X5) make a major number for MIDI_MAJOR in include/linux/major.h
  259. X   Something like:
  260. X     #define MIDI_MAJOR 28
  261. X6) make the midi devices in /dev.  Feel free to make extras if you
  262. X   have more than 3 MPU401s.  Having extra entries in /dev doesn't
  263. X   hurt anything.  I've assumed that the MIDI_MAJOR number is 28,
  264. X   if it is something else, change the 28s in the following lines
  265. X   to the correct value.
  266. X
  267. X   mknod /dev/midi0 c 28 0
  268. X   mknod /dev/midi1 c 28 1
  269. X   mknod /dev/midi2 c 28 2
  270. X   chmod 666 /dev/midi*
  271. X
  272. X7) reconfig "make config"
  273. X8) rebuild and install the kernel normally
  274. X9) you're done
  275. X
  276. XLOADABLE MODULE
  277. X1) Put midi.h in <linux/midi.h>
  278. X2) Edit midiconf.c for the correct setup for your MPU401s.
  279. X3) make a major number for MIDI_MAJOR in <linux/major.h>
  280. X   Something like:
  281. X     #define MIDI_MAJOR 28
  282. X4) make the midi devices in /dev.  Feel free to make extras if you
  283. X   have more than 3 MPU401s.  Having extra entries in /dev doesn't
  284. X   hurt anything.  I've assumed that the MIDI_MAJOR number is 28,
  285. X   if it is something else, change the 28s in the following lines
  286. X   to the correct value.
  287. X
  288. X   mknod /dev/midi0 c 28 0
  289. X   mknod /dev/midi1 c 28 1
  290. X   mknod /dev/midi2 c 28 2
  291. X   chmod 666 /dev/midi*
  292. X
  293. X5) Take a look at the Makefile, I don't think you'll need to make
  294. X    any changes, but you never know.
  295. X6) make
  296. X7) "insmod midimodule" to install module
  297. X8) "rmmod midimodule" (or is that "rmmod midi"?) to remove module
  298. X9) that's it
  299. END_OF_FILE
  300.   if test 2071 -ne `wc -c <'tclmidi-2.0/drivers/LINUX/INSTALL'`; then
  301.     echo shar: \"'tclmidi-2.0/drivers/LINUX/INSTALL'\" unpacked with wrong size!
  302.   fi
  303.   # end of 'tclmidi-2.0/drivers/LINUX/INSTALL'
  304. fi
  305. if test -f 'tclmidi-2.0/drivers/LINUX/midi.patch' -a "${1}" != "-c" ; then 
  306.   echo shar: Will not clobber existing file \"'tclmidi-2.0/drivers/LINUX/midi.patch'\"
  307. else
  308.   echo shar: Extracting \"'tclmidi-2.0/drivers/LINUX/midi.patch'\" \(1272 characters\)
  309.   sed "s/^X//" >'tclmidi-2.0/drivers/LINUX/midi.patch' <<'END_OF_FILE'
  310. X*** drivers/char/Makefile.orig    Mon Apr 11 15:06:38 1994
  311. X--- drivers/char/Makefile    Mon Apr 11 15:10:59 1994
  312. X***************
  313. X*** 63,68 ****
  314. X--- 63,73 ----
  315. X  SRCS := $(SRCS) tpqic02.c
  316. X  endif
  317. X  
  318. X+ ifdef CONFIG_MIDI
  319. X+ OBJS := $(OBJS) midiconf.o midi.o quad.o
  320. X+ SRCS := $(SRCS) midiconf.c midi.c quad.c
  321. X+ endif
  322. X+ 
  323. X  ifdef M
  324. X  OBJS := $(OBJS) mouse.o
  325. X  SRCS := $(SRCS) mouse.c
  326. X*** drivers/char/mem.c.orig    Mon Apr 11 15:07:44 1994
  327. X--- drivers/char/mem.c    Mon Apr 11 15:09:48 1994
  328. X***************
  329. X*** 15,20 ****
  330. X--- 15,22 ----
  331. X  #include <linux/tpqic02.h>
  332. X  #include <linux/malloc.h>
  333. X  #include <linux/mman.h>
  334. X+ #include <linux/timer.h>
  335. X+ #include <linux/midi.h>
  336. X  
  337. X  #include <asm/segment.h>
  338. X  #include <asm/io.h>
  339. X***************
  340. X*** 422,426 ****
  341. X--- 424,431 ----
  342. X                 NR_FTAPE_BUFFERS, ftape_big_buffer);
  343. X          mem_start = (long) ftape_big_buffer + NR_FTAPE_BUFFERS * 0x8000;
  344. X  #endif 
  345. X+ #ifdef CONFIG_MIDI
  346. X+     mem_start = midiinit(mem_start);
  347. X+ #endif
  348. X      return mem_start;
  349. X  }
  350. X*** config.in.orig    Sat Mar 12 17:17:37 1994
  351. X--- config.in    Mon Apr 11 15:06:11 1994
  352. X***************
  353. X*** 120,125 ****
  354. X--- 120,126 ----
  355. X  if [ "$CONFIG_FTAPE" = "y" ]
  356. X  int ' number of ftape buffers' NR_FTAPE_BUFFERS 3
  357. X  fi
  358. X+ bool 'MIDI MPU401 UART device' CONFIG_MIDI n
  359. X  *
  360. X  * Sound
  361. X  *
  362. END_OF_FILE
  363.   if test 1272 -ne `wc -c <'tclmidi-2.0/drivers/LINUX/midi.patch'`; then
  364.     echo shar: \"'tclmidi-2.0/drivers/LINUX/midi.patch'\" unpacked with wrong size!
  365.   fi
  366.   # end of 'tclmidi-2.0/drivers/LINUX/midi.patch'
  367. fi
  368. if test -f 'tclmidi-2.0/drivers/SVR4/PROBLEMS' -a "${1}" != "-c" ; then 
  369.   echo shar: Will not clobber existing file \"'tclmidi-2.0/drivers/SVR4/PROBLEMS'\"
  370. else
  371.   echo shar: Extracting \"'tclmidi-2.0/drivers/SVR4/PROBLEMS'\" \(1267 characters\)
  372.   sed "s/^X//" >'tclmidi-2.0/drivers/SVR4/PROBLEMS' <<'END_OF_FILE'
  373. X  I really don't understand how the polling should work, so that
  374. Xstuff if probably incorrect.  Look for comments containing XXXPOLL
  375. X
  376. X  I don't know what the argument to midiintr is supposed to be
  377. Xeither.  I'm hoping it is a dev_t, but that's probably unlikely.
  378. XLook for a comment containing XXXINTR.
  379. X
  380. X  This driver should verify any pids set in the TIOCSPGRP ioctl.
  381. XIf it doesn't verify them at the ioctl stage, the driver will
  382. Xjust go ahead and try to kill whatever you set.  This could be
  383. Xany process at all (like init for example).  A potential security
  384. Xhole I think.  Look for the XXXSIGNAL comments.
  385. X
  386. X  For better timing accuracy, I now use long longs when converting
  387. Xto/from smf ticks and kernel ticks.  I don't know if the default
  388. XSVR4 compiler supports long longs.  I know GCC does.  But, if you
  389. Xuse GCC, you'll probably need to link in special math functions.
  390. XThese are called __divdi3, __muldi3 etc.  I've included the ones
  391. Xthat are needed in quad.c and quad.h.  These files are the versions
  392. Xused with Linux.  They'll probably need to be modified to work with
  393. XSVR4.  Look in the BSD directory to see what the unmodified files
  394. Xlook like.
  395. X  I also don't know how to modify the makefile to compile multiple
  396. Xfiles.  You'll have to do figure it out on your own.
  397. END_OF_FILE
  398.   if test 1267 -ne `wc -c <'tclmidi-2.0/drivers/SVR4/PROBLEMS'`; then
  399.     echo shar: \"'tclmidi-2.0/drivers/SVR4/PROBLEMS'\" unpacked with wrong size!
  400.   fi
  401.   # end of 'tclmidi-2.0/drivers/SVR4/PROBLEMS'
  402. fi
  403. if test -f 'tclmidi-2.0/events/MetaCue.C' -a "${1}" != "-c" ; then 
  404.   echo shar: Will not clobber existing file \"'tclmidi-2.0/events/MetaCue.C'\"
  405. else
  406.   echo shar: Extracting \"'tclmidi-2.0/events/MetaCue.C'\" \(2286 characters\)
  407.   sed "s/^X//" >'tclmidi-2.0/events/MetaCue.C' <<'END_OF_FILE'
  408. X/*-
  409. X * Copyright (c) 1993, 1994 Michael B. Durian.  All rights reserved.
  410. X *
  411. X * Redistribution and use in source and binary forms, with or without
  412. X * modification, are permitted provided that the following conditions
  413. X * are met:
  414. X * 1. Redistributions of source code must retain the above copyright
  415. X *    notice, this list of conditions and the following disclaimer.
  416. X * 2. Redistributions in binary form must reproduce the above copyright
  417. X *    notice, this list of conditions and the following disclaimer in the
  418. X *    documentation and/or other materials provided with the distribution.
  419. X * 3. All advertising materials mentioning features or use of this software
  420. X *    must display the following acknowledgement:
  421. X *    This product includes software developed by Michael B. Durian.
  422. X * 4. The name of the the Author may be used to endorse or promote 
  423. X *    products derived from this software without specific prior written 
  424. X *    permission.
  425. X *
  426. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 
  427. X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  428. X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
  429. X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
  430. X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  431. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  432. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  433. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  434. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  435. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  436. X * SUCH DAMAGE.
  437. X */
  438. X#include "MetaCue.h"
  439. X
  440. XMetaCueEvent::MetaCueEvent()
  441. X{
  442. X}
  443. X
  444. XMetaCueEvent::MetaCueEvent(unsigned long t, const char *str) :
  445. X    MetaTextEvent(t, str)
  446. X{
  447. X}
  448. X
  449. XMetaCueEvent::MetaCueEvent(const MetaCueEvent &e) :
  450. X    MetaTextEvent(e)
  451. X{
  452. X}
  453. X
  454. XMetaCueEvent::~MetaCueEvent()
  455. X{
  456. X}
  457. X
  458. XMetaCueEvent &
  459. XMetaCueEvent::operator=(const MetaCueEvent &e)
  460. X{
  461. X
  462. X    (MetaTextEvent)*this = (MetaTextEvent)e;
  463. X    return (*this);
  464. X}
  465. X
  466. Xchar *
  467. XMetaCueEvent::GetEventStr(void) const
  468. X{
  469. X
  470. X    return (MetaTextEvent::GetEventStr());
  471. X}
  472. X
  473. Xostream &
  474. Xoperator<<(ostream &os, const MetaCueEvent &e)
  475. X{
  476. X    char *str;
  477. X
  478. X    os << (str = e.GetEventStr());
  479. X    delete str;
  480. X    return (os);
  481. X}
  482. END_OF_FILE
  483.   if test 2286 -ne `wc -c <'tclmidi-2.0/events/MetaCue.C'`; then
  484.     echo shar: \"'tclmidi-2.0/events/MetaCue.C'\" unpacked with wrong size!
  485.   fi
  486.   # end of 'tclmidi-2.0/events/MetaCue.C'
  487. fi
  488. if test -f 'tclmidi-2.0/events/MetaEvent.C' -a "${1}" != "-c" ; then 
  489.   echo shar: Will not clobber existing file \"'tclmidi-2.0/events/MetaEvent.C'\"
  490. else
  491.   echo shar: Extracting \"'tclmidi-2.0/events/MetaEvent.C'\" \(2147 characters\)
  492.   sed "s/^X//" >'tclmidi-2.0/events/MetaEvent.C' <<'END_OF_FILE'
  493. X/*-
  494. X * Copyright (c) 1993, 1994 Michael B. Durian.  All rights reserved.
  495. X *
  496. X * Redistribution and use in source and binary forms, with or without
  497. X * modification, are permitted provided that the following conditions
  498. X * are met:
  499. X * 1. Redistributions of source code must retain the above copyright
  500. X *    notice, this list of conditions and the following disclaimer.
  501. X * 2. Redistributions in binary form must reproduce the above copyright
  502. X *    notice, this list of conditions and the following disclaimer in the
  503. X *    documentation and/or other materials provided with the distribution.
  504. X * 3. All advertising materials mentioning features or use of this software
  505. X *    must display the following acknowledgement:
  506. X *    This product includes software developed by Michael B. Durian.
  507. X * 4. The name of the the Author may be used to endorse or promote 
  508. X *    products derived from this software without specific prior written 
  509. X *    permission.
  510. X *
  511. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 
  512. X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  513. X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
  514. X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
  515. X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  516. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  517. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  518. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  519. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  520. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  521. X * SUCH DAMAGE.
  522. X */
  523. X#include "MetaEvent.h"
  524. X
  525. XMetaEvent::MetaEvent()
  526. X{
  527. X}
  528. X
  529. XMetaEvent::MetaEvent(unsigned long t) : Event(t)
  530. X{
  531. X}
  532. X
  533. XMetaEvent::MetaEvent(const MetaEvent &e) : Event(e)
  534. X{
  535. X}
  536. X
  537. XMetaEvent &
  538. XMetaEvent::operator=(const MetaEvent &e)
  539. X{
  540. X
  541. X    (Event)*this = (Event)e;
  542. X    return (*this);
  543. X}
  544. X
  545. Xchar *
  546. XMetaEvent::GetEventStr(void) const
  547. X{
  548. X
  549. X    return (Event::GetEventStr());
  550. X}
  551. X
  552. Xostream &
  553. Xoperator<<(ostream &os, const MetaEvent &e)
  554. X{
  555. X    char *str;
  556. X
  557. X    os << (str = e.GetEventStr());
  558. X    delete str;
  559. X    return (os);
  560. X}
  561. END_OF_FILE
  562.   if test 2147 -ne `wc -c <'tclmidi-2.0/events/MetaEvent.C'`; then
  563.     echo shar: \"'tclmidi-2.0/events/MetaEvent.C'\" unpacked with wrong size!
  564.   fi
  565.   # end of 'tclmidi-2.0/events/MetaEvent.C'
  566. fi
  567. if test -f 'tclmidi-2.0/events/NoteOff.C' -a "${1}" != "-c" ; then 
  568.   echo shar: Will not clobber existing file \"'tclmidi-2.0/events/NoteOff.C'\"
  569. else
  570.   echo shar: Extracting \"'tclmidi-2.0/events/NoteOff.C'\" \(2308 characters\)
  571.   sed "s/^X//" >'tclmidi-2.0/events/NoteOff.C' <<'END_OF_FILE'
  572. X/*-
  573. X * Copyright (c) 1993, 1994 Michael B. Durian.  All rights reserved.
  574. X *
  575. X * Redistribution and use in source and binary forms, with or without
  576. X * modification, are permitted provided that the following conditions
  577. X * are met:
  578. X * 1. Redistributions of source code must retain the above copyright
  579. X *    notice, this list of conditions and the following disclaimer.
  580. X * 2. Redistributions in binary form must reproduce the above copyright
  581. X *    notice, this list of conditions and the following disclaimer in the
  582. X *    documentation and/or other materials provided with the distribution.
  583. X * 3. All advertising materials mentioning features or use of this software
  584. X *    must display the following acknowledgement:
  585. X *    This product includes software developed by Michael B. Durian.
  586. X * 4. The name of the the Author may be used to endorse or promote 
  587. X *    products derived from this software without specific prior written 
  588. X *    permission.
  589. X *
  590. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 
  591. X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  592. X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
  593. X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
  594. X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  595. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  596. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  597. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  598. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  599. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  600. X * SUCH DAMAGE.
  601. X */
  602. X#include "NoteOff.h"
  603. X
  604. XNoteOffEvent::NoteOffEvent()
  605. X{
  606. X}
  607. X
  608. XNoteOffEvent::NoteOffEvent(unsigned long t, unsigned char chan,
  609. X    unsigned char pit, unsigned char vel, const NoteEvent *np) :
  610. X    NoteEvent(t, chan, pit, vel, np)
  611. X{
  612. X}
  613. X
  614. XNoteOffEvent::NoteOffEvent(const NoteOffEvent &e) : NoteEvent(e)
  615. X{
  616. X}
  617. X
  618. XNoteOffEvent &
  619. XNoteOffEvent::operator=(const NoteOffEvent &e)
  620. X{
  621. X
  622. X    (NoteEvent)*this = (NoteEvent)e;
  623. X    return (*this);
  624. X}
  625. X
  626. Xchar *
  627. XNoteOffEvent::GetEventStr(void) const
  628. X{
  629. X
  630. X    return (NoteEvent::GetEventStr());
  631. X}
  632. X
  633. Xostream &
  634. Xoperator<<(ostream &os, const NoteOffEvent &e)
  635. X{
  636. X    char *str;
  637. X
  638. X    os << (str = e.GetEventStr());
  639. X    delete str;
  640. X    return (os);
  641. X}
  642. END_OF_FILE
  643.   if test 2308 -ne `wc -c <'tclmidi-2.0/events/NoteOff.C'`; then
  644.     echo shar: \"'tclmidi-2.0/events/NoteOff.C'\" unpacked with wrong size!
  645.   fi
  646.   # end of 'tclmidi-2.0/events/NoteOff.C'
  647. fi
  648. if test -f 'tclmidi-2.0/events/NoteOn.C' -a "${1}" != "-c" ; then 
  649.   echo shar: Will not clobber existing file \"'tclmidi-2.0/events/NoteOn.C'\"
  650. else
  651.   echo shar: Extracting \"'tclmidi-2.0/events/NoteOn.C'\" \(2295 characters\)
  652.   sed "s/^X//" >'tclmidi-2.0/events/NoteOn.C' <<'END_OF_FILE'
  653. X/*-
  654. X * Copyright (c) 1993, 1994 Michael B. Durian.  All rights reserved.
  655. X *
  656. X * Redistribution and use in source and binary forms, with or without
  657. X * modification, are permitted provided that the following conditions
  658. X * are met:
  659. X * 1. Redistributions of source code must retain the above copyright
  660. X *    notice, this list of conditions and the following disclaimer.
  661. X * 2. Redistributions in binary form must reproduce the above copyright
  662. X *    notice, this list of conditions and the following disclaimer in the
  663. X *    documentation and/or other materials provided with the distribution.
  664. X * 3. All advertising materials mentioning features or use of this software
  665. X *    must display the following acknowledgement:
  666. X *    This product includes software developed by Michael B. Durian.
  667. X * 4. The name of the the Author may be used to endorse or promote 
  668. X *    products derived from this software without specific prior written 
  669. X *    permission.
  670. X *
  671. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 
  672. X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  673. X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
  674. X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
  675. X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  676. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  677. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  678. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  679. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  680. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  681. X * SUCH DAMAGE.
  682. X */
  683. X#include "NoteOn.h"
  684. X
  685. XNoteOnEvent::NoteOnEvent()
  686. X{
  687. X}
  688. X
  689. XNoteOnEvent::NoteOnEvent(unsigned long t, unsigned char chan,
  690. X    unsigned char pit, unsigned char vel, const NoteEvent *np) :
  691. X    NoteEvent(t, chan, pit, vel, np)
  692. X{
  693. X}
  694. X
  695. XNoteOnEvent::NoteOnEvent(const NoteOnEvent &e) : NoteEvent(e)
  696. X{
  697. X}
  698. X
  699. XNoteOnEvent &
  700. XNoteOnEvent::operator=(const NoteOnEvent &e)
  701. X{
  702. X
  703. X    (NoteEvent)*this = (NoteEvent)e;
  704. X    return (*this);
  705. X}
  706. X
  707. Xchar *
  708. XNoteOnEvent::GetEventStr(void) const
  709. X{
  710. X
  711. X    return (NoteEvent::GetEventStr());
  712. X}
  713. X
  714. Xostream &
  715. Xoperator<<(ostream &os, const NoteOnEvent &e)
  716. X{
  717. X    char *str;
  718. X
  719. X    os << (str = e.GetEventStr());
  720. X    delete str;
  721. X    return (os);
  722. X}
  723. END_OF_FILE
  724.   if test 2295 -ne `wc -c <'tclmidi-2.0/events/NoteOn.C'`; then
  725.     echo shar: \"'tclmidi-2.0/events/NoteOn.C'\" unpacked with wrong size!
  726.   fi
  727.   # end of 'tclmidi-2.0/events/NoteOn.C'
  728. fi
  729. if test -f 'tclmidi-2.0/events/TODO' -a "${1}" != "-c" ; then 
  730.   echo shar: Will not clobber existing file \"'tclmidi-2.0/events/TODO'\"
  731. else
  732.   echo shar: Extracting \"'tclmidi-2.0/events/TODO'\" \(1 character\)
  733.   sed "s/^X//" >'tclmidi-2.0/events/TODO' <<'END_OF_FILE'
  734. X
  735. END_OF_FILE
  736.   if test 1 -ne `wc -c <'tclmidi-2.0/events/TODO'`; then
  737.     echo shar: \"'tclmidi-2.0/events/TODO'\" unpacked with wrong size!
  738.   fi
  739.   # end of 'tclmidi-2.0/events/TODO'
  740. fi
  741. if test -f 'tclmidi-2.0/man/Makefile' -a "${1}" != "-c" ; then 
  742.   echo shar: Will not clobber existing file \"'tclmidi-2.0/man/Makefile'\"
  743. else
  744.   echo shar: Extracting \"'tclmidi-2.0/man/Makefile'\" \(1220 characters\)
  745.   sed "s/^X//" >'tclmidi-2.0/man/Makefile' <<'END_OF_FILE'
  746. X#
  747. X# This is the command to format the man pages
  748. X#
  749. XROFF = groff -mandoc -Tascii
  750. X
  751. X#
  752. X# This is where you want the man pages to go
  753. X#
  754. XMANPATH = /usr/local/man
  755. X
  756. X#
  757. X# These are the ownships of the man pages
  758. X#
  759. XMANOWN = bin
  760. XMANGRP = bin
  761. X
  762. XMANN = midiconfig.n midievents.n midifree.n midiget.n midimake.n \
  763. X       midimerge.n midiplay.n midiput.n midiread.n midirecord.n \
  764. X       midirewind.n midisplit.n midistop.n midiwait.n midiwrite.n \
  765. X       midiversion.n midimove.n midicopy.n mididelete.n miditrack.n \
  766. X       mididevice.n
  767. XMAN1 = mplay.1 mrec.1 tclmidi.1 minfo.1 midtotcl.1
  768. X
  769. XMANNCOOKED = midiconfig.0 midievents.0 midifree.0 midiget.0 midimake.0 \
  770. X       midimerge.0 midiplay.0 midiput.0 midiread.0 midirecord.0 \
  771. X       midirewind.0 midisplit.0 midistop.0 midiwait.0 midiwrite.0 \
  772. X       midiversion.0 midimove.0 midicopy.0 mididelete.0 miditrack.0 \
  773. X       mididevice.0
  774. XMAN1COOKED = mplay.0 mrec.0 tclmidi.0 minfo.0 midtotcl.0
  775. X
  776. X.SUFFIXES: .0 .1 .n
  777. X
  778. Xinstall-raw:
  779. X    cp $(MANN) $(MANPATH)/mann
  780. X    cp $(MAN1) $(MANPATH)/man1
  781. X
  782. Xinstall-cooked: $(MANNCOOKED) $(MAN1COOKED)
  783. X    cp $(MANNCOOKED) $(MANPATH)/catn
  784. X    cp $(MAN1COOKED) $(MANPATH)/cat1
  785. X
  786. Xclean:
  787. X    rm -f $(MANNCOOKED) $(MAN1COOKED)
  788. X
  789. X.1.0:
  790. X    $(ROFF) $< > $@
  791. X
  792. X.n.0:
  793. X    $(ROFF) $< > $@
  794. END_OF_FILE
  795.   if test 1220 -ne `wc -c <'tclmidi-2.0/man/Makefile'`; then
  796.     echo shar: \"'tclmidi-2.0/man/Makefile'\" unpacked with wrong size!
  797.   fi
  798.   # end of 'tclmidi-2.0/man/Makefile'
  799. fi
  800. if test -f 'tclmidi-2.0/man/midiconfig.n' -a "${1}" != "-c" ; then 
  801.   echo shar: Will not clobber existing file \"'tclmidi-2.0/man/midiconfig.n'\"
  802. else
  803.   echo shar: Extracting \"'tclmidi-2.0/man/midiconfig.n'\" \(2112 characters\)
  804.   sed "s/^X//" >'tclmidi-2.0/man/midiconfig.n' <<'END_OF_FILE'
  805. X.Dd January 14, 1994
  806. X.Dt MIDICONFIG N
  807. X.Os
  808. X.Sh NAME
  809. X.Nm midiconfig
  810. X.Nd "tclmidi command to get or modify the configuration values of a MIDI song"
  811. X.Sh SYNOPSIS
  812. X.Nm
  813. X.Ar mfileId
  814. X.Op format Op value
  815. X.Op division Op value
  816. X.Op tracks Op value
  817. X.Sh DESCRIPTION
  818. X.Nm
  819. Xis a
  820. X.Xr tclmidi 1
  821. Xcommand that
  822. Xgets or modifies the configurations
  823. Xvalues of
  824. Xa \%MIDI song.
  825. X.Pp
  826. XWithout arguments
  827. X.Nm
  828. Xreports all three configuration values.
  829. XIt can also take up to three optional arguments.
  830. XAll arguments should be lists consisting of the parameter
  831. Xname followed by an optional value.
  832. XIf a value for a parameter is not specified then the current
  833. Xsetting is reported.
  834. XIf a value is specified then the song parameter is changed.
  835. X.Pp
  836. XmfileId is a valid \%MIDI song identifier as returned by
  837. X.Xr midimake n
  838. Xor
  839. X.Xr midiread n .
  840. X.Pp
  841. XThe different parameters are:
  842. X.Bl -tag -width division
  843. X.It format
  844. XThis option determines the song type.
  845. XThere are three valid values: 0, 1 and 2.
  846. XA format 0 song has only one track which
  847. Xintermixes meta and normal events.
  848. XA format 1 song can have many tracks, but
  849. Xtrack 0 always contains most of the meta events,
  850. Xspecifically MetaTempo events.
  851. XA format 2 song is similar to format 1, but
  852. Xeach track can be played separately instead
  853. Xof playing them all in parallel.
  854. X.It division
  855. XThis specifies the resolution of the timing
  856. Xfor the song.
  857. XIf the unit of quanta for a song is is clock
  858. Xtick, there will be
  859. X.Em value
  860. Xclock ticks per
  861. Xbeat.
  862. X.It tracks
  863. XThis option specifies the number of tracks
  864. Xin the song.
  865. XThese will by dynamically created and freed
  866. Xautomatically.
  867. XThe tracks are numbered 0 through
  868. X.Em value
  869. X- 1 including.
  870. XA format 0 song should have only one track.
  871. X.El
  872. X.Sh RETURN VALUES
  873. XIf parameters are being set,
  874. X.Nm
  875. Xwill return nothing.
  876. XIf parameters are being queried,
  877. Xa list of lists will be returned.
  878. XEach sublist will contain the parameter
  879. Xname and its associated value.
  880. XThe parameters are returned in the order
  881. Xspecified or in the order
  882. X.Em format, division, tracks
  883. Xif
  884. X.Nm
  885. Xis called without arguments.
  886. X.Sh SEE ALSO
  887. X.Xr tclmidi 1 ,
  888. X.Xr midiread n ,
  889. X.Xr midimake n
  890. X.Sh AUTHOR
  891. XMike Durian - durian@boogie.com
  892. END_OF_FILE
  893.   if test 2112 -ne `wc -c <'tclmidi-2.0/man/midiconfig.n'`; then
  894.     echo shar: \"'tclmidi-2.0/man/midiconfig.n'\" unpacked with wrong size!
  895.   fi
  896.   # end of 'tclmidi-2.0/man/midiconfig.n'
  897. fi
  898. if test -f 'tclmidi-2.0/man/midicopy.n' -a "${1}" != "-c" ; then 
  899.   echo shar: Will not clobber existing file \"'tclmidi-2.0/man/midicopy.n'\"
  900. else
  901.   echo shar: Extracting \"'tclmidi-2.0/man/midicopy.n'\" \(1766 characters\)
  902.   sed "s/^X//" >'tclmidi-2.0/man/midicopy.n' <<'END_OF_FILE'
  903. X.Dd April 13, 1994
  904. X.Dt MIDICOPY N
  905. X.Os
  906. X.Sh NAME
  907. X.Nm midicopy
  908. X.Nd "tclmidi command to copy a range of events in a MIDI song"
  909. X.Sh SYNOPSIS
  910. X.Nm
  911. X.Pf { Ar destMidiID destTrack Ns }
  912. X.Ar destStartTime
  913. X.Pf { Ar srcMidiID srcTrack Ns }
  914. X.Ar srcStartTime
  915. X.Ar srcEndTime
  916. X.Sh DESCRIPTION
  917. X.Nm
  918. Xis a
  919. X.Xr tclmidi 1
  920. Xcommand that
  921. Xcopies a range of events.
  922. XThese events can be copied from one track to another,
  923. Xor copied within the same track.
  924. XThe source range may overlap with the destination.
  925. X.Pp
  926. XThe first argument is a list specifying a particular track
  927. Xin a \%MIDI song.
  928. XThe first element of this list is a \%MIDI song identifier
  929. Xas returned by
  930. X.Xr midimake n ,
  931. Xor
  932. X.Xr midinew n .
  933. XThe second element is a valid track number in the \%MIDI song.
  934. XThis list specifies the destination track for the copy.
  935. X.Pp
  936. XThe third argument is the time to start depositing the
  937. Xevents specified in the source range.
  938. XNote, the first event might not be placed at exactly the
  939. Xrequested time if an event does not occur at the start
  940. Xtime for the source range.
  941. XThe offset between the first event and the destination start
  942. Xtime will be the same as the offset between the first event
  943. Xfound in the source range and the start time of the source range.
  944. X.Pp
  945. XThe fourth argument is another list identical in form to
  946. Xthe list identifying the destination track.
  947. XThis list specified the source track.
  948. X.Pp
  949. XThe fifth and last arguments specify the range of events to
  950. Xbe copied.
  951. XThey determine the start and end times of the range.
  952. XAll events found at time
  953. X.Ar srcStartTime
  954. Xup to, but not including events found at time
  955. X.Ar srcEndTime
  956. Xwill be copied.
  957. X.Sh RETURN VALUES
  958. X.Nm
  959. Xdoes not return anything.
  960. X.Sh SEE ALSO
  961. X.Xr tclmidi 1 ,
  962. X.Xr midiread n ,
  963. X.Xr midimake n ,
  964. X.Xr midimove n
  965. X.Sh AUTHOR
  966. XMike Durian - durian@boogie.com
  967. END_OF_FILE
  968.   if test 1766 -ne `wc -c <'tclmidi-2.0/man/midicopy.n'`; then
  969.     echo shar: \"'tclmidi-2.0/man/midicopy.n'\" unpacked with wrong size!
  970.   fi
  971.   # end of 'tclmidi-2.0/man/midicopy.n'
  972. fi
  973. if test -f 'tclmidi-2.0/man/mididelete.n' -a "${1}" != "-c" ; then 
  974.   echo shar: Will not clobber existing file \"'tclmidi-2.0/man/mididelete.n'\"
  975. else
  976.   echo shar: Extracting \"'tclmidi-2.0/man/mididelete.n'\" \(1197 characters\)
  977.   sed "s/^X//" >'tclmidi-2.0/man/mididelete.n' <<'END_OF_FILE'
  978. X.Dd April 13, 1994
  979. X.Dt MIDIDELETE N
  980. X.Os
  981. X.Sh NAME
  982. X.Nm mididelete
  983. X.Nd "tclmidi command to delete an event or events in a MIDI song"
  984. X.Sh SYNOPSIS
  985. X.Nm
  986. X.Ar MidiID
  987. X.Ar track
  988. X.Ar event
  989. X.br
  990. X.Nm
  991. X.Ar MidiID
  992. X.Ar track
  993. X.Ar Dq range
  994. X.Ar start
  995. X.Ar end
  996. X.Sh DESCRIPTION
  997. X.Nm
  998. Xis a
  999. X.Xr tclmidi 1
  1000. Xcommand that
  1001. Xdeletes one or more events from a specified
  1002. Xtrack in a \%MIDI song.
  1003. XThe first argument is a \%MIDI song descriptor
  1004. Xas returned by
  1005. X.Xr midimake n
  1006. Xor
  1007. X.Xr midiread n .
  1008. XThe second argument is the track in the \%MIDI song.
  1009. XIn the first form, the third argument is a specific event
  1010. Xto remove.
  1011. XFor formatting of events, see
  1012. X.Xr midievents n .
  1013. X.Pp
  1014. XIn the second form, the third argument is the string
  1015. X.Dq range .
  1016. XThe fourth argument is then the start time of events
  1017. Xto be delete and the last argument is the end time of
  1018. Xthe range.
  1019. XAll events starting at time
  1020. X.Ar start
  1021. Xup to but not including events at time
  1022. X.Ar end
  1023. Xare then deleted.
  1024. X.Sh RETURN VALUES
  1025. X.Nm
  1026. Xreturns a 1 if the event or events were successfully removed,
  1027. Xor 0 if, in the first case, the event could not be found.
  1028. X.Sh SEE ALSO
  1029. X.Xr tclmidi 1 ,
  1030. X.Xr midiread n ,
  1031. X.Xr midimake n ,
  1032. X.Xr midiput n ,
  1033. X.Xr midievents n
  1034. X.Sh AUTHOR
  1035. XMike Durian - durian@boogie.com
  1036. END_OF_FILE
  1037.   if test 1197 -ne `wc -c <'tclmidi-2.0/man/mididelete.n'`; then
  1038.     echo shar: \"'tclmidi-2.0/man/mididelete.n'\" unpacked with wrong size!
  1039.   fi
  1040.   # end of 'tclmidi-2.0/man/mididelete.n'
  1041. fi
  1042. if test -f 'tclmidi-2.0/man/mididevice.n' -a "${1}" != "-c" ; then 
  1043.   echo shar: Will not clobber existing file \"'tclmidi-2.0/man/mididevice.n'\"
  1044. else
  1045.   echo shar: Extracting \"'tclmidi-2.0/man/mididevice.n'\" \(1615 characters\)
  1046.   sed "s/^X//" >'tclmidi-2.0/man/mididevice.n' <<'END_OF_FILE'
  1047. X.Dd July 11, 1994
  1048. X.Dt MIDIDEVICE N
  1049. X.Os
  1050. X.Sh NAME
  1051. X.Nm mididevice
  1052. X.Nd "tclmidi command to get or modify MIDI device configuration values"
  1053. X.Sh SYNOPSIS
  1054. X.Nm
  1055. X.Op name Op value
  1056. X.Op midithru Op value
  1057. X.Sh DESCRIPTION
  1058. X.Nm
  1059. Xis a
  1060. X.Xr tclmidi 1
  1061. Xcommand that
  1062. Xgets or modifies the configurations
  1063. Xvalues for a MIDI device.
  1064. XCurrently, only two configuration values are support, though
  1065. Xmore might be added in the future.
  1066. X.Pp
  1067. XWithout arguments
  1068. X.Nm
  1069. Xreports all configuration values.
  1070. XIt can also take option arguments.
  1071. XAll arguments should be lists consisting of the parameter
  1072. Xname followed by an optional value.
  1073. XIf a value for a parameter is not specified then the current
  1074. Xsetting is reported.
  1075. XIf a value is specified then that parameter is changed.
  1076. X.Pp
  1077. XThe different parameters are:
  1078. X.Bl -tag -width division
  1079. X.It name
  1080. XThis controls the device interface name.
  1081. XThe default value is
  1082. X.Dq /dev/midi0 .
  1083. X.It midithru
  1084. XThis paramter controls if data arriving at the \%MIDI IN
  1085. Xport is passed to the \%MIDI OUT port.
  1086. XBy default it is not.
  1087. XThe parameter is a boolean value and should be one of
  1088. X.Dq yes ,
  1089. X.Dq on ,
  1090. X.Dq true ,
  1091. X.Dq 1 ,
  1092. X.Dq no ,
  1093. X.Dq off ,
  1094. X.Dq false
  1095. Xor
  1096. X.Dq 0 .
  1097. X.El
  1098. X.Sh RETURN VALUES
  1099. XIf parameters are being set,
  1100. X.Nm
  1101. Xwill return nothing.
  1102. XIf parameters are being queried,
  1103. Xa list of lists will be returned.
  1104. XEach sublist will contain the parameter
  1105. Xname and its associated value.
  1106. XThe parameters are returned in the order
  1107. Xspecified or in the order
  1108. X.Em name, midithru
  1109. Xif
  1110. X.Nm
  1111. Xis called without arguments.
  1112. X.Pp
  1113. XIf there is no device configured with tclmidi,
  1114. X.Nm
  1115. Xwill return 0.
  1116. X.Sh SEE ALSO
  1117. X.Xr tclmidi 1
  1118. X.Sh AUTHOR
  1119. XMike Durian - durian@boogie.com
  1120. END_OF_FILE
  1121.   if test 1615 -ne `wc -c <'tclmidi-2.0/man/mididevice.n'`; then
  1122.     echo shar: \"'tclmidi-2.0/man/mididevice.n'\" unpacked with wrong size!
  1123.   fi
  1124.   # end of 'tclmidi-2.0/man/mididevice.n'
  1125. fi
  1126. if test -f 'tclmidi-2.0/man/midimerge.n' -a "${1}" != "-c" ; then 
  1127.   echo shar: Will not clobber existing file \"'tclmidi-2.0/man/midimerge.n'\"
  1128. else
  1129.   echo shar: Extracting \"'tclmidi-2.0/man/midimerge.n'\" \(1287 characters\)
  1130.   sed "s/^X//" >'tclmidi-2.0/man/midimerge.n' <<'END_OF_FILE'
  1131. X.Dd January 30, 1994
  1132. X.Dt MIDIMERGE N
  1133. X.Os
  1134. X.Sh NAME
  1135. X.Nm midimerge
  1136. X.Nd "tclmdi command to merge multiple tracks of MIDI songs to one track"
  1137. X.Sh SYNOPSIS
  1138. X.Nm
  1139. X.Pf { Ar destMidiID destTrack Ns }
  1140. X.Pf { Ar srcMidiID srcTrack Ns }
  1141. X.Op { Ar srcMidiID srcTrack Ns } ...
  1142. X.Sh DESCRIPTION
  1143. X.Nm
  1144. Xis a
  1145. X.Xr tclmidi 1
  1146. Xcommand that
  1147. Xmerges one or more source tracks to a single destination track
  1148. Xof a \%MIDI song.
  1149. XThe first option is a list that designates output track.
  1150. XThe first element of that list is the \%MIDI song descriptor
  1151. Xfor the track, and the second argument of the list is the
  1152. Xtrack in that \%MIDI song.
  1153. X.Pp
  1154. XThe second, and optional remaining arguments, are lists specifying
  1155. Xthe source tracks.
  1156. XThe form of the source lists is the same as that for the destination
  1157. Xtrack.
  1158. X.Pp
  1159. XThe times of events in a source track are adjusted as necessary to convert
  1160. Xfrom the division of the source track to the division of the
  1161. Xdestination track.
  1162. XSee
  1163. X.Xr midiconfig n
  1164. Xfor a description of the division song configuration option.
  1165. X.Pp
  1166. XAll \%MIDI song descriptors should be values returned from a
  1167. Xcall to
  1168. X.Xr midimake n
  1169. Xor
  1170. X.Xr midiread n .
  1171. X.Sh RETURN VALUES
  1172. X.Nm
  1173. Xreturns nothing.
  1174. X.Sh SEE ALSO
  1175. X.Xr tclm 1 ,
  1176. X.Xr midiconfig n ,
  1177. X.Xr midisplit n ,
  1178. X.Xr midimake n ,
  1179. X.Xr midiread n
  1180. X.Sh AUTHOR
  1181. XMike Durian - durian@boogie.com
  1182. END_OF_FILE
  1183.   if test 1287 -ne `wc -c <'tclmidi-2.0/man/midimerge.n'`; then
  1184.     echo shar: \"'tclmidi-2.0/man/midimerge.n'\" unpacked with wrong size!
  1185.   fi
  1186.   # end of 'tclmidi-2.0/man/midimerge.n'
  1187. fi
  1188. if test -f 'tclmidi-2.0/man/midimove.n' -a "${1}" != "-c" ; then 
  1189.   echo shar: Will not clobber existing file \"'tclmidi-2.0/man/midimove.n'\"
  1190. else
  1191.   echo shar: Extracting \"'tclmidi-2.0/man/midimove.n'\" \(1761 characters\)
  1192.   sed "s/^X//" >'tclmidi-2.0/man/midimove.n' <<'END_OF_FILE'
  1193. X.Dd April 13, 1994
  1194. X.Dt MIDIMOVE N
  1195. X.Os
  1196. X.Sh NAME
  1197. X.Nm midimove
  1198. X.Nd "tclmidi command to move a range of events in a MIDI song"
  1199. X.Sh SYNOPSIS
  1200. X.Nm
  1201. X.Pf { Ar destMidiID destTrack Ns }
  1202. X.Ar destStartTime
  1203. X.Pf { Ar srcMidiID srcTrack Ns }
  1204. X.Ar srcStartTime
  1205. X.Ar srcEndTime
  1206. X.Sh DESCRIPTION
  1207. X.Nm
  1208. Xis a
  1209. X.Xr tclmidi 1
  1210. Xcommand that
  1211. Xmoves a range of events.
  1212. XThese events can be moved from one track to another,
  1213. Xor moved within the same track.
  1214. XThe source range may overlap with the destination.
  1215. X.Pp
  1216. XThe first argument is a list specifying a particular track
  1217. Xin a \%MIDI song.
  1218. XThe first element of this list is a \%MIDI song identifier
  1219. Xas returned by
  1220. X.Xr midimake n ,
  1221. Xor
  1222. X.Xr midinew n .
  1223. XThe second element is a valid track number in the \%MIDI song.
  1224. XThis list specifies the destination track for the move.
  1225. X.Pp
  1226. XThe third argument is the time to start depositing the
  1227. Xevents specified in the source range.
  1228. XNote, the first event might not be placed at exactly the
  1229. Xrequested time if an event does not occur at the start
  1230. Xtime for the source range.
  1231. XThe offset between the first event and the destination start
  1232. Xtime will be the same as the offset between the first event
  1233. Xfound in the source range and the start time of the source range.
  1234. X.Pp
  1235. XThe fourth argument is another list identical in form to
  1236. Xthe list identifying the destination track.
  1237. XThis list specified the source track.
  1238. X.Pp
  1239. XThe fifth and last arguments specify the range of events to
  1240. Xbe moved.
  1241. XThey determine the start and end times of the range.
  1242. XAll events found at time
  1243. X.Ar srcStartTime
  1244. Xup to, but not including events found at time
  1245. X.Ar srcEndTime
  1246. Xwill be moved.
  1247. X.Sh RETURN VALUES
  1248. X.Nm
  1249. Xdoes not return anything.
  1250. X.Sh SEE ALSO
  1251. X.Xr tclmidi 1 ,
  1252. X.Xr midiread n ,
  1253. X.Xr midimake n ,
  1254. X.Xr midicopy n
  1255. X.Sh AUTHOR
  1256. XMike Durian - durian@boogie.com
  1257. END_OF_FILE
  1258.   if test 1761 -ne `wc -c <'tclmidi-2.0/man/midimove.n'`; then
  1259.     echo shar: \"'tclmidi-2.0/man/midimove.n'\" unpacked with wrong size!
  1260.   fi
  1261.   # end of 'tclmidi-2.0/man/midimove.n'
  1262. fi
  1263. if test -f 'tclmidi-2.0/man/miditrack.n' -a "${1}" != "-c" ; then 
  1264.   echo shar: Will not clobber existing file \"'tclmidi-2.0/man/miditrack.n'\"
  1265. else
  1266.   echo shar: Extracting \"'tclmidi-2.0/man/miditrack.n'\" \(1281 characters\)
  1267.   sed "s/^X//" >'tclmidi-2.0/man/miditrack.n' <<'END_OF_FILE'
  1268. X.Dd June 22, 1994
  1269. X.Dt MIDITRACK N
  1270. X.Os
  1271. X.Sh NAME
  1272. X.Nm miditrack
  1273. X.Nd "tclmidi command to get information about a MIDI track"
  1274. X.Sh SYNOPSIS
  1275. X.Nm
  1276. X.Ar mfileId
  1277. X.Ar track
  1278. X.Ar {start|end}
  1279. X.Sh DESCRIPTION
  1280. X.Nm
  1281. Xis a
  1282. X.Xr tclmidi 1
  1283. Xcommand that
  1284. Xgets information about a \%MIDI track.
  1285. XCurrently two types of information can be obtained.
  1286. XThese are the time of the first event found in
  1287. Xthe track, and the time of the last event in the track.
  1288. XThe time of the last event in the track might be different
  1289. Xthan that returned by a call to
  1290. X.Xr midiget
  1291. Xgetting the last event in a track.
  1292. XThis is because
  1293. X.Xr midiget
  1294. Xreturns NoteOn/NoteOff event pairs as a single Note
  1295. Xevent, and the Note event contains the time of the
  1296. XNoteOn event.
  1297. X.Nm
  1298. Xwill return the time of the last event in a file
  1299. Xincluding NoteOff halves of Note events.
  1300. X.Pp
  1301. XThe first argument to
  1302. X.Nm
  1303. Xis a \%MIDI song identifier.
  1304. XThe second argument is a track number of that song,
  1305. Xand the last argument is one of either
  1306. X.Dq start
  1307. Xor
  1308. X.Dq end Ns .
  1309. X.Sh RETURN VALUES
  1310. X.Nm
  1311. Xreturns the time of the first or last event in a track
  1312. Xfor the
  1313. X.Ar start
  1314. Xand
  1315. X.Ar end
  1316. Xoptions.
  1317. X.Sh NOTES
  1318. X.Nm
  1319. Xmight be expanded in the future to supply other types
  1320. Xof information about \%MIDI tracks.
  1321. X.Sh SEE ALSO
  1322. X.Xr tclmidi 1 ,
  1323. X.Xr midiget n
  1324. X.Sh AUTHOR
  1325. XMike Durian - durian@boogie.com
  1326. END_OF_FILE
  1327.   if test 1281 -ne `wc -c <'tclmidi-2.0/man/miditrack.n'`; then
  1328.     echo shar: \"'tclmidi-2.0/man/miditrack.n'\" unpacked with wrong size!
  1329.   fi
  1330.   # end of 'tclmidi-2.0/man/miditrack.n'
  1331. fi
  1332. if test -f 'tclmidi-2.0/man/mrec.1' -a "${1}" != "-c" ; then 
  1333.   echo shar: Will not clobber existing file \"'tclmidi-2.0/man/mrec.1'\"
  1334. else
  1335.   echo shar: Extracting \"'tclmidi-2.0/man/mrec.1'\" \(2176 characters\)
  1336.   sed "s/^X//" >'tclmidi-2.0/man/mrec.1' <<'END_OF_FILE'
  1337. X.Dd February 10, 1994
  1338. X.Dt MREC 1
  1339. X.Os
  1340. X.Sh NAME
  1341. X.Nm mrec
  1342. X.Nd "a tclmidi script to record a MIDI file"
  1343. X.Sh SYNOPSIS
  1344. X.Nm
  1345. X.Op Fl merge
  1346. X.Op Fl thru
  1347. X.Oo
  1348. X.Op Fl repeat
  1349. X.Fl play Ar play_filename
  1350. X.Oc
  1351. X.Op Fl tempo Ar tempo
  1352. X.Op rec_filename
  1353. X.Sh DESCRIPTION
  1354. X.Nm
  1355. Xis a
  1356. X.Xr tclmidi 1
  1357. Xscript that records a \%MIDI file while optionally
  1358. Xsimultaneously playing another \%MIDI file.
  1359. XIf a record filename is not specified, the recorded
  1360. X\%MIDI file will be written to stdout.
  1361. XBy default
  1362. X.Nm
  1363. Xcreates a format 0 \%MIDI file containing the recorded
  1364. Xevents and any meta events found in the optional play file.
  1365. XThe options are as follows:
  1366. X.Bl -tag -width Fl repeat
  1367. X.It Fl thru
  1368. XIf this flag is specified, data arriving at the \%MIDI IN
  1369. Xport will be passed to the \%MIDI OUT port.
  1370. XBy default, the data is not passed.
  1371. X.It Fl merge
  1372. XWith this option,
  1373. X.Nm
  1374. Xwill create a format 1 \%MIDI file from a combination
  1375. Xof the newly recorded events and the tracks contained
  1376. Xin the optional play file.
  1377. XIf the play file is a format 0 file, it will be split
  1378. Xinto a format 1 file.
  1379. XThe recorded events will appear as a new track after
  1380. Xall the tracks found in the play file.
  1381. X.It Fl repeat
  1382. XThis option specifies that the play file should be repeated
  1383. Xuntil recording is finished.
  1384. XIt is only valid with the
  1385. X.Fl play
  1386. Xoption.
  1387. X.It Fl play
  1388. XThis option specifies that another \%MIDI file should
  1389. Xbe played while recording.
  1390. X.It Fl tempo
  1391. XThis option specifies the tempo to use for recording.
  1392. XIt is only valid if a play file is not specified.
  1393. XIf a play file is specified, tempos are taken from
  1394. Xit instead.
  1395. XThe default tempo is 120 bpm.
  1396. X.El
  1397. X.Pp
  1398. XIf a play song is specified, a message will be printed saying
  1399. Xthe file is being loaded.
  1400. XOnce loaded, the program will wait for the return key
  1401. Xto be pressed before beginning to record.
  1402. XIf a play file is specified and is not playing in repeat mode,
  1403. Xrecording will stop when the play file ends.
  1404. XOtherwise, recording stops when a return key is pressed.
  1405. X.Pp
  1406. XSince
  1407. X.Nm
  1408. Xmakes use of the
  1409. X.Xr midirecord n
  1410. X.Xr tclmidi 1
  1411. Xcommand,
  1412. Xthis program will only work
  1413. Xif
  1414. X.Xr tclmidi 1
  1415. Xwas compiled with a device
  1416. Xinterface.
  1417. X.Sh SEE ALSO
  1418. X.Xr tclmidi 1 ,
  1419. X.Xr midirecord n
  1420. X.Sh AUTHORS
  1421. XMike Durian - durian@boogie.com
  1422. END_OF_FILE
  1423.   if test 2176 -ne `wc -c <'tclmidi-2.0/man/mrec.1'`; then
  1424.     echo shar: \"'tclmidi-2.0/man/mrec.1'\" unpacked with wrong size!
  1425.   fi
  1426.   # end of 'tclmidi-2.0/man/mrec.1'
  1427. fi
  1428. if test -f 'tclmidi-2.0/rb/list.c' -a "${1}" != "-c" ; then 
  1429.   echo shar: Will not clobber existing file \"'tclmidi-2.0/rb/list.c'\"
  1430. else
  1431.   echo shar: Extracting \"'tclmidi-2.0/rb/list.c'\" \(2221 characters\)
  1432.   sed "s/^X//" >'tclmidi-2.0/rb/list.c' <<'END_OF_FILE'
  1433. X/* 
  1434. X * /home/angeleys/durian/cvs/tclm2/rb/list.c,v
  1435. X * 1.2
  1436. X * 1994/06/23 21:50:27
  1437. X * durian
  1438. X */
  1439. X
  1440. X#include <stdio.h>    /* Basic includes and definitions */
  1441. X#include <stdlib.h>
  1442. X#include "list.h"
  1443. X
  1444. X#define boolean int
  1445. X#define TRUE 1
  1446. X#define FALSE 0
  1447. X
  1448. X
  1449. X/*---------------------------------------------------------------------*
  1450. X * PROCEDURES FOR MANIPULATING DOUBLY LINKED LISTS 
  1451. X * Each list contains a sentinal node, so that     
  1452. X * the first item in list l is l->flink.  If l is  
  1453. X * empty, then l->flink = l->blink = l.            
  1454. X * The sentinal contains extra information so that these operations
  1455. X * can work on lists of any size and type.
  1456. X * Memory management is done explicitly to avoid the slowness of
  1457. X * malloc and free.  The node size and the free list are contained
  1458. X * in the sentinal node.
  1459. X *---------------------------------------------------------------------*/
  1460. X
  1461. Xtypedef struct int_list {  /* Information held in the sentinal node */
  1462. X  struct int_list *flink;
  1463. X  struct int_list *blink;
  1464. X  int size;
  1465. X  List free_list;
  1466. X} *Int_list;
  1467. X
  1468. Xvoid
  1469. Xinsert(item, list)    /* Inserts to the end of a list */
  1470. XList item;
  1471. XList list;
  1472. X{
  1473. X  List last_node;
  1474. X
  1475. X  last_node = list->blink;
  1476. X
  1477. X  list->blink = item;
  1478. X  last_node->flink = item;
  1479. X  item->blink = last_node;
  1480. X  item->flink = list;
  1481. X}
  1482. X
  1483. Xvoid
  1484. Xdelete_item(item)        /* Deletes an arbitrary iterm */
  1485. XList item;
  1486. X{
  1487. X  item->flink->blink = item->blink;
  1488. X  item->blink->flink = item->flink;
  1489. X}
  1490. X
  1491. XList make_list(size)    /* Creates a new list */
  1492. Xint size;
  1493. X{
  1494. X  Int_list l;
  1495. X
  1496. X  l = (Int_list) malloc(sizeof(struct int_list));
  1497. X  l->flink = l;
  1498. X  l->blink = l;
  1499. X  l->size = size;
  1500. X  l->free_list = (List) malloc (sizeof(struct list));
  1501. X  l->free_list->flink = l->free_list;
  1502. X  return (List) l;
  1503. X}
  1504. X  
  1505. XList get_node(list)   /* Allocates a node to be inserted into the list */
  1506. XList list;
  1507. X{
  1508. X  Int_list l;
  1509. X  List to_return;
  1510. X
  1511. X  l = (Int_list) list;
  1512. X  if (l->free_list->flink == l->free_list) {
  1513. X    return (List) malloc(l->size);
  1514. X  } else {
  1515. X    to_return = l->free_list;
  1516. X    l->free_list = to_return->flink;
  1517. X    return to_return;
  1518. X  }
  1519. X}
  1520. X
  1521. Xvoid
  1522. Xfree_node(node, list)    /* Deallocates a node from the list */
  1523. XList node;
  1524. XList list;
  1525. X{
  1526. X  Int_list l;
  1527. X  
  1528. X  l = (Int_list) list;
  1529. X  node->flink = l->free_list;
  1530. X  l->free_list = node;
  1531. X}
  1532. END_OF_FILE
  1533.   if test 2221 -ne `wc -c <'tclmidi-2.0/rb/list.c'`; then
  1534.     echo shar: \"'tclmidi-2.0/rb/list.c'\" unpacked with wrong size!
  1535.   fi
  1536.   # end of 'tclmidi-2.0/rb/list.c'
  1537. fi
  1538. if test -f 'tclmidi-2.0/rb/list.h' -a "${1}" != "-c" ; then 
  1539.   echo shar: Will not clobber existing file \"'tclmidi-2.0/rb/list.h'\"
  1540. else
  1541.   echo shar: Extracting \"'tclmidi-2.0/rb/list.h'\" \(1330 characters\)
  1542.   sed "s/^X//" >'tclmidi-2.0/rb/list.h' <<'END_OF_FILE'
  1543. X/* 
  1544. X * /home/angeleys/durian/cvs/tclm2/rb/list.h,v
  1545. X * 1.2
  1546. X * 1994/06/23 21:50:28
  1547. X * durian
  1548. X */
  1549. X
  1550. X/* This is the header file for the list manipulation routines in list.c.
  1551. X * Any struct can be turned into a list as long as its first two fields are
  1552. X * flink and blink. */
  1553. X
  1554. Xtypedef struct list {
  1555. X  struct list *flink;
  1556. X  struct list *blink;
  1557. X} *List;
  1558. X
  1559. X/* Nil, first, next, and prev are macro expansions for list traversal 
  1560. X * primitives. */
  1561. X
  1562. X#ifndef nil
  1563. X#define nil(l) (l)
  1564. X#endif
  1565. X#define first(l) (l->flink)
  1566. X#define last(l) (l->blink)
  1567. X#define next(n) (n->flink)
  1568. X#define prev(n) (n->blink)
  1569. X
  1570. X#define mklist(t) ((t *) make_list (sizeof(t)))
  1571. X
  1572. X/* These are the routines for manipluating lists */
  1573. X
  1574. X/* void insert(node list);     Inserts a node to the end of a list */
  1575. X/* void delete_item(node);     Deletes an arbitrary node */
  1576. X/* List make_list(node_size);  Creates a new list */
  1577. X/* List get_node(list);        Allocates a node to be inserted into the list */
  1578. X/* void free_node(node, list); Deallocates a node from the list */
  1579. X
  1580. X#ifndef __P
  1581. X#if defined(__STDC__) || defined(__cplusplus)
  1582. X#define __P(protos)    protos
  1583. X#else 
  1584. X#define __P(protos)    ()
  1585. X#endif
  1586. X#endif
  1587. X
  1588. Xextern void insert __P((List, List));
  1589. Xextern void delete_item __P((List));
  1590. Xextern List make_list __P((int));
  1591. Xextern List get_node __P((List));
  1592. Xextern void free_node __P((List, List));
  1593. END_OF_FILE
  1594.   if test 1330 -ne `wc -c <'tclmidi-2.0/rb/list.h'`; then
  1595.     echo shar: \"'tclmidi-2.0/rb/list.h'\" unpacked with wrong size!
  1596.   fi
  1597.   # end of 'tclmidi-2.0/rb/list.h'
  1598. fi
  1599. if test -f 'tclmidi-2.0/rb/rb.h' -a "${1}" != "-c" ; then 
  1600.   echo shar: Will not clobber existing file \"'tclmidi-2.0/rb/rb.h'\"
  1601. else
  1602.   echo shar: Extracting \"'tclmidi-2.0/rb/rb.h'\" \(2401 characters\)
  1603.   sed "s/^X//" >'tclmidi-2.0/rb/rb.h' <<'END_OF_FILE'
  1604. Xtypedef struct {
  1605. X  unsigned red : 1 ;
  1606. X  unsigned internal : 1 ;
  1607. X  unsigned left : 1 ;
  1608. X  unsigned root : 1 ;
  1609. X  unsigned head : 1 ;
  1610. X} status;
  1611. X
  1612. Xtypedef struct rb_node {
  1613. X  union {
  1614. X    struct {
  1615. X      struct rb_node *flink;
  1616. X      struct rb_node *blink;
  1617. X    } list;
  1618. X    struct {
  1619. X      struct rb_node *left;
  1620. X      struct rb_node *right;
  1621. X    } child;
  1622. X  } c;
  1623. X  union {
  1624. X    struct rb_node *parent;
  1625. X    struct rb_node *root;
  1626. X  } p;
  1627. X  status s;
  1628. X  union {
  1629. X    unsigned long ukey;
  1630. X    int ikey;
  1631. X    char *key;
  1632. X    struct rb_node *lext;
  1633. X  } k;
  1634. X  union {
  1635. X    char *val;
  1636. X    struct rb_node *rext;
  1637. X  } v;
  1638. X} *Rb_node;
  1639. X
  1640. X#ifndef __P
  1641. X#if defined(__STDC__) || defined(__cplusplus)
  1642. X#define __P(protos)    protos
  1643. X#else 
  1644. X#define __P(protos)    ()
  1645. X#endif
  1646. X#endif
  1647. X
  1648. Xextern Rb_node make_rb __P(());
  1649. Xextern Rb_node rb_insert_b __P((Rb_node node, char *key, char *value));
  1650. X
  1651. Xextern Rb_node rb_find_key __P((Rb_node tree, char *key));
  1652. Xextern Rb_node rb_find_ikey __P((Rb_node tree, int ikey));
  1653. Xextern Rb_node rb_find_ukey __P((Rb_node tree, unsigned long ukey));
  1654. Xextern Rb_node rb_find_gkey __P((Rb_node tree, char *key, int (*fxn)()));
  1655. X
  1656. Xextern Rb_node rb_find_key_n __P((Rb_node tree, char *key, int *found));
  1657. Xextern Rb_node rb_find_ikey_n __P((Rb_node tree, int ikey, int *found));
  1658. Xextern Rb_node rb_find_ukey_n __P((Rb_node tree, unsigned long ukey,
  1659. X    int *found));
  1660. Xextern Rb_node rb_find_gkey_n __P((Rb_node tree, char *key, int (*fxn)(),
  1661. X    int *found));
  1662. Xextern void rb_delete_node __P((Rb_node node));
  1663. Xextern void rb_free_tree __P((Rb_node node));  /* Deletes and frees an entire tree */
  1664. Xextern char *rb_val __P((Rb_node node));  /* Returns node->v.val
  1665. X                         (this is to shut lint up */
  1666. X
  1667. X#define rb_insert_a(n, k, v) rb_insert_b(n->c.list.flink, k, v)
  1668. X#define rb_insert(t, k, v) rb_insert_b(rb_find_key(t, k), k, v)
  1669. X#define rb_inserti(t, k, v) rb_insert_b(rb_find_ikey(t, k), (char *) k, v)
  1670. X#define rb_insertu(t, k, v) rb_insert_b(rb_find_ukey(t, k), (char *) k, v)
  1671. X#define rb_insertg(t, k, v, f) rb_insert_b(rb_find_gkey(t, k, f), k, v)
  1672. X#define rb_first(n) (n->c.list.flink)
  1673. X#define rb_last(n) (n->c.list.blink)
  1674. X#define rb_next(n) (n->c.list.flink)
  1675. X#define rb_prev(n) (n->c.list.blink)
  1676. X#define rb_empty(t) (t->c.list.flink == t)
  1677. X#ifndef nil
  1678. X#define nil(t) (t)
  1679. X#endif
  1680. X
  1681. X#define rb_traverse(ptr, lst) \
  1682. X  for(ptr = rb_first(lst); ptr != nil(lst); ptr = rb_next(ptr))
  1683. X
  1684. Xextern void recolor __P(());
  1685. Xextern void single_rotate __P(());
  1686. END_OF_FILE
  1687.   if test 2401 -ne `wc -c <'tclmidi-2.0/rb/rb.h'`; then
  1688.     echo shar: \"'tclmidi-2.0/rb/rb.h'\" unpacked with wrong size!
  1689.   fi
  1690.   # end of 'tclmidi-2.0/rb/rb.h'
  1691. fi
  1692. if test -f 'tclmidi-2.0/tests/drange.test' -a "${1}" != "-c" ; then 
  1693.   echo shar: Will not clobber existing file \"'tclmidi-2.0/tests/drange.test'\"
  1694. else
  1695.   echo shar: Extracting \"'tclmidi-2.0/tests/drange.test'\" \(1220 characters\)
  1696.   sed "s/^X//" >'tclmidi-2.0/tests/drange.test' <<'END_OF_FILE'
  1697. X#!../tclmidi
  1698. Xset mf [midimake]
  1699. Xmidiconfig $mf {tracks 1}
  1700. Xmidiput $mf 0 {0 NoteOff 0 1}
  1701. Xmidiput $mf 0 {1 NoteOff 0 1 2}
  1702. Xmidiput $mf 0 {3 NoteOn 0 1 2}
  1703. Xmidiput $mf 0 {4 Note 0 1 2 1}
  1704. Xmidiput $mf 0 {5 KeyPressure 0 1 2}
  1705. Xmidiput $mf 0 {6 Parameter 0 1 2}
  1706. Xmidiput $mf 0 {7 Program 0 1}
  1707. Xmidiput $mf 0 {8 ChannelPressure 0 1}
  1708. Xmidiput $mf 0 {9 PitchWheel 0 1}
  1709. Xmidiput $mf 0 {10 SystemExclusive {0x01 0x02 0x03}}
  1710. Xmidiput $mf 0 {11 MetaSequenceNumber 1}
  1711. Xmidiput $mf 0 {12 MetaText "MetaText"}
  1712. Xmidiput $mf 0 {13 MetaCopyright "MetaCopyright"}
  1713. Xmidiput $mf 0 {14 MetaSequenceName "MetaSequenceName"}
  1714. Xmidiput $mf 0 {15 MetaInstrumentName "MetaInstrumentName"}
  1715. Xmidiput $mf 0 {16 MetaLyric "MetaLyric"}
  1716. Xmidiput $mf 0 {17 MetaMarker "MetaMarker"}
  1717. Xmidiput $mf 0 {18 MetaCue "MetaCue"}
  1718. Xmidiput $mf 0 {19 MetaChannelPrefix {0x01 0x02 0x03}}
  1719. Xmidiput $mf 0 {20 MetaEndOfTrack}
  1720. Xmidiput $mf 0 {21 MetaTempo 100}
  1721. Xmidiput $mf 0 {22 MetaSMPTE 1 2 3 4 5}
  1722. Xmidiput $mf 0 {23 MetaTime 3 4 24 8}
  1723. Xmidiput $mf 0 {24 MetaKey "E flat" minor}
  1724. Xmidiput $mf 0 {25 MetaSequencerSpecific {0x01 0x02 0x03}}
  1725. Xmidiput $mf 0 {26 MetaUnknown 0x60 {0x01 0x02 0x03}}
  1726. X
  1727. Xmididelete $mf 0 range 10 15
  1728. X
  1729. Xmidirewind $mf
  1730. X
  1731. Xwhile {[set e [midiget $mf 0 next]] != "EOT"} {puts $e}
  1732. END_OF_FILE
  1733.   if test 1220 -ne `wc -c <'tclmidi-2.0/tests/drange.test'`; then
  1734.     echo shar: \"'tclmidi-2.0/tests/drange.test'\" unpacked with wrong size!
  1735.   fi
  1736.   chmod +x 'tclmidi-2.0/tests/drange.test'
  1737.   # end of 'tclmidi-2.0/tests/drange.test'
  1738. fi
  1739. if test -f 'tclmidi-2.0/tests/putget.test' -a "${1}" != "-c" ; then 
  1740.   echo shar: Will not clobber existing file \"'tclmidi-2.0/tests/putget.test'\"
  1741. else
  1742.   echo shar: Extracting \"'tclmidi-2.0/tests/putget.test'\" \(1243 characters\)
  1743.   sed "s/^X//" >'tclmidi-2.0/tests/putget.test' <<'END_OF_FILE'
  1744. X#!../tclmidi
  1745. Xset mf [midimake]
  1746. Xmidiconfig $mf {tracks 1}
  1747. Xmidiput $mf 0 {0 NoteOff 0 1}
  1748. Xmidiput $mf 0 {1 NoteOff 0 1 2}
  1749. Xmidiput $mf 0 {3 NoteOn 0 1 2}
  1750. Xmidiput $mf 0 {4 Note 0 1 2 1}
  1751. Xmidiput $mf 0 {5 KeyPressure 0 1 2}
  1752. Xmidiput $mf 0 {6 Parameter 0 1 2}
  1753. Xmidiput $mf 0 {7 Program 0 1}
  1754. Xmidiput $mf 0 {8 ChannelPressure 0 1}
  1755. Xmidiput $mf 0 {9 PitchWheel 0 1}
  1756. Xmidiput $mf 0 {10 SystemExclusive {0x01 0x02 0x03}}
  1757. Xmidiput $mf 0 {11 MetaSequenceNumber 1}
  1758. Xmidiput $mf 0 {12 MetaText "MetaText"}
  1759. Xmidiput $mf 0 {13 MetaCopyright "MetaCopyright"}
  1760. Xmidiput $mf 0 {14 MetaSequenceName "MetaSequenceName"}
  1761. Xmidiput $mf 0 {15 MetaInstrumentName "MetaInstrumentName"}
  1762. Xmidiput $mf 0 {16 MetaLyric "MetaLyric"}
  1763. Xmidiput $mf 0 {17 MetaMarker "MetaMarker"}
  1764. Xmidiput $mf 0 {18 MetaCue "MetaCue"}
  1765. Xmidiput $mf 0 {19 MetaChannelPrefix {0x01 0x02 0x03}}
  1766. Xmidiput $mf 0 {20 MetaPortNumber 1}
  1767. Xmidiput $mf 0 {21 MetaEndOfTrack}
  1768. Xmidiput $mf 0 {22 MetaTempo 100}
  1769. Xmidiput $mf 0 {23 MetaSMPTE 1 2 3 4 5}
  1770. Xmidiput $mf 0 {24 MetaTime 3 4 24 8}
  1771. Xmidiput $mf 0 {25 MetaKey "E flat" minor}
  1772. Xmidiput $mf 0 {26 MetaSequencerSpecific {0x01 0x02 0x03}}
  1773. Xmidiput $mf 0 {27 MetaUnknown 0x60 {0x01 0x02 0x03}}
  1774. X
  1775. Xmidirewind $mf
  1776. Xwhile {[set event [midiget $mf 0 next]] != "EOT"} {
  1777. X    puts stdout $event
  1778. X}
  1779. END_OF_FILE
  1780.   if test 1243 -ne `wc -c <'tclmidi-2.0/tests/putget.test'`; then
  1781.     echo shar: \"'tclmidi-2.0/tests/putget.test'\" unpacked with wrong size!
  1782.   fi
  1783.   chmod +x 'tclmidi-2.0/tests/putget.test'
  1784.   # end of 'tclmidi-2.0/tests/putget.test'
  1785. fi
  1786. if test -f 'tclmidi-2.0/tests/rw.test' -a "${1}" != "-c" ; then 
  1787.   echo shar: Will not clobber existing file \"'tclmidi-2.0/tests/rw.test'\"
  1788. else
  1789.   echo shar: Extracting \"'tclmidi-2.0/tests/rw.test'\" \(1408 characters\)
  1790.   sed "s/^X//" >'tclmidi-2.0/tests/rw.test' <<'END_OF_FILE'
  1791. X#!../tclmidi
  1792. Xset mf [midimake]
  1793. Xmidiconfig $mf {tracks 1}
  1794. Xmidiput $mf 0 {0 NoteOff 0 1}
  1795. Xmidiput $mf 0 {1 NoteOff 0 1 2}
  1796. Xmidiput $mf 0 {3 NoteOn 0 1 2}
  1797. Xmidiput $mf 0 {4 Note 0 1 2 1}
  1798. Xmidiput $mf 0 {5 KeyPressure 0 1 2}
  1799. Xmidiput $mf 0 {6 Parameter 0 1 2}
  1800. Xmidiput $mf 0 {7 Program 0 1}
  1801. Xmidiput $mf 0 {8 ChannelPressure 0 1}
  1802. Xmidiput $mf 0 {9 PitchWheel 0 1}
  1803. Xmidiput $mf 0 {10 SystemExclusive {0x01 0x02 0x03}}
  1804. Xmidiput $mf 0 {10 SystemExclusive continued {0x01 0x02 0x03}}
  1805. Xmidiput $mf 0 {11 MetaSequenceNumber 1}
  1806. Xmidiput $mf 0 {12 MetaText "MetaText"}
  1807. Xmidiput $mf 0 {13 MetaCopyright "MetaCopyright"}
  1808. Xmidiput $mf 0 {14 MetaSequenceName "MetaSequenceName"}
  1809. Xmidiput $mf 0 {15 MetaInstrumentName "MetaInstrumentName"}
  1810. Xmidiput $mf 0 {16 MetaLyric "MetaLyric"}
  1811. Xmidiput $mf 0 {17 MetaMarker "MetaMarker"}
  1812. Xmidiput $mf 0 {18 MetaCue "MetaCue"}
  1813. Xmidiput $mf 0 {19 MetaChannelPrefix {0x01 0x02 0x03}}
  1814. Xmidiput $mf 0 {20 MetaEndOfTrack}
  1815. Xmidiput $mf 0 {21 MetaTempo 100}
  1816. Xmidiput $mf 0 {22 MetaSMPTE 1 2 3 4 5}
  1817. Xmidiput $mf 0 {23 MetaTime 3 4 24 8}
  1818. Xmidiput $mf 0 {24 MetaKey "E flat" minor}
  1819. X#midiput $mf 0 {24 MetaKey "C" minor}
  1820. Xmidiput $mf 0 {25 MetaSequencerSpecific {0x01 0x02 0x03}}
  1821. Xmidiput $mf 0 {26 MetaUnknown 0x60 {0x01 0x02 0x03}}
  1822. X
  1823. Xset f [open test.mid "w"]
  1824. Xmidiwrite $f $mf
  1825. Xmidifree $mf
  1826. Xclose $f
  1827. X
  1828. Xset f [open test.mid r]
  1829. Xset mf [midiread $f]
  1830. Xmidirewind $mf
  1831. Xwhile {[set event [midiget $mf 0 next]] != "EOT"} {puts $event}
  1832. END_OF_FILE
  1833.   if test 1408 -ne `wc -c <'tclmidi-2.0/tests/rw.test'`; then
  1834.     echo shar: \"'tclmidi-2.0/tests/rw.test'\" unpacked with wrong size!
  1835.   fi
  1836.   chmod +x 'tclmidi-2.0/tests/rw.test'
  1837.   # end of 'tclmidi-2.0/tests/rw.test'
  1838. fi
  1839. if test -f 'tclmidi-2.0/tests/split.test' -a "${1}" != "-c" ; then 
  1840.   echo shar: Will not clobber existing file \"'tclmidi-2.0/tests/split.test'\"
  1841. else
  1842.   echo shar: Extracting \"'tclmidi-2.0/tests/split.test'\" \(1478 characters\)
  1843.   sed "s/^X//" >'tclmidi-2.0/tests/split.test' <<'END_OF_FILE'
  1844. X#!../tclmidi
  1845. Xset mf [midimake]
  1846. Xmidiconfig $mf {tracks 1}
  1847. Xmidiput $mf 0 {0 NoteOff 0 1}
  1848. Xmidiput $mf 0 {1 NoteOff 0 1 2}
  1849. Xmidiput $mf 0 {3 NoteOn 0 1 2}
  1850. Xmidiput $mf 0 {4 Note 0 1 2 1}
  1851. Xmidiput $mf 0 {5 KeyPressure 0 1 2}
  1852. Xmidiput $mf 0 {6 Parameter 0 1 2}
  1853. Xmidiput $mf 0 {7 Program 0 1}
  1854. Xmidiput $mf 0 {8 ChannelPressure 0 1}
  1855. Xmidiput $mf 0 {9 PitchWheel 0 1}
  1856. Xmidiput $mf 0 {10 SystemExclusive {0x01 0x02 0x03}}
  1857. Xmidiput $mf 0 {11 MetaSequenceNumber 1}
  1858. Xmidiput $mf 0 {12 MetaText "MetaText"}
  1859. Xmidiput $mf 0 {13 MetaCopyright "MetaCopyright"}
  1860. Xmidiput $mf 0 {14 MetaSequenceName "MetaSequenceName"}
  1861. Xmidiput $mf 0 {15 MetaInstrumentName "MetaInstrumentName"}
  1862. Xmidiput $mf 0 {16 MetaLyric "MetaLyric"}
  1863. Xmidiput $mf 0 {17 MetaMarker "MetaMarker"}
  1864. Xmidiput $mf 0 {18 MetaCue "MetaCue"}
  1865. Xmidiput $mf 0 {19 MetaChannelPrefix {0x01 0x02 0x03}}
  1866. Xmidiput $mf 0 {20 MetaEndOfTrack}
  1867. Xmidiput $mf 0 {21 MetaTempo 100}
  1868. Xmidiput $mf 0 {22 MetaSMPTE 1 2 3 4 5}
  1869. Xmidiput $mf 0 {23 MetaTime 3 4 24 8}
  1870. Xmidiput $mf 0 {24 MetaKey "E flat" minor}
  1871. Xmidiput $mf 0 {25 MetaSequencerSpecific {0x01 0x02 0x03}}
  1872. Xmidiput $mf 0 {26 MetaUnknown 0x60 {0x01 0x02 0x03}}
  1873. X
  1874. Xset mfmeta [midimake]
  1875. Xmidiconfig $mfmeta {tracks 1}
  1876. Xset mfnormal [midimake]
  1877. Xmidiconfig $mfnormal {tracks 1} {division 480}
  1878. X
  1879. Xmidisplit "$mf 0" "$mfmeta 0" "$mfnormal 0"
  1880. Xmidirewind $mfmeta
  1881. Xmidirewind $mfnormal
  1882. Xwhile {[set e [midiget $mfmeta 0 next]] != "EOT"} {puts stdout $e}
  1883. Xputs stdout ""
  1884. Xwhile {[set e [midiget $mfnormal 0 next]] != "EOT"} {puts stdout $e}
  1885. X
  1886. END_OF_FILE
  1887.   if test 1478 -ne `wc -c <'tclmidi-2.0/tests/split.test'`; then
  1888.     echo shar: \"'tclmidi-2.0/tests/split.test'\" unpacked with wrong size!
  1889.   fi
  1890.   chmod +x 'tclmidi-2.0/tests/split.test'
  1891.   # end of 'tclmidi-2.0/tests/split.test'
  1892. fi
  1893. echo shar: End of archive 13 \(of 14\).
  1894. cp /dev/null ark13isdone
  1895. MISSING=""
  1896. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
  1897.     if test ! -f ark${I}isdone ; then
  1898.     MISSING="${MISSING} ${I}"
  1899.     fi
  1900. done
  1901. if test "${MISSING}" = "" ; then
  1902.     echo You have unpacked all 14 archives.
  1903.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1904. else
  1905.     echo You still must unpack the following archives:
  1906.     echo "        " ${MISSING}
  1907. fi
  1908. exit 0
  1909. exit 0 # Just in case...
  1910.