Clemens Valens / inc

Dependents:   SoundEngine

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers midi.h Source File

midi.h

00001 /*
00002 Copyright 2013 Paul Soulsby www.soulsbysynths.com
00003     This file is part of Atmegatron.
00004 
00005     Atmegatron is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     Atmegatron is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with Atmegatron.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 #ifndef __MIDI_H__
00020 #define __MIDI_H__
00021 
00022 
00023 //frequency of all midi notes  (rounded to nearest integer)
00024 extern const uint16_t MIDI_freqs[128];
00025 
00026 //midi constants
00027 #define NOTE_OFF 128
00028 #define NOTE_ON 144
00029 #define PITCH_WHEEL 224
00030 #define CONTROLLER 176
00031 #define SYSEXBEGIN 240
00032 #define SYSEXEND 247
00033 #define CC_PITCHLFO 1
00034 #define CC_PORTAMENTO 5
00035 #define CC_FILTERENV 16
00036 #define CC_DISTORTION 17
00037 #define CC_FILTCUTOFF 74 
00038 #define CC_AMPENVR 72
00039 #define CC_AMPENVA 73
00040 #define CC_FILTRES 71
00041 #define CC_AMPENVD 75
00042 #define CC_LFOCLOCKDIV 79
00043 #define CC_PWM 91
00044 #define CC_AMPLFO 92
00045 #define CC_FILTLFO 93
00046 #define CC_PITCHENV 94
00047 #define CC_FLANGE 95
00048 
00049 //sysex message types, used by librarian software
00050 #define SYSEX_PATCH 0
00051 #define SYSEX_WAVE 1
00052 #define SYSEX_MEM 2
00053 #define SYSEX_CALLPATCH 3
00054 #define SYSEX_CALLWAVE 4
00055 
00056 byte MIDI_Get_curNote(void);
00057 unsigned int MIDI_Get_Freq(byte notenum);
00058 boolean MIDI_Get_KeyDown(byte notenum);
00059 void MIDI_Let_ClockArpSpeed(unsigned int newspeed);
00060 void MIDI_Let_SYSEXRead(boolean newval);
00061 boolean MIDI_Get_ClockPresent(void);
00062 void MIDI_Set_Channel(byte newchannel);
00063 void MIDI_Init(void);
00064 void MIDI_NoteOn(byte notenum);
00065 void MIDI_NoteOff(byte notenum);
00066 void MIDI_TriggerNote(byte notenum);
00067 void MIDI_Reset(void);
00068 void MIDI_TestButtonDown(void);
00069 void MIDI_TestButtonUp(void);
00070 void MIDI_TestButtonInc(void);
00071 void MIDI_TestButtonDec(void);
00072 void MIDI_ClockStart(void);
00073 void MIDI_ClockContinue(void);
00074 void MIDI_ClockStop(void);
00075 void MIDI_ClockTick(void);
00076 unsigned long MIDI_Get_ClockTick(void);
00077 char MIDI_Get_PitchBend_Level(void);
00078 void MIDI_SYSEX_read(byte databyte);
00079 void MIDI_SYSEX_write_patch(void);
00080 void MIDI_Poll(void);
00081 
00082 
00083 #endif // __MIDI_H__