Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
midiUtil.h File Reference

Go to the source code of this file.

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