Common defines for the BaseMachine
BaseMachineCommon.h@5:41422a08bd8e, 2016-10-28 (annotated)
- Committer:
- ryood
- Date:
- Fri Oct 28 03:53:24 2016 +0000
- Revision:
- 5:41422a08bd8e
- Parent:
- 4:f02ce4f32137
Change SPI bits to 8bit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ryood | 0:a7a23cc867a6 | 1 | /* |
ryood | 0:a7a23cc867a6 | 2 | * BaseMachine_Common.h |
ryood | 0:a7a23cc867a6 | 3 | * |
ryood | 0:a7a23cc867a6 | 4 | * 2016.10.23 |
ryood | 0:a7a23cc867a6 | 5 | * |
ryood | 0:a7a23cc867a6 | 6 | */ |
ryood | 0:a7a23cc867a6 | 7 | |
ryood | 2:c2d51503c005 | 8 | #define SPI_UI_TO_SEQUENCER_RATE (1500000) // Actual frequency about 1.3MHz |
ryood | 5:41422a08bd8e | 9 | #define SPI_UI_TO_SEQUENCER_BITS (8) |
ryood | 4:f02ce4f32137 | 10 | #define SPI_UI_TO_SEQUENCER_MODE (0) |
ryood | 0:a7a23cc867a6 | 11 | #define SEQUENCE_N (16) |
ryood | 0:a7a23cc867a6 | 12 | |
ryood | 0:a7a23cc867a6 | 13 | enum SequencerCmd { |
ryood | 0:a7a23cc867a6 | 14 | CMD_RCV_PLAYING_STEP = 0x01, |
ryood | 0:a7a23cc867a6 | 15 | CMD_RUN = 0x11, |
ryood | 0:a7a23cc867a6 | 16 | CMD_BPM = 0x12, |
ryood | 0:a7a23cc867a6 | 17 | CMD_ACCENT_LEVEL = 0x13, |
ryood | 0:a7a23cc867a6 | 18 | CMD_WAVE_SHAPE = 0x21, |
ryood | 0:a7a23cc867a6 | 19 | CMD_PULSE_WIDTH = 0x22, |
ryood | 0:a7a23cc867a6 | 20 | CMD_CUTOFF = 0x31, |
ryood | 0:a7a23cc867a6 | 21 | CMD_RESONANCE = 0x32, |
ryood | 0:a7a23cc867a6 | 22 | CMD_LEVEL = 0x41, |
ryood | 0:a7a23cc867a6 | 23 | CMD_DURATION = 0x42, |
ryood | 0:a7a23cc867a6 | 24 | CMD_DECAY = 0x43, |
ryood | 0:a7a23cc867a6 | 25 | CMD_SUSTAIN = 0x44, |
ryood | 0:a7a23cc867a6 | 26 | CMD_NOTE = 0x51, |
ryood | 0:a7a23cc867a6 | 27 | CMD_PITCH = 0x52, |
ryood | 0:a7a23cc867a6 | 28 | }; |
ryood | 0:a7a23cc867a6 | 29 | |
ryood | 0:a7a23cc867a6 | 30 | const int baseNoteNumber = 36; |
ryood | 0:a7a23cc867a6 | 31 | |
ryood | 0:a7a23cc867a6 | 32 | // Initial Sequence |
ryood | 0:a7a23cc867a6 | 33 | const int noteOn[SEQUENCE_N] = { 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0 }; |
ryood | 0:a7a23cc867a6 | 34 | const int pitch[SEQUENCE_N] = {36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36 }; |
ryood | 0:a7a23cc867a6 | 35 | const int tie[SEQUENCE_N] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
ryood | 0:a7a23cc867a6 | 36 | const int accent[SEQUENCE_N] = { 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 }; |
ryood | 0:a7a23cc867a6 | 37 |