put example files to dedicated dir
[monster.git] / midi_event.h
blobdfe3753a6b7115bda6d67484c05b4f7334bf7b21
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * MIDI event definitions
5 * This file is part of monster
7 * Copyright (C) 2006,2007 Nedko Arnaudov <nedko@arnaudov.name>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22 *****************************************************************************/
24 #ifndef MIDI_EVENT_H__84B68D21_7453_4431_8E81_39BC4AA62F01__INCLUDED
25 #define MIDI_EVENT_H__84B68D21_7453_4431_8E81_39BC4AA62F01__INCLUDED
27 #define MIDI_EVENT_NOTE_OFF 1 /* Note Off */
28 #define MIDI_EVENT_NOTE_ON 2 /* Note On */
29 #define MIDI_EVENT_KEYPRESS 3 /* Polyphonic Key Pressure (Aftertouch) */
30 #define MIDI_EVENT_CC 4 /* Control Change */
31 #define MIDI_EVENT_PITCH 5 /* Pitch Wheel Change */
32 #define MIDI_EVENT_PGMCHANGE 6 /* Porgram Change */
33 #define MIDI_EVENT_CHANPRESS 7 /* Channel Pressure (After-touch) */
34 #define MIDI_EVENT_SYSEX 8 /* System Exclusive */
35 #define MIDI_EVENT_TEMPO 9 /* Tempo Change */
36 #define MIDI_EVENT_PPQN 10 /* PPQN - Pulse per quarter note */
38 struct midi_event
40 unsigned int type; /* oen of MIDI_EVENT_XXX */
41 unsigned int tick;
42 union
44 struct
46 unsigned int channel;
47 unsigned int note;
48 unsigned int velocity;
49 } note_off;
50 struct
52 unsigned int channel;
53 unsigned int note;
54 unsigned int velocity;
55 } note_on;
56 struct
58 unsigned int channel;
59 unsigned int note;
60 unsigned int velocity;
61 } keypress;
62 struct
64 unsigned int channel;
65 unsigned int controller;
66 unsigned int value;
67 } cc;
68 struct
70 unsigned int channel;
71 unsigned int value;
72 } pitch;
73 struct
75 unsigned int channel;
76 unsigned int program;
77 } pgmchange;
78 struct
80 unsigned int channel;
81 unsigned int value;
82 } chanpress;
83 struct
85 unsigned int size;
86 void * data;
87 } sysex;
88 struct
90 unsigned int value;
91 } tempo;
92 struct
94 unsigned int value;
95 } ppqn;
96 } data;
99 #endif /* #ifndef MIDI_EVENT_H__84B68D21_7453_4431_8E81_39BC4AA62F01__INCLUDED */