sysextemp.h
3.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*************************************************************************
*
* header file for common synthesizer constants
*
* Written by Gints Klimanis
* Silicon Graphics Computer Systems
* 1995
*************************************************************************/
#ifndef __INCLUDE_SYNTHCOMMON_H__
#define __INCLUDE_SYNTHCOMMON_H__ 1
#ifdef __cplusplus
extern "C" {
#endif
#include <dmedia/midi.h>
/*#define SGISoftwareSynthDeviceName "SoftwareSynth"*/
#define SGISoftwareSynthDeviceName "SoftwareSynth"
#define _MIDI_PANEL_ID 8
#define _SOUND_PLAYER_ID 7
#define _SYNTH_MEKTON_ID 10
#define _SYNTH_NINTENDO_ID 9
#define _SYNTH_KEYS_ID 6
#define _SYNTH_PANEL_ID 5
#define _SYNTH_SYNTH_ID 4
#define _SYNTH_EDITOR_ID 3
#define _ORIGIN_UNSPECIFIED_ID 0
#define _DESTINATION_UNSPECIFIED_ID 0
#define _ORIGIN_ANY_ID 1
#define _DESTINATION_ALL_ID 1
/* SYSEX AP function ID codes */
#define _AP_SET_ADDRESS 0
#define _AP_SET_BOOLEAN 2
#define _AP_SET_DOUBLE 4
#define _AP_SET_NUMBER _AP_SET_DOUBLE
#define _AP_SET_STRING 6
#define _AP_SET_BULK_DATA 8
#define _AP_SET_MIDI_SYSEX 16
#define _AP_SET_MIDI_MESSAGE 18
#define _AP_SET_PARAMETER 20
#define _AP_GET_ADDRESS 1
#define _AP_GET_BOOLEAN 3
#define _AP_GET_DOUBLE 5
#define _AP_GET_NUMBER _AP_GET_DOUBLE
#define _AP_GET_STRING 7
#define _AP_GET_BULK_DATA 15
#define _AP_GET_PARAMETER 21
#define _AP_TELL 9
#define _AP_ASK 11
#define _AP_ERROR 13 /* should be 13 or 666 */
/*
System Exclusive (SYSEX) message format
$F0: start sysex
$00: manufacturer ID (SGI)
$00: device ID
$00: model ID
$00: command ID
$xx: MIDI channel (currently only 1 byte)
$xx: origin ID (currently only 1 byte)
$xx: destination ID (currently only 1 byte)
body (bytes with up to seven bits filled)
parameter value
parameter name
$F7: end sysex
*/
#define _AP_SYSEX_MAX_BUFFER_SIZE 1000
#define _AP_SYSEX_MANUFACTURER_INDEX 1
#define _AP_SYSEX_DEVICE_INDEX 2
#define _AP_SYSEX_MODEL_INDEX 3
#define _AP_SYSEX_COMMAND_INDEX 4
#define _AP_SYSEX_CHANNEL_INDEX _AP_SYSEX_COMMAND_INDEX + 1
#define _AP_SYSEX_ORIGIN_INDEX _AP_SYSEX_CHANNEL_INDEX + 1
#define _AP_SYSEX_DESTINATION_INDEX _AP_SYSEX_ORIGIN_INDEX + 1
#define _AP_SYSEX_DATA_INDEX _AP_SYSEX_DESTINATION_INDEX + 1
#define _AP_SYSEX_MANUFACTURER_SGI 0x55
#define _AP_SYSEX_DEVICE_SYNTH 0x32
#define _AP_SYSEX_MODEL_GINTS 0x66
#define NOT_NEEDED -1
#define _AP_MESSAGE_NONE 0
#define _AP_MESSAGE_EDIT_BUFFER_CREATED 1
#define _AP_PRESET_CHANGED 2
#define _AP_BAD_PARAMETER 3
#define _AP_BAD_PARAMETER_VALUE 4
#define _AP_BAD_MESSAGE_CODE 5
#define _AP_BAD_PRESET_LOAD 6
#define _AP_BAD_COMMAND 7
char suIsSGISynthSystemExclusive(MDevent *event);
int suGetOriginID(MDevent *event);
int suGetCommandID(MDevent *event);
char *suGetParameter(MDevent *event);
char *suGetData(MDevent *event);
double suNibblesToDouble(char *in);
void suSetBooleanMIDI(MDport port, int channel, int *IDs, char *parameter, char value);
void suSetNumberMIDI(MDport port, int channel, int *IDs, char *parameter, double value);
void suSetStringMIDI(MDport port, int channel, int *IDs, char *parameter, char *value);
#ifdef __cplusplus
}
char suIsSGISynthSystemExclusive(MDevent *event);
int suGetOriginID(MDevent *event);
int suGetCommandID(MDevent *event);
char *suGetParameter(MDevent *event);
char *suGetData(MDevent *event);
double suNibblesToDouble(char *in);
void suSetBooleanMIDI(MDport port, int channel, int *IDs, char *parameter, char value);
void suSetNumberMIDI(MDport port, int channel, int *IDs, char *parameter, double value);
void suSetStringMIDI(MDport port, int channel, int *IDs, char *parameter, char *value);
#endif
#endif