Skip to content

Commit

Permalink
Added missing channel property of UMP
Browse files Browse the repository at this point in the history
  • Loading branch information
ZILtoid1991 committed Aug 22, 2021
1 parent c10f893 commit fc9b629
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions source/midi2/types/structs.d
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,20 @@ struct UMP {
ushort bend() const {
return (cast(ushort)bytes[3])<<7 | bytes[2];
}
/**
* Return the channel number of this packet.
*/
ubyte channel() const {
return bytes[1] & 0xF;
}
/**
* Sets the channel number of this packet.
*/
ubyte channel(ubyte val) {
bytes[1] &= 0xF0;
bytes[1] |= val & 0xF;
return bytes[1] & 0xF;
}
}
}
/**
Expand Down

0 comments on commit fc9b629

Please sign in to comment.