Noise Nugget SDK
midi_utils.h File Reference

MIDI messages decoder. More...

#include <stdbool.h>
#include <unistd.h>
Include dependency graph for midi_utils.h:

Go to the source code of this file.

Data Structures

struct  midi_decoder
 

Typedefs

typedef enum midi_cmd midi_cmd
 
typedef enum midi_sys_cmd midi_sys_cmd
 
typedef struct midi_decoder midi_decoder
 

Enumerations

enum  midi_cmd {
  Note_Off = 0x8 , Note_On = 0x9 , Aftertouch = 0xA , Continous_Controller = 0xB ,
  Patch_Change = 0xC , Channel_Pressure = 0xD , Pitch_Bend = 0xE , Sys = 0xF
}
 
enum  midi_sys_cmd {
  Exclusive = 0x0 , Song_Position = 0x2 , Song_Select = 0x3 , Bus_Select = 0x5 ,
  Tune_Request = 0x6 , End_Exclusive = 0x7 , Timming_Tick = 0x8 , Start_Song = 0xA ,
  Continue_Song = 0xB , Stop_Song = 0xC , Active_Sensing = 0xE , Reset = 0xF
}
 

Functions

void midi_decoder_init (midi_decoder *dec)
 Init/reset a MIDI decoder. More...
 
uint32_t midi_decoder_push (midi_decoder *dec, uint8_t byte)
 Process and incoming byte of MIDI input. More...
 

Detailed Description

MIDI messages decoder.

Function Documentation

◆ midi_decoder_init()

void midi_decoder_init ( midi_decoder dec)

Init/reset a MIDI decoder.

Parameters
decMIDI decoder instance

◆ midi_decoder_push()

uint32_t midi_decoder_push ( midi_decoder dec,
uint8_t  byte 
)

Process and incoming byte of MIDI input.

Parameters
decMIDI decoder instance
byteincoming byte of MIDI input
Returns
decoded midi message or 0 for no message