lib/file/encoder/chunk.js
function encodeChunk(type, data) {
    var cursor = new BufferCursor(new buffer.Buffer(
        buffer.Buffer.byteLength(type) + 4 + data.length
    ));

    cursor.write(type);
    cursor.writeUInt32BE(data.length);
    cursor.copy(data);

    return cursor.buffer;
}
function encodeChunk(type, data) {
    var cursor = new BufferCursor(new buffer.Buffer(
        buffer.Buffer.byteLength(type) + 4 + data.length
    ));

    cursor.write(type);
    cursor.writeUInt32BE(data.length);
    cursor.copy(data);

    return cursor.buffer;
}
function encodeChunk ( type , data ) { var cursor = new BufferCursor ( new buffer . Buffer ( buffer . Buffer . byteLength ( type ) + 4 + data . length ) ) ; cursor . write ( type ) ; cursor . writeUInt32BE ( data . length ) ; cursor . copy ( data ) ; return cursor . buffer ; }
Encode a MIDI chunk

@param {string} type Chunk type
@param {Buffer} data Chunk data
@return {Buffer} Encoded chunk
Encode a MIDI chunk