TR123e - EMCT Computing Final Project Version 1.0
Research Project Translation from gen~ to embedded Moog synth
Loading...
Searching...
No Matches
MidiNoteMessage Struct Reference

Encapsulates MIDI note event data with high-precision timing. More...

#include <MidiHandler.h>

Public Attributes

int noteNumber
 MIDI note number [0-127].
int velocity
 MIDI velocity value [0-127].
float timestamp
 High-precision timestamp in milliseconds.

Detailed Description

Encapsulates MIDI note event data with high-precision timing.

This structure represents a processed MIDI note event containing all necessary information for synthesis parameter control. The timestamp provides microsecond-level timing accuracy for sample-accurate processing.

@data_layout The structure is designed for cache efficiency with aligned data types and minimal padding. Total size: 16 bytes (assuming 64-bit alignment).

@thread_safety Structure is POD (Plain Old Data) type, safe for lockless queue operations and atomic copying between threads without synchronization overhead.

Member Data Documentation

◆ noteNumber

int MidiNoteMessage::noteNumber

MIDI note number [0-127].

Standard MIDI note number representation:

  • 0 = C-1 (~8.18 Hz)
  • 60 = C4 (~261.63 Hz, Middle C)
  • 127 = G9 (~12543.85 Hz)
Note
Values outside [0-127] may be used for internal signaling (e.g., -1 indicates invalid/empty message)

◆ timestamp

float MidiNoteMessage::timestamp

High-precision timestamp in milliseconds.

Absolute time reference with sub-millisecond accuracy for sample-accurate event scheduling. Based on system audio clock for synchronization with audio processing.

@precision Typically μs-level accuracy (0.001ms resolution) @range [0, ∞) - Monotonically increasing during operation @reference Audio system start time (context->audioFramesElapsed)

◆ velocity

int MidiNoteMessage::velocity

MIDI velocity value [0-127].

Represents note velocity or release velocity:

  • 0 = Note off (or minimum velocity)
  • 1-127 = Note on with velocity scaling
  • Velocity 0 in note-on message = note-off per MIDI standard

@musical_significance Velocity affects multiple synthesis parameters:

  • Amplitude envelope peak level
  • Filter envelope intensity
  • Harmonic content (velocity-sensitive filtering)

The documentation for this struct was generated from the following file: