public ChannelBuffer encode(PlayNoteMessage message) throws IOException {
ChannelBuffer buffer = ChannelBuffers.buffer(12);
buffer.writeInt(message.getX());
buffer.writeShort(message.getY());
buffer.writeInt(message.getZ());
buffer.writeByte(message.getInstrument());
buffer.writeByte(message.getPitch());
return buffer;
}
}