Subversion Repositories svn.mios32

Rev

Rev 2595 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2595 Rev 2596
Line 5... Line 5...
5
//
5
//
6
// In playback, all clips will start to play back, regardless of their mute state.
6
// In playback, all clips will start to play back, regardless of their mute state.
7
// Also, all clips will loop by default (it is called LoopA, anyways)
7
// Also, all clips will loop by default (it is called LoopA, anyways)
8
// This emulates the behaviour of the MBSEQ.
8
// This emulates the behaviour of the MBSEQ.
9
//
9
//
10
// INTERFACE (LoopA v2 - with limited encoders/buttons)
-
 
11
// ----------------------------------------------------
-
 
12
//
-
 
13
// Right encoder: flips through pages aka modes (unless a command is selected, then it changes its data value)
-
 
14
//
-
 
15
// Left encoder: changes global data of mode:
-
 
16
//    - in play mode, changes currently active track
-
 
17
//    - in note mode, changes currently selected note
-
 
18
//    - in disk mode, changes selected session number
-
 
19
//
-
 
20
// To modify command data (e.g. transpose), the GP button under the command must be pushed, then the
-
 
21
// right encoder can change the command data. Pushing the GP button again exits command data modification mode, then
-
 
22
// the right encoder can be used again to change pages aka modes.
-
 
23
//
-
 
24
// Pushing the right or left encoder always returns back to play mode (shortcut)
-
 
25
// (v3 needs no pushable encoders, as we will have more buttons and encoders directly under the commands)
-
 
26
// =================================================================================================
10
// =================================================================================================
27
11
28
#include "commonIncludes.h"
12
#include "commonIncludes.h"
29
13
30
#include "tasks.h"
-
 
31
#include "file.h"
-
 
32
#include "loopa.h"
14
#include "loopa.h"
33
#include "hardware.h"
15
#include "hardware.h"
34
#include "ui.h"
16
#include "ui.h"
35
#include "screen.h"
17
#include "screen.h"
36
#include "app_lcd.h"
18
#include "app_lcd.h"
37
#include "voxelspace.h"
19
#include "voxelspace.h"
-
 
20
#include "setup.h"
38
21
39
// --  Local types ---
22
// --  Local types ---
40
-
 
41
23
42
// --- Global vars ---
24
// --- Global vars ---
43
25
44
static s32 (*clipPlayEventCallback)(u8 clipNumber, mios32_midi_package_t midi_package, u32 tick) = 0;     // fetchClipEvents() callback
26
static s32 (*clipPlayEventCallback)(u8 clipNumber, mios32_midi_package_t midi_package, u32 tick) = 0;     // fetchClipEvents() callback
45
static s32 (*clipMetaEventCallback)(u8 clipNumber, u8 meta, u32 len, u8 *buffer, u32 tick) = 0; // fetchClipEvents() callback
27
static s32 (*clipMetaEventCallback)(u8 clipNumber, u8 meta, u32 len, u8 *buffer, u32 tick) = 0; // fetchClipEvents() callback
Line 391... Line 373...
391
 *
373
 *
392
 */
374
 */
393
void loopaStartup()
375
void loopaStartup()
394
{
376
{
395
   screenShowLoopaLogo(1);
377
   screenShowLoopaLogo(1);
396
   
-
 
397
   // Set up fixed MIDI router
-
 
398
   DEBUG_MSG("Setting up MIDI router");
-
 
399
 
-
 
400
   // Router: IN1 all -> OUT2 all 
-
 
401
   midi_router_node_entry_t *n = &midi_router_node[0];
-
 
402
   n->src_port = USB0 + ((4&0xc) << 2) + (4&3);
-
 
403
   n->src_chn = 17;
-
 
404
   n->dst_port = USB0 + ((5&0xc) << 2) + (5&3);
-
 
405
   n->dst_chn = 17;
-
 
406
   
-
 
407
   // Router: IN2 all -> OUT1 all
-
 
408
   n = &midi_router_node[1];
-
 
409
   n->src_port = USB0 + ((5&0xc) << 2) + (5&3);
-
 
410
   n->src_chn = 17;
-
 
411
   n->dst_port = USB0 + ((4&0xc) << 2) + (4&3);
-
 
412
   n->dst_chn = 17;
-
 
413
   
-
 
414
   // Router: IN1 all -> OUT3 all 
-
 
415
   n = &midi_router_node[2];
-
 
416
   n->src_port = USB0 + ((4&0xc) << 2) + (4&3);
-
 
417
   n->src_chn = 17;
-
 
418
   n->dst_port = USB0 + ((6&0xc) << 2) + (6&3);
-
 
419
   n->dst_chn = 17;
-
 
420
   
-
 
421
   // Router: IN3 all -> OUT1 all
-
 
422
   n = &midi_router_node[3];
-
 
423
   n->src_port = USB0 + ((6&0xc) << 2) + (6&3);
-
 
424
   n->src_chn = 17;
-
 
425
   n->dst_port = USB0 + ((4&0xc) << 2) + (4&3);
-
 
426
   n->dst_chn = 17;
-
 
427
}
378
}
428
// -------------------------------------------------------------------------------------------------
379
// -------------------------------------------------------------------------------------------------
429
380
430
381
431
/**
382
/**
Line 909... Line 860...
909
 * SD Card available, initialize LOOPA, load session, prepare screen and menus
860
 * SD Card available, initialize LOOPA, load session, prepare screen and menus
910
 *
861
 *
911
 */
862
 */
912
void loopaSDCardAvailable()
863
void loopaSDCardAvailable()
913
{
864
{
-
 
865
   readSetup();
-
 
866
914
   loadSession(1); // -> XXX: load latest session with a free clip slot instead
867
   loadSession(1); // Todo: load last session (stored in setup)
915
   seqInit();
868
   seqInit();
916
   trackMute_[0] = 0;
869
   trackMute_[0] = 0;
917
   seqArmButton();
870
   seqArmButton();
918
   screenShowLoopaLogo(0); // Disable logo, normal operations started
871
   screenShowLoopaLogo(0); // Disable logo, normal operations started
919
}
872
}