mt-32-display.cpp
branchv_0
changeset 3 51a8362261a9
parent 2 a84830179027
equal deleted inserted replaced
2:a84830179027 3:51a8362261a9
    43  * @param argv
    43  * @param argv
    44  * @return 
    44  * @return 
    45  */
    45  */
    46 int main(int argc, char**argv) {
    46 int main(int argc, char**argv) {
    47 	std::cout << "f0 41 10 16 12 20 00 00 ";
    47 	std::cout << "f0 41 10 16 12 20 00 00 ";
       
    48 	// f0 = start of SysEx message
       
    49 	// 41 = Roland manufacturer ID, see https://www.midi.org/specifications-old/item/manufacturer-id-numbers
       
    50 	// 10 = device ID
       
    51 	// 16 = model ID
       
    52 	// 12 = command ID
       
    53 	// 20 00 00 = show message on the display
       
    54 
       
    55 	// The start and end of the SysEx message and the manufacturer ID are part of the MIDI standard.
       
    56 	// The rest of the bytes is Roland specific.
       
    57 
       
    58 	// TODO: allow changing device ID to support controlling multiple devices in daisy-chain
       
    59 	// TODO: allow custom replacement character ('.')
       
    60 
    48 	std::cout << std::hex << std::setfill('0');
    61 	std::cout << std::hex << std::setfill('0');
    49 
    62 
    50 	int sum = 0;
    63 	int sum = 0;
    51 
    64 
    52 	// 20 00 00 = display message
    65 	// 20 00 00 = display message
    61 	}
    74 	}
    62 
    75 
    63 	sum %= 128;
    76 	sum %= 128;
    64 	sum = 128 - sum;
    77 	sum = 128 - sum;
    65 	std::cout << std::setw(2) << sum;
    78 	std::cout << std::setw(2) << sum;
       
    79 
    66 	std::cout << " f7";
    80 	std::cout << " f7";
       
    81 	// f7 = end of SysEx message
    67 
    82 
    68 	std::cout << std::endl;
    83 	std::cout << std::endl;
    69 	return 0;
    84 	return 0;
    70 }
    85 }