Skip to content

Commit 3be0e5e

Browse files
committed
fixed CPOF midi functions
1 parent 852b9b9 commit 3be0e5e

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

include/plugin.h

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,44 +139,47 @@ class Csound : CSOUND {
139139
return !std::strcmp(GetTypeForArg(arg)->varTypeName, "a");
140140
}
141141

142-
/** midi channel number for this instrument
142+
/** midi channel number for this instrument
143143
*/
144-
int midi_channel() { return GetMidiChannelNumber(this); }
144+
int midi_channel(OPDS *p) { return GetMidiChannelNumber(p); }
145145

146146
/** midi note number for this instrument
147147
*/
148-
int midi_note_num() { return GetMidiNoteNumber(this); }
148+
int midi_note_num(OPDS *p) { return GetMidiNoteNumber(p); }
149149

150150
/** midi note velocity for this instrument
151151
*/
152-
int midi_note_vel() { return GetMidiVelocity(this); }
152+
int midi_note_vel(OPDS *p) { return GetMidiVelocity(p); }
153153

154154
/** midi aftertouch for this channel
155155
*/
156-
MYFLT midi_chn_aftertouch() { return GetMidiChannel(this)->aftouch; }
156+
MYFLT midi_chn_aftertouch(OPDS *p) {
157+
return GetMidiChannel(p)->aftouch; }
157158

158159
/** midi poly aftertouch for this channel
159160
*/
160-
MYFLT midi_chn_polytouch(uint32_t note) {
161-
return GetMidiChannel(this)->polyaft[note];
161+
MYFLT midi_chn_polytouch(OPDS *p, uint32_t note) {
162+
return GetMidiChannel(p)->polyaft[note];
162163
}
163164

164165
/** midi ctl change for this channel
165166
*/
166-
MYFLT midi_chn_ctl(uint32_t ctl) {
167-
return GetMidiChannel(this)->ctl_val[ctl];
167+
MYFLT midi_chn_ctl(OPDS *p, uint32_t ctl) {
168+
return GetMidiChannel(p)->ctl_val[ctl];
168169
}
169170

170171
/** midi pitchbend for this channel
171172
*/
172-
MYFLT midi_chn_pitchbend() { return GetMidiChannel(this)->pchbend; }
173+
MYFLT midi_chn_pitchbend() {
174+
return GetMidiChannel(p)->pchbend;
175+
}
173176

174177
/** list of active instrument instances for this channel \n
175178
returns an INSDS array with 128 items, one per
176179
MIDI note number. Inactive instances are marked NULL.
177180
*/
178-
const INSDS *midi_chn_list() {
179-
return (const INSDS *)GetMidiChannel(this)->kinsptr;
181+
const INSDS *midi_chn_list(OPDS *p) {
182+
return GetMidiChannel(p)->kinsptr;
180183
}
181184

182185
/** deinit registration for a given plugin class

0 commit comments

Comments
 (0)