resonance 1.0.1
Loading...
Searching...
No Matches
synth.h
Go to the documentation of this file.
1#pragma once
2
3#include "app/msgsink.h"
4#include "msg/message.h"
5
6class StdMidiMsg;
7
41class Synth : public MsgSink {
42public:
47 virtual ~Synth();
48
61 virtual void LoadBankSet4();
62
72 virtual void LoadBankSet5();
73
83 virtual void LoadBankSet6();
84
94 virtual void UnusedHook();
95
106 virtual void UnloadBanks();
107
121 virtual void PlayMidi(unsigned char nStatus, unsigned char nData1, unsigned char nData2) = 0;
122
132 virtual void OnPlayStarted();
133
146 virtual void SelectBank(unsigned char nChannel, unsigned char nBank);
147
158 virtual void SetStereo(int bStereo);
159
170 virtual void SetRemixMode(int bRemix);
171
182 virtual void SetPaused(int bPaused);
183
193 virtual void AllNotesOff();
194
205
216 void SetChannelVolume(unsigned char nVolume);
217
230 void Setup();
231
244 void FadeOut(int nDurationMs);
245
246protected:
256
267 virtual void DispatchPriv(Message *pMsg);
268};
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
Receiver of engine messages.
Definition msgsink.h:37
Event the game passes between a MsgSource and a MsgSink.
Definition stdmidimsg.h:27
Abstract base of the game's sound output.
Definition synth.h:41
virtual void UnloadBanks()
Release every loaded bank.
virtual void SetStereo(int bStereo)
Switch between stereo and mono output.
virtual void AllNotesOffExceptSfxChannel()
Silence every channel but the sound-effect channel.
virtual void SetRemixMode(int bRemix)
Switch the remix mode of the sound driver.
virtual void OnPlayStarted()
Respond to the start of play.
virtual void LoadBankSet5()
Load one of the three bank sets.
virtual void UnusedHook()
Do nothing.
virtual void DispatchPriv(Message *pMsg)
Act on a message.
virtual void SelectBank(unsigned char nChannel, unsigned char nBank)
Select a bank on one channel.
virtual ~Synth()
virtual void LoadBankSet4()
Load one of the three bank sets.
void FadeOut(int nDurationMs)
Fade every channel's volume to silence over a duration.
void SetChannelVolume(unsigned char nVolume)
Set the volume of every channel.
void Setup()
Put every channel into its starting state.
virtual void SetPaused(int bPaused)
Pause or resume the sound driver.
virtual void PlayMidi(unsigned char nStatus, unsigned char nData1, unsigned char nData2)=0
Move one MIDI message to the hardware.
virtual void LoadBankSet6()
Load one of the three bank sets.
virtual void AllNotesOff()
Silence every channel.
void OnStdMidi(StdMidiMsg *pMsg)
Sends the message's three bytes through PlayMidi().