Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
midiUtil.c File Reference

Functions

uq16_16 bendPitchWheel (uint8_t noteId, uint16_t pitchWheel)
 Calculate the frequency of a MIDI note bent by a pitch wheel setting.
 
uq16_16 bendPitchFreq (uq16_16 freq, int32_t bendCents)
 Calculate the new note frequency resulting from a pitch bend.
 

Function Documentation

◆ bendPitchWheel()

uq16_16 bendPitchWheel ( uint8_t noteId,
uint16_t pitchWheel )

Calculate the frequency of a MIDI note bent by a pitch wheel setting.

Parameters
noteIdThe MIDI note ID to bend
pitchWheelThe 14-bit MIDI pitch wheel value
Returns
uq16_16 The note frequency as a UQ16.16 value

◆ bendPitchFreq()

uq16_16 bendPitchFreq ( uq16_16 freq,
int32_t bendCents )

Calculate the new note frequency resulting from a pitch bend.

Parameters
freqThe frequency, in Hertz, of the note
bendCentsThe number of cents to bend the note, between -100 and 100 inclusive
Returns
uq16_16 The note frequency as a UQ16.16 value