synthberry
Software MIDI synthesizer for the Raspberry Pi.
 All Classes Functions
Public Member Functions | List of all members
SerialMidi Class Reference

Class for using a serial connection as a MIDI source. More...

#include <serialmidi.h>

Inheritance diagram for SerialMidi:
Inheritance graph
[legend]
Collaboration diagram for SerialMidi:
Collaboration graph
[legend]

Public Member Functions

 SerialMidi (std::string serialPath)
void run ()
 Parse MIDI messages.
NotesgetNotes ()
 Get Notes reference.

Detailed Description

Class for using a serial connection as a MIDI source.

SerialMidi is a class implementing IMidiSource, parsing MIDI messages received on the given serial port.

The baudrate is statically set to 38400, which corresponds to 31250 on a Raspberry Pi with modified serial clock.

SerialMidi parses NoteOn and NoteOff messages destined to channel 0.

Definition at line 21 of file serialmidi.h.

Constructor & Destructor Documentation

SerialMidi::SerialMidi ( std::string  serialPath)

Construct a SerialMidi object.

Use "/dev/ttyAMA0" for the serialPath on the Raspberry Pi.

Parameters
serialPathPath pointing to serial device on which MIDI messages are received.

Definition at line 12 of file serialmidi.cpp.

Member Function Documentation

Notes & SerialMidi::getNotes ( )
virtual

Get Notes reference.

Get a reference to the Notes object which receives its notes from the parsed MIDI data.

Implements IMidiSource.

Definition at line 87 of file serialmidi.cpp.

void SerialMidi::run ( )
virtual

Parse MIDI messages.

Start parsing MIDI data on the serial connection. This is a blocking call. Any received notes will be stored in the Notes object to which a reference can be retrieved with getNotes().

Implements IMidiSource.

Definition at line 36 of file serialmidi.cpp.


The documentation for this class was generated from the following files: