From f04580e54d83a3bb27d0327adae93bb61b43d921 Mon Sep 17 00:00:00 2001 From: drel Date: Sun, 28 Dec 2025 23:14:40 +0300 Subject: [PATCH] first commit --- LICENSE | 11 ++++++++ README.md | 19 +++++++++++++ image.png | Bin 0 -> 182 bytes image.syx | Bin 0 -> 74 bytes sc55art.py | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sc55text.py | 51 ++++++++++++++++++++++++++++++++++ test.mid | Bin 0 -> 989 bytes text.syx | Bin 0 -> 27 bytes 8 files changed, 159 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 image.png create mode 100644 image.syx create mode 100644 sc55art.py create mode 100644 sc55text.py create mode 100644 test.mid create mode 100644 text.syx diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7a3094a --- /dev/null +++ b/LICENSE @@ -0,0 +1,11 @@ +DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +Version 2, December 2004 + +Copyright (C) 2004 Sam Hocevar + +Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. + +DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/README.md b/README.md new file mode 100644 index 0000000..24173ec --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# SC-55 Tools +Simple ass tools for creating Roland SC-55 (and maybe SC-88(Pro/20)??? Don't have emulator for that.) exclusive SysEx commands for art and text. + +## Installation +It's as simple as cloning this repository or downloading the ZIP file. + +sc55text.py - should work right out of the box. + +sc55art.py - requires Pillow to be installed. (not doing requirements.txt for one fricking thing) + +## Usage +Using sc55text.py: +`python sc55text.py [your text here]` + +Using sc55art.py: +`python sc55text.py ` + +## License +Do What The Fuck You Want To Public License \ No newline at end of file diff --git a/image.png b/image.png new file mode 100644 index 0000000000000000000000000000000000000000..1b7e1f0aab08318f8e866c35b51b8fff3b21d803 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFbpFjrTy V>f~<9RR9{o;OXk;vd$@?2>|7tI") + return + + input_path = sys.argv[1] + + if not os.path.exists(input_path): + print(f"File {input_path} not found.") + return + + base_name = os.path.splitext(input_path)[0] + output_filename = f"{base_name}.syx" + + canvas = process_image_to_canvas(input_path) + create_sysex_file(output_filename, canvas) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/sc55text.py b/sc55text.py new file mode 100644 index 0000000..2013528 --- /dev/null +++ b/sc55text.py @@ -0,0 +1,51 @@ +import sys +import re + +def create_text_sysex(text): + if not text: + text = "EMPTY" + + if len(text) > 32: + print("Text cannot be longer than 32 symbols.") + sys.exit(1) + + model_id = 0x45 + address = [0x10, 0x00, 0x00] + + text_bytes = [ord(char) for char in text] + + def calc_checksum(addr, payload): + total = sum(addr) + sum(payload) + return (128 - (total % 128)) % 128 + + checksum = calc_checksum(address, text_bytes) + + full_packet = bytes([0xF0, 0x41, 0x10, model_id, 0x12] + address + text_bytes + [checksum] + [0xF7]) + + return full_packet + +def sanitize_filename(text): + name = text.replace(" ", "_") + name = re.sub(r'[\\/*?:"<>|]', "", name) + name = name.strip(". ") + return name if name else "output" + +if __name__ == "__main__": + input_text = " ".join(sys.argv[1:]) + + if not input_text: + print("Usage: python sc55text.py [text]") + sys.exit(1) + + sysex_data = create_text_sysex(input_text) + + safe_name = sanitize_filename(input_text) + filename = f"{safe_name}.syx" + + try: + with open(filename, "wb") as f: + f.write(sysex_data) + print(f"Output file: {filename}") + print("HEX:", " ".join(f"{b:02X}" for b in sysex_data)) + except Exception as e: + print(f"Error occurred while saving the file: {e}") \ No newline at end of file diff --git a/test.mid b/test.mid new file mode 100644 index 0000000000000000000000000000000000000000..e129bdde307fb7b4b85bfc36c0e51ab524e4daa2 GIT binary patch literal 989 zcma*hxk>{85C-5s$&$oh0-G3!SeUi52w2!z#Uh|Z3L&5(ir@-@3xQPW1bqe{z&FT! zAKv%zD(O$ox|cGv6@T+=&e!2p^&-W^;v8uUmv00NkxW=*oh-V;KJVFx*`~ zaB=9a;AiU+qs?_Q6El5Cn$fsdrkRL&F_TGP&WL+AA~TV21e0Ep@OyJ_{ZE2pj25Q1 zfQ@6v$)~LCe8I7othLpn#CY;fu>{ZpufdWJ4B2Fwvu8|$d&}Gh4{&b$K9`!BvX~pN ztTq)fw_rtWs$%ZIs@l}V+=Df>sf&34>uS>w^9VN7rYYtLY^qI5%rn?ho3@x2u&p*7 pF|S}pZMtIKz^>Z##Jqz&wdsrb0Q+h)5c3HR)MhB=3mpDuz5(kFzm)(0 literal 0 HcmV?d00001 diff --git a/text.syx b/text.syx new file mode 100644 index 0000000000000000000000000000000000000000..e2b63ebce8457ea91dcf42e505ce9651c774a0d5 GIT binary patch literal 27 icmez1DBvn2z`)>