MCPcopy Create free account
hub / github.com/csound/csound / GetChannel

Method GetChannel

interfaces/cs_glue.cpp:1181–1199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1179 */
1180
1181int CsoundMidiOutputBuffer::GetChannel()
1182{
1183 unsigned char st = (unsigned char) 0;
1184
1185 if (bufBytes) {
1186 csoundLockMutex(mutex_);
1187 if (bufBytes > 0) {
1188 int nBytes;
1189 st = buf[bufReadPos] & (unsigned char) 0xFF;
1190 nBytes = (int) midiMessageByteCnt[(st & (unsigned char) 0xF8) >> 3];
1191 if (nBytes < 2 || bufBytes < nBytes)
1192 st = (unsigned char) 0; // invalid MIDI data, or system message
1193 else
1194 st = (st & (unsigned char) 0x0F) + (unsigned char) 1;
1195 }
1196 csoundUnlockMutex(mutex_);
1197 }
1198 return (int) st;
1199}
1200
1201/**
1202 * Returns the first data byte (0 to 127) for the first message in the

Callers 2

getControlChannelMethod · 0.80
getControlChannelMethod · 0.80

Calls 2

csoundLockMutexFunction · 0.85
csoundUnlockMutexFunction · 0.85

Tested by

no test coverage detected