Subversion Repositories svn.mios32

Rev

Rev 1675 | Rev 1806 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
182 tk 1
// $Id: seq_midi_in.h 1794 2013-05-31 19:25:43Z tk $
2
/*
3
 * Header file for MIDI Input routines
4
 *
5
 * ==========================================================================
6
 *
7
 *  Copyright (C) 2008 Thorsten Klose (tk@midibox.org)
8
 *  Licensed for personal non-commercial use only.
9
 *  All other rights reserved.
10
 *
11
 * ==========================================================================
12
 */
13
 
14
#ifndef _SEQ_MIDI_IN_H
15
#define _SEQ_MIDI_IN_H
16
 
17
 
18
/////////////////////////////////////////////////////////////////////////////
19
// Global definitions
20
/////////////////////////////////////////////////////////////////////////////
21
 
1023 tk 22
// number of transport/arpeggiator busses
23
#define SEQ_MIDI_IN_NUM_BUSSES 4
182 tk 24
 
1023 tk 25
 
1675 tk 26
// External controller assignments
27
// They have to be aligned with the strings returned by the SEQ_MIDI_IN_ExtCtrlStr() function!
28
#define SEQ_MIDI_IN_EXT_CTRL_MORPH          0
29
#define SEQ_MIDI_IN_EXT_CTRL_SCALE          1
30
#define SEQ_MIDI_IN_EXT_CTRL_SONG           2
31
#define SEQ_MIDI_IN_EXT_CTRL_PHRASE         3
32
#define SEQ_MIDI_IN_EXT_CTRL_PATTERN_G1     4
33
#define SEQ_MIDI_IN_EXT_CTRL_PATTERN_G2     5
34
#define SEQ_MIDI_IN_EXT_CTRL_PATTERN_G3     6
35
#define SEQ_MIDI_IN_EXT_CTRL_PATTERN_G4     7
36
#define SEQ_MIDI_IN_EXT_CTRL_BANK_G1        8
37
#define SEQ_MIDI_IN_EXT_CTRL_BANK_G2        9
38
#define SEQ_MIDI_IN_EXT_CTRL_BANK_G3       10
39
#define SEQ_MIDI_IN_EXT_CTRL_BANK_G4       11
40
#define SEQ_MIDI_IN_EXT_CTRL_ALL_NOTES_OFF 12
41
 
42
// number of external controllers which listen to CC (at the beginning of the list)
43
#define SEQ_MIDI_IN_EXT_CTRL_NUM_IX_CC     13
44
 
45
// not listen to CC
46
#define SEQ_MIDI_IN_EXT_CTRL_NRPN_ENABLED  13
47
#define SEQ_MIDI_IN_EXT_CTRL_PC_MODE       14
48
 
49
// total number of external controllers
50
#define SEQ_MIDI_IN_EXT_CTRL_NUM           15
51
 
52
 
53
// program change modes
54
// They have to be aligned with the strings returned by the SEQ_MIDI_IN_ExtCtrlPcModeStr() function!
55
#define SEQ_MIDI_IN_EXT_CTRL_PC_MODE_OFF      0
56
#define SEQ_MIDI_IN_EXT_CTRL_PC_MODE_PATTERNS 1
57
#define SEQ_MIDI_IN_EXT_CTRL_PC_MODE_SONG     2
58
#define SEQ_MIDI_IN_EXT_CTRL_PC_MODE_PHRASE   3
59
 
60
// number of program change modes
61
#define SEQ_MIDI_IN_EXT_CTRL_PC_MODE_NUM      4
62
 
63
 
182 tk 64
/////////////////////////////////////////////////////////////////////////////
65
// Global Types
66
/////////////////////////////////////////////////////////////////////////////
67
 
1023 tk 68
typedef union {
69
  u8 ALL;
70
  struct {
71
    u8 MODE_PLAY:1;
72
  };
73
} seq_midi_in_options_t;
182 tk 74
 
1023 tk 75
 
182 tk 76
/////////////////////////////////////////////////////////////////////////////
77
// Prototypes
78
/////////////////////////////////////////////////////////////////////////////
79
 
80
extern s32 SEQ_MIDI_IN_Init(u32 mode);
81
 
1675 tk 82
extern const char *SEQ_MIDI_IN_ExtCtrlStr(u8 ext_ctrl);
83
extern const char *SEQ_MIDI_IN_ExtCtrlPcModeStr(u8 pc_mode);
84
 
1794 tk 85
// since there is currently no better place (somebody could expect this function in SEQ_MIDI_OUT...)
86
extern s32 SEQ_MIDI_IN_ExtCtrlSend(u8 ext_ctrl, u8 value);
87
 
826 tk 88
extern s32 SEQ_MIDI_IN_ResetTransArpStacks(void);
89
extern s32 SEQ_MIDI_IN_ResetChangerStacks(void);
90
extern s32 SEQ_MIDI_IN_ResetAllStacks(void);
600 tk 91
 
182 tk 92
extern s32 SEQ_MIDI_IN_Receive(mios32_midi_port_t port, mios32_midi_package_t midi_package);
93
 
1675 tk 94
extern s32 SEQ_MIDI_IN_ResetSingleTransArpStacks(u8 bus);
95
extern s32 SEQ_MIDI_IN_BusReceive(u8 bus, mios32_midi_package_t midi_package, u8 from_loopback_port);
96
 
1023 tk 97
extern s32 SEQ_MIDI_IN_TransposerNoteGet(u8 bus, u8 hold);
98
extern s32 SEQ_MIDI_IN_ArpNoteGet(u8 bus, u8 hold, u8 sorted, u8 key_num);
182 tk 99
 
100
/////////////////////////////////////////////////////////////////////////////
101
// Export global variables
102
/////////////////////////////////////////////////////////////////////////////
103
 
1023 tk 104
extern u8 seq_midi_in_channel[SEQ_MIDI_IN_NUM_BUSSES];
105
extern mios32_midi_port_t seq_midi_in_port[SEQ_MIDI_IN_NUM_BUSSES];
106
extern u8 seq_midi_in_lower[SEQ_MIDI_IN_NUM_BUSSES];
107
extern u8 seq_midi_in_upper[SEQ_MIDI_IN_NUM_BUSSES];
108
extern seq_midi_in_options_t seq_midi_in_options[SEQ_MIDI_IN_NUM_BUSSES];
406 tk 109
 
987 tk 110
extern u8 seq_midi_in_rec_channel;
111
extern mios32_midi_port_t seq_midi_in_rec_port;
112
 
1675 tk 113
extern u8 seq_midi_in_ext_ctrl_channel;
114
extern mios32_midi_port_t seq_midi_in_ext_ctrl_port;
1794 tk 115
extern mios32_midi_port_t seq_midi_in_ext_ctrl_out_port;
1675 tk 116
extern u8 seq_midi_in_ext_ctrl_asg[SEQ_MIDI_IN_EXT_CTRL_NUM];
117
 
826 tk 118
extern u8 seq_midi_in_sect_channel;
119
extern mios32_midi_port_t seq_midi_in_sect_port;
848 tk 120
extern mios32_midi_port_t seq_midi_in_sect_fwd_port;
826 tk 121
extern u8 seq_midi_in_sect_note[4];
406 tk 122
 
826 tk 123
 
182 tk 124
#endif /* _SEQ_MIDI_IN_H */