Subversion Repositories svn.mios32

Rev

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

Rev Author Line No. Line
168 tk 1
// $Id: seq_cc.h 1794 2013-05-31 19:25:43Z tk $
2
/*
3
 * Header file for CC parameters
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_CC_H
15
#define _SEQ_CC_H
16
 
17
#include "seq_trg.h"
323 tk 18
#include "seq_layer.h"
599 tk 19
#include "seq_lfo.h"
168 tk 20
#include "seq_core.h"
21
 
22
 
23
/////////////////////////////////////////////////////////////////////////////
24
// Global definitions
25
/////////////////////////////////////////////////////////////////////////////
26
 
333 tk 27
// usage depends on event mode (e.g. drum tracks: MIDI notes for up to 16 trigger layers)
318 tk 28
#define SEQ_CC_LAY_CONST_A1 0x00
29
#define SEQ_CC_LAY_CONST_A2 0x01
30
#define SEQ_CC_LAY_CONST_A3 0x02
31
#define SEQ_CC_LAY_CONST_A4 0x03
32
#define SEQ_CC_LAY_CONST_A5 0x04
33
#define SEQ_CC_LAY_CONST_A6 0x05
34
#define SEQ_CC_LAY_CONST_A7 0x06
35
#define SEQ_CC_LAY_CONST_A8 0x07
36
#define SEQ_CC_LAY_CONST_A9 0x08
37
#define SEQ_CC_LAY_CONST_A10    0x09
38
#define SEQ_CC_LAY_CONST_A11    0x0a
39
#define SEQ_CC_LAY_CONST_A12    0x0b
40
#define SEQ_CC_LAY_CONST_A13    0x0c
41
#define SEQ_CC_LAY_CONST_A14    0x0d
42
#define SEQ_CC_LAY_CONST_A15    0x0e
43
#define SEQ_CC_LAY_CONST_A16    0x0f
168 tk 44
 
333 tk 45
// usage depends on event mode (e.g. drum tracks: Normal Velocity for up to 16 trigger layers)
318 tk 46
#define SEQ_CC_LAY_CONST_B1 0x10
47
#define SEQ_CC_LAY_CONST_B2 0x11
48
#define SEQ_CC_LAY_CONST_B3 0x12
49
#define SEQ_CC_LAY_CONST_B4 0x13
50
#define SEQ_CC_LAY_CONST_B5 0x14
51
#define SEQ_CC_LAY_CONST_B6 0x15
52
#define SEQ_CC_LAY_CONST_B7 0x16
53
#define SEQ_CC_LAY_CONST_B8 0x17
54
#define SEQ_CC_LAY_CONST_B9 0x18
55
#define SEQ_CC_LAY_CONST_B10    0x19
56
#define SEQ_CC_LAY_CONST_B11    0x1a
57
#define SEQ_CC_LAY_CONST_B12    0x1b
58
#define SEQ_CC_LAY_CONST_B13    0x1c
59
#define SEQ_CC_LAY_CONST_B14    0x1d
60
#define SEQ_CC_LAY_CONST_B15    0x1e
61
#define SEQ_CC_LAY_CONST_B16    0x1f
168 tk 62
 
333 tk 63
// usage depends on event mode (e.g. drum tracks: Accented Velocity for up to 16 trigger layers)
318 tk 64
#define SEQ_CC_LAY_CONST_C1 0x20
65
#define SEQ_CC_LAY_CONST_C2 0x21
66
#define SEQ_CC_LAY_CONST_C3 0x22
67
#define SEQ_CC_LAY_CONST_C4 0x23
68
#define SEQ_CC_LAY_CONST_C5 0x24
69
#define SEQ_CC_LAY_CONST_C6 0x25
70
#define SEQ_CC_LAY_CONST_C7 0x26
71
#define SEQ_CC_LAY_CONST_C8 0x27
72
#define SEQ_CC_LAY_CONST_C9 0x28
73
#define SEQ_CC_LAY_CONST_C10    0x29
74
#define SEQ_CC_LAY_CONST_C11    0x2a
75
#define SEQ_CC_LAY_CONST_C12    0x2b
76
#define SEQ_CC_LAY_CONST_C13    0x2c
77
#define SEQ_CC_LAY_CONST_C14    0x2d
78
#define SEQ_CC_LAY_CONST_C15    0x2e
79
#define SEQ_CC_LAY_CONST_C16    0x2f
168 tk 80
 
599 tk 81
#define SEQ_CC_LFO_WAVEFORM        0x30
82
#define SEQ_CC_LFO_AMPLITUDE       0x31
83
#define SEQ_CC_LFO_PHASE           0x32
84
#define SEQ_CC_LFO_STEPS           0x33
85
#define SEQ_CC_LFO_STEPS_RST       0x34
86
#define SEQ_CC_LFO_ENABLE_FLAGS    0x35
87
#define SEQ_CC_LFO_CC              0x36
88
#define SEQ_CC_LFO_CC_OFFSET       0x37
89
#define SEQ_CC_LFO_CC_PPQN         0x38
168 tk 90
 
599 tk 91
// reserved: 0x39..0x3f
92
 
318 tk 93
#define SEQ_CC_MODE     0x40
94
#define SEQ_CC_MODE_FLAGS   0x41
323 tk 95
#define SEQ_CC_MIDI_EVENT_MODE  0x42
600 tk 96
 
97
#define SEQ_CC_LIMIT_LOWER      0x43
98
#define SEQ_CC_LIMIT_UPPER      0x44
99
 
1023 tk 100
#define SEQ_CC_BUSASG           0x45
318 tk 101
#define SEQ_CC_MIDI_CHANNEL 0x46
102
#define SEQ_CC_MIDI_PORT    0x47
168 tk 103
 
318 tk 104
#define SEQ_CC_DIRECTION    0x48
105
#define SEQ_CC_STEPS_REPLAY 0x49
106
#define SEQ_CC_STEPS_FORWARD    0x4a
107
#define SEQ_CC_STEPS_JMPBCK 0x4b
108
#define SEQ_CC_CLK_DIVIDER  0x4c
109
#define SEQ_CC_LENGTH       0x4d
110
#define SEQ_CC_LOOP     0x4e
111
#define SEQ_CC_CLKDIV_FLAGS 0x4f
168 tk 112
 
318 tk 113
#define SEQ_CC_TRANSPOSE_SEMI   0x50
114
#define SEQ_CC_TRANSPOSE_OCT    0x51
115
#define SEQ_CC_GROOVE_VALUE 0x52
116
#define SEQ_CC_GROOVE_STYLE 0x53
117
#define SEQ_CC_MORPH_MODE   0x54
607 tk 118
#define SEQ_CC_MORPH_DST    0x55
318 tk 119
#define SEQ_CC_HUMANIZE_VALUE   0x56
120
#define SEQ_CC_HUMANIZE_MODE    0x57
235 tk 121
 
333 tk 122
#define SEQ_CC_PAR_ASG_DRUM_LAYER_A 0x58
123
#define SEQ_CC_PAR_ASG_DRUM_LAYER_B 0x59
593 tk 124
// free: 0x5a..0x5b
318 tk 125
 
593 tk 126
#define SEQ_CC_STEPS_REPEAT      0x5c
127
#define SEQ_CC_STEPS_SKIP        0x5d
128
#define SEQ_CC_STEPS_RS_INTERVAL 0x5e
129
// free: 0x5f
130
 
318 tk 131
#define SEQ_CC_ASG_GATE     0x60
132
#define SEQ_CC_ASG_ACCENT   0x61
133
#define SEQ_CC_ASG_ROLL     0x62
134
#define SEQ_CC_ASG_GLIDE    0x63
135
#define SEQ_CC_ASG_SKIP     0x64
136
#define SEQ_CC_ASG_RANDOM_GATE  0x65
137
#define SEQ_CC_ASG_RANDOM_VALUE 0x66
138
#define SEQ_CC_ASG_NO_FX    0x67
139
// free: 0x68..0x6f, evtl. for more trigger types
140
 
141
#define SEQ_CC_ECHO_REPEATS 0x70
142
#define SEQ_CC_ECHO_DELAY   0x71
143
#define SEQ_CC_ECHO_VELOCITY    0x72
144
#define SEQ_CC_ECHO_FB_VELOCITY 0x73
145
#define SEQ_CC_ECHO_FB_NOTE 0x74
146
#define SEQ_CC_ECHO_FB_GATELENGTH 0x75
147
#define SEQ_CC_ECHO_FB_TICKS    0x76
148
 
149
// free: 0x77..0x7f
150
 
151
 
168 tk 152
/////////////////////////////////////////////////////////////////////////////
153
// Global Types
154
/////////////////////////////////////////////////////////////////////////////
155
 
174 tk 156
typedef struct {
596 tk 157
  u8 lay_const[3*16];           // 3*16 constant parameters
318 tk 158
 
159
  seq_core_shared_t shared;   // shared mode parameters (each track holds another value)
168 tk 160
  seq_core_trkmode_flags_t mode; // track mode and flags
1023 tk 161
  seq_event_mode_t event_mode:4;  // event mode
162
  seq_core_busasg_t busasg;     // T&A bus port (0..3)
168 tk 163
  mios32_midi_port_t midi_port; // MIDI port
164
  mios32_midi_chn_t midi_chn:4; // MIDI channel
848 tk 165
  u8       dir_mode:4;        // track direction mode (limited to 4 bits, see also seq_cc_trk_dir_t)
166
  u8       steps_replay:4;    // steps replay value
167
  u8       steps_forward:4;   // steps forward value
168
  u8       steps_jump_back:4; // steps jump back value
593 tk 169
  u8       steps_repeat;      // steps repeat value
170
  u8       steps_skip;        // steps skip value
171
  u8       steps_rs_interval; // interval of Repeat/Skip function
168 tk 172
  seq_core_clkdiv_t clkdiv;     // clock divider and flags
173
  u8       length;            // track length
174
  u8       loop;              // loop point
848 tk 175
  u8       transpose_semi:4;  // semitons transpose
176
  u8       transpose_oct:4;   // octave transpose
177
  u8       morph_mode:4;      // morph mode
178
  u8       humanize_mode:4;   // humanize mode
607 tk 179
  u8       morph_dst;         // morph destination step
599 tk 180
  u8       groove_style;      // groove style
344 tk 181
  u8       groove_value;      // groove intensity
182
  u8       humanize_value;    // humanize intensity
168 tk 183
  seq_trg_assignments_t trg_assignments; // trigger assignments to gate/skip/acc/gilde/roll/R.G/R.V
235 tk 184
 
333 tk 185
  u8       par_assignment_drum[2]; // only used in drum mode
186
 
235 tk 187
  // new in MBSEQ V4
1121 tk 188
  u8       echo_repeats;      // repeats (0..15)
189
  u8       echo_delay;        // delay between echoed notes (different predefined lengths + Rnd1/2)
848 tk 190
  u8       echo_velocity;     // initial velocity 0%..200%, 5 step resolution (41 values)
191
  u8       echo_fb_velocity;   // feedbacked velocity (41 values)
192
  u8       echo_fb_note;      // feedbacked note (-24..24 + random = 50 values)
193
  u8       echo_fb_gatelength; // feedbacked gatelength 0%..200%, 5 step resolution (41 values)
194
  u8       echo_fb_ticks;     // feedbacked ticks 0%..200%, 5 step resolution (41 values)
333 tk 195
 
599 tk 196
  seq_lfo_waveform_t lfo_waveform; // off/Sine/Tri/Saw/Rec 5..95
197
  u8       lfo_amplitude;     // -128..0..127
198
  u8       lfo_phase;         // 0..255
199
  u8       lfo_steps;         // 0..255
200
  u8       lfo_steps_rst;     // 0..255
201
  seq_lfo_enable_flags_t lfo_enable_flags;  // see structure
202
  u8       lfo_cc;            // 0..127
203
  u8       lfo_cc_offset;     // 0..127
204
  u8       lfo_cc_ppqn;       // 3..384
205
 
600 tk 206
  u8       limit_lower;       // for note value limits
207
  u8       limit_upper;       // for note value limits
208
 
333 tk 209
  // temporary variables which will be updated on CC writes
210
  s8 link_par_layer_note;        // parameter layer which stores the first note value (-1 if not assigned)
211
  s8 link_par_layer_chord;       // parameter layer which stores the first chord value (-1 if not assigned)
212
  s8 link_par_layer_velocity;    // parameter layer which stores the first velocity value (-1 if not assigned)
213
  s8 link_par_layer_length;      // parameter layer which stores the first length value (-1 if not assigned)
214
  s8 link_par_layer_probability; // parameter layer which stores probability value (-1 if not assigned)
215
  s8 link_par_layer_delay;       // parameter layer which stores delay value (-1 if not assigned)
216
  s8 link_par_layer_roll;        // parameter layer which stores roll value (-1 if not assigned)
1024 tk 217
  s8 link_par_layer_roll2;       // parameter layer which stores roll2 value (-1 if not assigned)
168 tk 218
} seq_cc_trk_t;
219
 
220
 
221
/////////////////////////////////////////////////////////////////////////////
222
// Prototypes
223
/////////////////////////////////////////////////////////////////////////////
224
 
225
extern s32 SEQ_CC_Init(u32 mode);
226
 
248 tk 227
extern s32 SEQ_CC_Set(u8 track, u8 cc, u8 value);
741 tk 228
extern s32 SEQ_CC_MIDI_Set(u8 track, u8 cc, u8 value);
1794 tk 229
extern s32 SEQ_CC_MIDI_Get(u8 track, u8 cc, u8 *mapped_cc);
168 tk 230
extern s32 SEQ_CC_Get(u8 track, u8 cc);
231
 
769 tk 232
extern s32 SEQ_CC_LinkUpdate(u8 track);
168 tk 233
 
769 tk 234
 
168 tk 235
/////////////////////////////////////////////////////////////////////////////
236
// Export global variables
237
/////////////////////////////////////////////////////////////////////////////
238
 
239
extern seq_cc_trk_t seq_cc_trk[SEQ_CORE_NUM_TRACKS];
240
 
241
 
242
#endif /* _SEQ_CC_H */