aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 891af65285d7ba53e6ce4fc6c7045e3360aeff8d (plain)
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
#Overview
The idea here is to create a lufa based midi framework for use on the stock usb capable arduino. The goal is twofold:

1. to isolate the lower level usb functions from the actual programs

    a. Targeted transports
    
        1. Lufa
        2. Maple Midi
        3. A neutered version of pjrc's Arduino midi
        4. Microchip's midi code.
        5. Port of MCs midi client to pic32 (dip)
        5. A port of jboones nuvoton cdc code to midi.
        6. YOUR CONTRIBUTION HERE...
   
    b. Targeted Libraries
    
        1. Arduino midi v1 (gpl2)
        2. Arruino midi v2 (gpl3)
        3. alex normans stack (gpl3)
        4. A bsd liscensed framework soon to be released.
        5. YOUR LIBRARY HERE….
      

2. To create a minimal framework for identifying resetting and loading code onto midi devices.


###Breakdown
The majority of the usb-midi specification is in single 4 byte events or packets. The exception to this are sysex messages which are arbitrary in length. 

Because of this the two streams are split out between packets and sysex data. Some of the USB subsystems are interrupt driven. (maple midi zb) and some like lufa are polling based. The data interface must accommodate this. I am trying to arrive at some glue where the lower layers can provide hooks for the maintainance tasks and simply provide an interface like this.

        void InitializeUSBMidi(void);
        bool USBMidiEventAvailable (void);
        MIDI_EVENT_PACKET_t GetUSBMidiEvent (void);
        void SendUSBMidiEvent (MIDI_EVENT_PACKET_t);
        bool USBSysexAvaliable (void);
        uint8_t * GetUSBSysex (void);
        void SendUSBSysex (uint8_t *messege);

The remaining details should be as hidden and interchangable as possible.

###MinSysex
A minimal sysex handler, called by either the maintainence tasks or by MidiEventAvailable(), should handle at a minimum the universal sysex id request and response and a (mma) vender specific sysex to jump to a bootloader. This should be expanded to identify the capabilities, architecture, and code loader method, and perhaps a subset of common midi settings (channel,mode etc.) Eventually this sysex subset will form a protocall called "Let's Get Loaded (LGL)"

This handler should also buffer sysex's that are not directed at the target.

###Hardware Abstractions.
Some of the work involved with the LUFA library is to provide feedback for the states of the the usb connection itself. This requires a hardware abstraction for each board supported by the library. In our use case this  would better be served by providing weak functions to be overridden user functions.