22 #ifndef SCUMM_IMUSE_MAC_M68K_H 23 #define SCUMM_IMUSE_MAC_M68K_H 25 #include "audio/softsynth/emumidi.h" 27 #include "common/hashmap.h" 30 class SeekableReadStream;
36 friend class MidiChannel_MacM68k;
42 void close()
override;
44 void send(uint32 d)
override;
47 MidiChannel *getPercussionChannel()
override {
return nullptr; }
49 bool isStereo()
const override {
return false; }
57 void generateSamples(int16 *buf,
int len)
override;
58 void onTimer()
override {}
65 Instrument() { reset(); }
85 kDefaultInstrument = 0x3E7,
86 kProgramChangeBase = 0x3E8,
90 Instrument getInstrument(
int idx)
const;
92 InstrumentMap _instruments;
93 Instrument _defaultInstrument;
94 void loadAllInstruments();
97 struct OutputChannel {
100 const byte *instrument;
106 const byte *soundStart;
107 const byte *soundEnd;
108 const byte *loopStart;
119 void setPitch(OutputChannel *out,
int frequency);
120 int _pitchTable[128];
123 static const int _volumeBaseTable[32];
125 class MidiChannel_MacM68k;
127 struct VoiceChannel {
128 MidiChannel_MacM68k *part;
129 VoiceChannel *prev, *next;
142 _priority(0), _sustain(0), _pitchBend(0), _pitchBendFactor(2), _transpose(0), _detune(0), _volume(0), _voice(
nullptr), _instrument() {}
143 MidiDriver *device()
override {
return _owner; }
144 byte getNumber()
override {
return _number; }
145 void release()
override;
147 void send(uint32 b)
override;
148 void noteOff(byte note)
override;
149 void noteOn(byte note, byte velocity)
override;
150 void programChange(byte program)
override;
151 void pitchBend(int16 bend)
override;
152 void controlChange(byte control, byte value)
override;
153 void pitchBendFactor(byte value)
override;
154 void transpose(int8 value)
override;
155 void detune(int16 value)
override;
156 void priority(byte value)
override;
157 void sysEx_customInstrument(uint32 type,
const byte *instr, uint32 dataSize)
override;
161 void addVoice(VoiceChannel *voice);
162 void removeVoice(VoiceChannel *voice);
168 VoiceChannel *_voice;
171 Instrument _instrument;
173 int _pitchBendFactor;
179 MidiChannel_MacM68k *_channels[32];
184 VoiceChannel _voiceChannels[kChannelCount];
185 int _lastUsedVoiceChannel;
186 VoiceChannel *allocateVoice(
int priority);
Definition: mac_m68k.h:35
Definition: mididrv.h:309
int getRate() const override
Definition: mac_m68k.h:50
Definition: algorithm.h:29
Definition: mididrv.h:537
bool isStereo() const override
Definition: mac_m68k.h:49