download midi_spec.h
Language: C
Copyright: (C) 1991, NeXT, Inc.
LOC: 102
Project Info
The MusicKit(musickit)
Server: SourceForge
Type: cvs
...sicKit\Frameworks\MusicKit\
   _ArielQP.h
   _DSPMK.h
   _error.h
   _midi.h
   _MKAppProxy.h
   _MKAppProxy.m
   _MKNameTable.h
   _MKNameTable.m
   _MKParameter.h
   _MTCHelper.h
   _MTCHelper.m
   _musickit.h
   _noteRecorder.h
   _OrchloopbeginUG.h
   _OrchloopbeginUG.m
   _ParName.h
   _ParName.m
   _scorefile.h
   _ScorefileVar.h
   _ScorefileVar.m
   _SharedSynthInfo.h
   _SharedSynthInfo.m
   _synthElementMethods.m
   _time.h
   ArielQP.h
   ArielQP.m
   classFuncs.h
   ConductorPrivate.h
   dsp_types.h
   DSPSerialPortDevice.h
   dspwrap.h
   EnvelopePrivate.h
   equalTempered.m
   errors.h
   fastFFT.c
   fastFFT.h
   GNUmakefile.postamble
   GNUmakefile.preamble.in
   InstrumentPrivate.h
   keynums.h
   libMusicKit.def
   Localized.strings
   make.sh
   Makefile.postamble
   Makefile.preamble
   midi_spec.h
   midifile.h
   midifile.m
   MidiPrivate.h
   midiTranslation.h
   MKConductor.h
   MKConductor.m
   MKConductorDelegate.h
   MKDeviceStatus.h
   MKEnvelope.h
   MKEnvelope.m
   MKFilePerformer.h
   MKFilePerformer.m
   MKFileWriter.h
   MKFileWriter.m
   MKInstrument.h
   MKInstrument.m
   MKMidi.h
   MKMidi.m
   MKMixerInstrument.h
   MKMixerInstrument.m
   MKMTCPerformer.h
   MKMTCPerformer.m
   MKNote.h
   MKNoteFilter.h
   MKNoteFilter.m
   MKNoteReceiver.h
   MKNoteReceiver.m
   MKNoteSender.h
   MKNoteSender.m
   MKOrchestra.h
   MKPart.m
   MKPartials.h
   MKPartials.m
   ...tialsWaveshapingTable.m
   MKPartPerformer.h
   MKPartPerformer.m
   MKPartRecorder.h
   MKPartRecorder.m
   MKPatch.h
   MKPatch.m
   MKPatchConnection.h
   MKPatchConnection.m
   MKPatchEntry.h
   MKPatchEntry.m
   MKPatchTemplate.h
   MKPatchTemplate.m
   MKPerformer.h
   MKPerformer.m
   MKPerformerDelegate.h
   MKPlugin.h
   MKSamplerInstrument.h
   MKSamplerInstrument.m
   MKSamples.h
   MKScore.h
   MKScore.m
   MKScorefileObject.h
   MKScorefilePerformer.h
   MKScorefilePerformer.m
   MKScorefileWriter.m
   MKScorePerformer.h
   MKScorePerformer.m
   MKScoreRecorder.h
   MKScoreRecorder.m
   MKSynthData.h
   MKSynthData.m
   MKSynthInstrument.h
   MKSynthPatch.h
   MKTimbre.h
   MKTimbre.m
   MKTuningSystem.h
   MKTuningSystem.m
   MKUnitGenerator.h
   MKUnitGenerator.m
   MKWaveTable.h
   MKWaveTable.m
   mtcMidi.m
   mtcMidiPrivate.m
   MusicKit-Info.plist
   MusicKit.h
   MusicKitConfig.h.in
   names.h
   noDVal.h
   noteDispatcherMethods.m
   NotePrivate.h
   noteRecorderCFuncs.m
   noteRecorderMethods.m
   orch.h
   OrchestraPrivate.h
   OrchloopbeginUG.h
   OrchloopbeginUG.m
   orchloopbeginUGInclude.m
   params.h
   parNames.m
   partialsDBInclude.m
   PartialsPrivate.h
   PartPerformerPrivate.h
   PartPrivate.h
   PartRecorderPrivate.h
   PatchTemplatePrivate.h
   PB.project
   PerformerPrivate.h
   pitches.h
   platform.make
   ...efilePerformerPrivate.h
   ScorePerformerPrivate.h
   ScorePrivate.h
   ScoreRecorderPrivate.h
   SynthDataPrivate.h
   synthElementCFuncs.m
   synthElementMethods.m
   SynthInstrumentPrivate.h
   SynthPatchList.h
   SynthPatchList.m
   SynthPatchPrivate.h
   timetagInclude.m
   timeunits.h
   tokenNames.m
   tokens.h
   trigonometry.c
   trigonometry.h
   TuningSystemPrivate.h
   UnitGeneratorPrivate.h
   win32-def.top
   writeBinary.m
   writeMidi.m
   writeScore.m

/*
  $Id: midi_spec.h,v 1.5 2001/07/02 16:58:03 sbrandon Exp $
  Defined In: The MusicKit

  Description: MIDI definitions

  Author: David Jaffe
 	Copyright (C) 1991, NeXT, Inc.
*/
/*
Modification history:

  $Log: midi_spec.h,v $
  Revision 1.5  2001/07/02 16:58:03  sbrandon
  - commented out cruft after endif
  - added newline onto end of file

  Revision 1.4  2000/05/13 17:07:35  leigh
  Added extra controller type definitions

  Revision 1.3  2000/02/07 23:53:26  leigh
  added patch bank change and MIDI pitch bend range defintions

  Revision 1.2  1999/07/29 01:26:06  leigh
  Added Win32 compatibility, CVS logs, SBs changes

*/
#ifndef	_MIDI_SPEC_
#define _MIDI_SPEC_

/*
 * MIDI status bytes (from International MIDI Association document
 * MIDI-1.0, August 5, 1983)
 */
#define MIDI_RESETCONTROLLERS	0x79
#define MIDI_LOCALCONTROL	0x7a
#define MIDI_ALLNOTESOFF	0x7b
#define MIDI_OMNIOFF		0x7c
#define MIDI_OMNION		0x7d
#define MIDI_MONO		0x7e
#define MIDI_POLY		0x7f
#define	MIDI_NOTEOFF		0x80
#define	MIDI_NOTEON		0x90
#define	MIDI_POLYPRES		0xa0
#define	MIDI_CONTROL		0xb0
#define	MIDI_PROGRAM		0xc0
#define	MIDI_CHANPRES		0xd0
#define	MIDI_PITCH		0xe0
#define	MIDI_CHANMODE		MIDI_CONTROL
#define	MIDI_SYSTEM		0xf0
#define	MIDI_SYSEXCL		(MIDI_SYSTEM | 0x0)
#define MIDI_TIMECODEQUARTER	(MIDI_SYSTEM | 0x1)
#define	MIDI_SONGPOS		(MIDI_SYSTEM | 0x2)
#define	MIDI_SONGSEL		(MIDI_SYSTEM | 0x3)
#define	MIDI_TUNEREQ		(MIDI_SYSTEM | 0x6)
#define	MIDI_EOX		(MIDI_SYSTEM | 0x7)
#define MIDI_CLOCK		(MIDI_SYSTEM | 0x8)
#define MIDI_START		(MIDI_SYSTEM | 0xa)
#define MIDI_CONTINUE		(MIDI_SYSTEM | 0xb)
#define MIDI_STOP		(MIDI_SYSTEM | 0xc)
#define MIDI_ACTIVE		(MIDI_SYSTEM | 0xe)
#define MIDI_RESET		(MIDI_SYSTEM | 0xf)

#define MIDI_MAXDATA            0x7f
#define MIDI_OP(y)              (y & (MIDI_STATUSMASK))
#define MIDI_DATA(y)            (y & (MIDI_MAXDATA))
#define MIDI_MAXCHAN            0x0f
#define MIDI_NUMCHANS           16
#define MIDI_NUMKEYS            128
#define MIDI_ZEROBEND           0x2000
#define MIDI_DEFAULTVELOCITY    64

/* MIDI Controller numbers */
#define MIDI_BANKSELECT_MSB	0
#define MIDI_MODWHEEL           1
#define MIDI_BREATH             2
#define MIDI_FOOT               4
#define MIDI_PORTAMENTOTIME     5
#define MIDI_DATAENTRY          6
#define MIDI_MAINVOLUME         7
#define MIDI_BALANCE            8
#define MIDI_PAN                10
#define MIDI_EXPRESSION         11
#define MIDI_EFFECTCONTROL1	12
#define MIDI_EFFECTCONTROL2	13			

/* LSB for above */
#define MIDI_MODWHEELLSB        (1 + 31)  
#define MIDI_BREATHLSB          (2 + 31)
#define MIDI_FOOTLSB            (4 + 31)
#define MIDI_PORTAMENTOTIMELSB  (5 + 31)
#define MIDI_DATAENTRYLSB       (6 + 31)
#define MIDI_MAINVOLUMELSB      (7 + 31)
#define MIDI_BALANCELSB         (8 + 31)
#define MIDI_PANLSB             (10 + 31)
#define MIDI_EXPRESSIONLSB      (11 + 31)

/* patch bank change commands */
#define MIDI_BANKMSB		0
#define MIDI_BANKLSB		32

#define MIDI_DAMPER             64
#define MIDI_PORTAMENTO         65
#define MIDI_SOSTENUTO          66
#define MIDI_SOFTPEDAL          67
#define MIDI_LEGATOFOOTSWITCH	68
#define MIDI_HOLD2              69

// default sound controller values
#define MIDI_SOUNDVARIATION	70
#define MIDI_HARMONICINTENSITY	71
#define MIDI_RELEASETIME	72
#define MIDI_ATTACKTIME		73
#define	MIDI_BRIGHTNESS		74

#define MIDI_PORTAMENTOCONTROL	84

/*
 * Controller 91-95 definitions from original 1.0 MIDI spec
 */
#define MIDI_EXTERNALEFFECTSDEPTH 91
#define MIDI_TREMELODEPTH       92
#define MIDI_CHORUSDEPTH        93
#define MIDI_DETUNEDEPTH        94
#define MIDI_PHASERDEPTH        95
/*
 * Controller 91-95 definitions as of June 1990
 */
#define MIDI_EFFECTS1		91
#define MIDI_EFFECTS2		92
#define MIDI_EFFECTS3		93
#define MIDI_EFFECTS4		94
#define MIDI_EFFECTS5		95
#define MIDI_DATAINCREMENT      96
#define MIDI_DATADECREMENT      97

/* Controller 100-101 definitions for pitch bend range */
#define MIDI_PITCHBENDRANGE	100

/*
 * Masks for disassembling MIDI status bytes
 */
#define	MIDI_STATUSBIT	0x80	/* indicates this is a status byte */
#define	MIDI_STATUSMASK	0xf0	/* bits indicating type of status req */
#define	MIDI_SYSRTBIT	0x08	/* differentiates SYSRT from SYSCOM */

/* Some useful parsing macros. */
#define MIDI_TYPE_SYSTEM_REALTIME(byte)	(((byte)&0xf8) == 0xf8)
#define MIDI_TYPE_1BYTE(byte)	(   MIDI_TYPE_SYSTEM_REALTIME(byte) \
				 || (byte) == 0xf6 || (byte) == 0xf7)
#define MIDI_TYPE_2BYTE(byte)	(   (((byte)&0xe0) == 0xc0) \
				 || (((byte)&0xe0) == 0xd0) \
				 || ((byte)&0xfd) == 0xf1)
#define MIDI_TYPE_3BYTE(byte)	(   ((byte)&0xc0) == 0x80 \
				 || ((byte)&0xe0) == 0xe0 \
				 || (byte) == 0xf2)
#define MIDI_TYPE_SYSTEM(byte)	(((byte)&0xf0) == 0xf0)
#define MIDI_EVENTSIZE(byte)    (MIDI_TYPE_1BYTE(byte) ? 1 : \
				 MIDI_TYPE_2BYTE(byte) ? 2 : 3)

#endif	 /* _MIDI_SPEC_ */

About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us