public int next_note( int data_offset, int[] note ) {
		int bitmask, field;
		if( data_offset < 0 ) {
			data_offset = pattern_data.length;
		}
		bitmask = 0x80;
		if( data_offset < pattern_data.length ) {
			bitmask = pattern_data[ data_offset ] & 0xFF;
		}
		if( ( bitmask & 0x80 ) == 0x80 ) {
			data_offset += 1;
		} else {
			bitmask = 0x1F;
		}
		for( field = 0; field < 5; field++ ) {
			note[ field ] = 0;
			if( ( bitmask & 0x01 ) == 0x01 ) {
				if( data_offset < pattern_data.length ) {
					note[ field ] = pattern_data[ data_offset ] & 0xFF;
					data_offset += 1;
				}
			}
			bitmask = bitmask >> 1;
		}
		return data_offset;
	}