ECE 4760 Final Project
 All Files Functions Variables Enumerations Enumerator Macros
Macros | Functions
midi.c File Reference
#include "inttypes.h"
#include <stdio.h>
#include <util/delay.h>
#include "uart.h"
#include "midi.h"

Go to the source code of this file.


#define m4(x)   (x&0x0F)
#define m7(x)   (x&0x7F)
#define m14(x)   (x&0x3FFF)
#define up7(x)   (0x7F&(x>>7))
#define lo7(x)   (0x7F&(x))


void send_byte (uint8_t byte)
void send_status_byte (uint8_t cmd, uint8_t channel)
void pitch_bend (uint8_t channel, int16_t value)
void change_instrument (uint8_t channel, uint8_t instrument)
void change_volume (uint8_t chan, uint8_t vol)
void send_controller_command (uint8_t channel, uint8_t controller, uint8_t value)
void send_note (uint8_t channel, uint8_t vel, uint8_t pitch)
void send_note_off (uint8_t channel, uint8_t vel, uint8_t pitch)

Macro Definition Documentation

#define lo7 (   x)    (0x7F&(x))

Definition at line 18 of file midi.c.

#define m14 (   x)    (x&0x3FFF)

Definition at line 13 of file midi.c.

#define m4 (   x)    (x&0x0F)

Definition at line 11 of file midi.c.

#define m7 (   x)    (x&0x7F)

Definition at line 12 of file midi.c.

#define up7 (   x)    (0x7F&(x>>7))

Definition at line 17 of file midi.c.

Function Documentation

void change_instrument ( uint8_t  channel,
uint8_t  instrument 

Definition at line 37 of file midi.c.

void change_volume ( uint8_t  chan,
uint8_t  vol 

Definition at line 42 of file midi.c.

void pitch_bend ( uint8_t  channel,
int16_t  value 

Definition at line 29 of file midi.c.

void send_byte ( uint8_t  byte)

Definition at line 20 of file midi.c.

void send_controller_command ( uint8_t  channel,
uint8_t  controller,
uint8_t  value 

Definition at line 46 of file midi.c.

void send_note ( uint8_t  channel,
uint8_t  vel,
uint8_t  pitch 

Definition at line 52 of file midi.c.

void send_note_off ( uint8_t  channel,
uint8_t  vel,
uint8_t  pitch 

Definition at line 58 of file midi.c.

void send_status_byte ( uint8_t  cmd,
uint8_t  channel 

Definition at line 24 of file midi.c.