Skip to content
M.S.T.O.P edited this page Feb 17, 2017 · 12 revisions

(Work in progress)

Sorry, I haven't been keeping this list up to date, so there are a lot of functions and macros that don't appear on this list. I'll get back to updating this list some time in the future.

Macros

FMODGMS_LOOPPOINT_START
Starting loop point. See FMODGMS_Snd_Get_LoopPoints.

FMODGMS_LOOPPOINT_END
End loop point. See FMODGMS_Snd_Get_LoopPoints.

System Functions

real FMODGMS_Sys_Create()
Creates the system.

real FMODGMS_Sys_Initialize(real maxChan)
Initializes the system.

real FMODGMS_Sys_Update()
Updates the FMOD system and spectrum DSP.

real FMODGMS_Sys_Close()
Closes and releases the system.

real FMODGMS_Sys_Set_SoftwareFormat(real sampleRate,real speakermode)
Sets the playback sample rate and speaker mode.

real FMODGMS_Sys_Get_SampleRate()
Gets the playback sample rate.

real FMODGMS_Sys_Get_CPUUsage()
Returns total CPU usage.

real FMODGMS_Sys_Get_MaxSoundIndex()
Returns the highest index in the sound list (number of sounds - 1).

real FMODGMS_Sys_Get_MaxChannelIndex()
Returns the highest index in channel list (number of channels - 1).

FFT (Spectrum) Functions

real FMODGMS_FFT_Set_WindowSize(real size)
Sets the FFT window size (window size = 2 * nyquist = 2 * number of bins). FMODGMS_FFT_Get_NumBins should be called after this function to ensure the game know what the new number of bins are. (NOTE: Doesn't work yet.)

real FMODGMS_FFT_Get_DominantFrequency()
Returns the domainant frequency.

real FMODGMS_FFT_Get_BinValue(real index)
Returns the value of a certain bin in the spectrum.

real FMODGMS_FFT_Get_NumBins()
Returns the number of nims in the spectrum data (= nyquist = windowSize / 2).

Sound Functions

real FMODGMS_Snd_LoadSound(string filename)
Loads a sound and indexes it in the sound list.

real FMODGMS_Snd_LoadStream(string filename)
Loads a sound to a stream and indexes it in sound list.

real FMODGMS_Snd_Unload(real index)
Unload a sound and removes it from the sound list.

real FMODGMS_Snd_PlaySound(real index,real channel)
Plays a sound on a given channel.

real FMODGMS_Snd_Set_LoopMode(real index,real mode,real times)
Set loop mode and count for a particular sound. (0 = Off, 1 = Normal. 2 = Bidirectional)

real FMODGMS_Snd_Set_LoopPoints(real index,real startTimeInSamples,real endTimeInSamples)
Sets the loop point positions in samples for a particular sound. Can be used in conjuction with FMODGMS_Util_SecondsToSamples or FMODGMS_Util_BeatsToSamples for precise loop point control.

real FMODGMS_Snd_Set_ModChannelVolume(real index, real modChannel, real vol)
Sets the channel volume of a module file.

real FMODGMS_Snd_Get_LoopPoints(real index,real whichOne)
Gets the loop point positions in samples for a particular sound. The argument whichOne selects which loop point position to return. Use FMODGMS_LOOPPOINT_START for the starting loop point and FMODGMS_LOOPPOINT_END for the end loop point.

real FMODGMS_Snd_Get_Length(real index)
Gets the length of an audio file in PCM samples.

real FMODGMS_Snd_Get_ModChannelVolume(real index, real modChannel)
Gets the channel volume of a module file.

real FMODGMS_Snd_Get_ModNumChannels(real index)
Gets the number of channels in a module file.

string FMODGMS_Snd_Get_Type(real index)
Returns the type of sound.

Tag Functions

real FMODGMS_Snd_Get_NumTags(real index)
Get number of tags in a sound.

string FMODGMS_Snd_Get_TagName(real soundIndex,real tagIndex)
Get a tag name for a particular sound.

string FMODGMS_Snd_Get_TagTypeFromIndex(real soundIndex,real tagIndex)
Get a tag's type from a given index.

string FMODGMS_Snd_Get_TagDataTypeFromIndex(real soundIndex,real tagIndex)
Get a tag's data type from a given index.

real FMODGMS_Snd_Get_TagRealFromIndex(real soundIndex,real tagIndex)
Get a tag's numerical value (int, float) from a given index.

string FMODGMS_Snd_Get_TagStringFromIndex(real soundIndex,real tagIndex)
Get a tag's string value from a given index.

string FMODGMS_Snd_Get_TagTypeFromName(real soundIndex,string tagName)
Get a tag's type from a given name.

string FMODGMS_Snd_Get_TagDataTypeFromName(real soundIndex,string tagName)
Get a tag's data type from a given name.

real FMODGMS_Snd_Get_TagRealFromName(real soundIndex,string tagName)
Get a tag's numerical value from a given name.

string FMODGMS_Snd_Get_TagStringFromName(real soundIndex,string tagName)
Get a tag's string value from a given name.

Channel Functions

real FMODGMS_Chan_CreateChannel()
Creates a new channel.

real FMODGMS_Chan_RemoveChannel(real channel)
Deletes a channel.

real FMODGMS_Chan_PauseChannel(real channel)
Pauses a channel.

real FMODGMS_Chan_ResumeChannel(real channel)
Resumes a paused channel.

real FMODGMS_Chan_StopChannel(real channel)
Stops a channel.

real FMODGMS_Chan_Set_Position(real channel,real pos)
Sets the playing position of a channel.

real FMODGMS_Chan_Set_Volume(real channel,real vol)
Sets the volume of a channel.

real FMODGMS_Chan_Set_Frequency(real channel,real freq)
Sets playback frequency of a channel.

real FMODGMS_Chan_Set_Pitch(real channel,real pitch)
Sets the pitch (frequency multiplier) of a channel.

real FMODGMS_Chan_Set_ModOrder(real channel,real ord)
Sets the order position of a channel playing a module file.

real FMODGMS_Chan_Set_ModRow(real channel,real row)
Sets the row position of a channel playing a moduile file.

real FMODGMS_Chan_Get_Position(real channel)
Returns the current position of the sound being played on the channel.

real FMODGMS_Chan_Get_Volume(real channel)
Returns the volume of a channel.

real FMODGMS_Chan_Get_Frequency(real channel)
Returns the frequency the channel is being played at.

real FMODGMS_Chan_Get_Pitch(real channel)
Returns the pitch (frequency multipler) of a channel.

real FMODGMS_Chan_Get_ModOrder(real channel)
Returns current order of a module playing in a particular channel.

real FMODGMS_Chan_Get_ModPattern(real channel)
Returns current pattern of a module playing in a particular channel.

real FMODGMS_Chan_Get_ModRow(real channel)
Returns current row of a module playing in a particular channel.

Utility Functions

string FMODGMS_Util_GetErrorMessage()
Relays FMOD error messages to GameMaker:Studio

real FMODGMS_Util_SecondsToSamples(real seconds, real samplingRate)
Converts time measured in seconds to samples. Can be used in conjunction with FMODGMS_Snd_Set_LoopPoints for precise loop point control.

real FMODGMS_Util_BeatsToSamples(real beats, real BPM, real samplingRate)
Converts time measured in beats to samples, assuming a constant BPM. Can be used in conjunction with FMODGMS_Snd_Set_LoopPoints for precise loop point control.

real FMODGMS_Util_SamplesToSeconds(real samples, real samplingRate)
Converts time measured in samples to seconds.

real FMODGMS_Util_SamplesToBeats(real samples, real BPM, real samplingRate)
Converts time measured in samples to beats, assuming a constant BPM.