MPU401.H 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. Copyright (C) 1994-1995 Apogee Software, Ltd.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #ifndef __MPU401_H
  16. #define __MPU401_H
  17. #define MPU_DefaultAddress 0x330
  18. enum MPU_ERRORS
  19. {
  20. MPU_Warning = -2,
  21. MPU_Error = -1,
  22. MPU_Ok = 0,
  23. MPU_DPMI_Error
  24. };
  25. #define MPU_NotFound -1
  26. #define MPU_UARTFailed -2
  27. #define MPU_ReadyToWrite 0x40
  28. #define MPU_ReadyToRead 0x80
  29. #define MPU_CmdEnterUART 0x3f
  30. #define MPU_CmdReset 0xff
  31. #define MPU_CmdAcknowledge 0xfe
  32. extern int MPU_BaseAddr;
  33. extern unsigned MPU_Delay;
  34. void MPU_SendCommand( int data );
  35. void MPU_SendMidi( int data );
  36. int MPU_Reset( void );
  37. int MPU_EnterUART( void );
  38. int MPU_Init( int addr );
  39. void MPU_ResetMidi( void );
  40. void MPU_NoteOff( int channel, int key, int velocity );
  41. void MPU_NoteOn( int channel, int key, int velocity );
  42. void MPU_PolyAftertouch( int channel, int key, int pressure );
  43. void MPU_ControlChange( int channel, int number, int value );
  44. void MPU_ProgramChange( int channel, int program );
  45. void MPU_ChannelAftertouch( int channel, int pressure );
  46. void MPU_PitchBend( int channel, int lsb, int msb );
  47. void MPU_UnlockMemory( void );
  48. int MPU_LockMemory( void );
  49. #endif