κ°λ° μ€λ¨λ λ²μ μ λλ€. μ¬κΈ°λ‘ κ°μΈμ.
λ―Έλ νμΌμ μ½μ΄μ κ²μ 'Mindustry'μ λͺ¨λ μ€ νλμΈ 'Betamindy'μ λ ΈνΈλΈλμ μ°μ£Όνλ λ‘μ§ μ½λλ₯Ό μ§μ£Όλ νλ‘κ·Έλ¨μ λλ€. μ¬μ©ν λλ 'Infinite Processor' λͺ¨λλ₯Ό ν¨κ» μ¬μ©νλ κ²μ κΆμ₯ν©λλ€. λ―Όλμ€νΈλ¦¬μ νμ΄μ¬μ λν΄ μ΄λ μ λ κΈ°μ΄μ μΈ μ§μμ΄ μμΌλ©΄ μ¬μ©νλ λ° λμμ΄ λ κ²λλ€.
μ΄ νλ‘κ·Έλ¨μ μ¬μ©νλ €λ©΄ νμ΄μ¬κ³Ό mido λͺ¨λ(νμ¬ 1.2.10)μ΄ νμν©λλ€. λν, IDLEλ‘ μ€ννλ κ²μ΄ μ’μ΅λλ€.
IDLEλ‘ μ€ννλ€λ κ²μ ν μ€μ© μ€ννλ€λ κ²μ΄ μλλΌ, μ Έ μ°½μμ 'File -> Open'μΌλ‘ νμΌμ μ° λ€μ F5λ‘ νλ²μ μ€ννλ€λ μλ―Έμ λλ€. (νμ¬λ μ λ°μ΄νΈλ‘ IDLE μμ΄ κ·Έλ₯ νμ΄μ¬ νμΌμ λ°λ‘ μ€νν΄λ λ¬Έμ μμ΅λλ€.)
mido λͺ¨λμ μ€μΉνλ €λ©΄ λͺ λ Ή ν둬ννΈμ λ°μ΄ν μμ΄ 'pip install mido'λΌκ³ μ λ ₯νμΈμ. μ€μΉμ μ±κ³΅νλ©΄ νμΌ κ²½λ‘κ° λ¨λλ°, μ λλ‘ μ€μΉλλμ§ νμΈν΄ μ£ΌμΈμ.
μ΄ νλ‘κ·Έλ¨μμλ μ΄ νλ‘κ·Έλ¨κ³Ό κ°μ ν΄λμ λ€μ΄ μλ νμΌλ‘ μ½κΈ° λ° μ°κΈ°λ₯Ό ν©λλ€. λ°λΌμ λ―Έλ νμΌμ΄ μ΄ νλ‘κ·Έλ¨κ³Ό κ°μ ν΄λ μμ λ€μ΄ μμ΄μΌ ν©λλ€. λ―Έλ.txt νμΌκ³Ό λ‘μ§.txt νμΌμλ μ°κΈ°λ₯Ό ν©λλ€. μ΄λ κΈ°μ‘΄ νμΌ λ΄μ©μ μ§μμ§λ μ£ΌμνμΈμ.
κ°λμ© μΈμ½λ© μλ¬κ° λμ μ λ° λ©μμ§κ° λ° λκ° μλλ°, set_tempo / note_on / note_off μ²λΌ μμ μ 체μ μν₯μ μ€ μ μλ λΌμΈλ§ μλλ©΄ κ·Έλ₯ 무μνμ λ λ©λλ€.
λ³ν μλ£ μ μ Έ μ°½μ blocksμ linesκ° νμλλλ° blocksλ λ―Έλλ₯Ό μ¨μ ν μ°μ£Όνλ λ° νμν λ ΈνΈ λΈλ‘μ μμ΄κ³ linesλ μ°μ£Ό'μλ§' νμν μ½λ μ€ μμ λλ€. (μ€μμΉ μν κ°μ§, λ©λͺ¨λ¦¬ μ μ μΆλ ₯ λ±μ μ μΈ) 84κ°μ λ ΈνΈ λΈλ‘μ΄ κ°κ° ν κ°μ§ μλ§ μ°μ£Όνλ κ±΄λ° λͺ¨λκ° μΌμ Έ μμΌλ©΄ blocksλ 84λ‘ κ³ μ λ©λλ€.
λ³νν λ μ°μ£Ό μ½λκ° 900μ€μ΄ λμΌλ©΄ μ¬λ¬ νμ΄μ§λ‘ λλμ΄ μΆλ ₯λλλ°, ν νλ‘μΈμμ μ΅λ 999μ€κΉμ§ λ€μ΄κ° μ μκΈ° λλ¬Έμ κ·Έλ° κ²μΌλ‘ νμ΄μ§ μλ§νΌμ νλ‘μΈμλ₯Ό μ€λΉν΄μ κ° νμ΄μ§ λ΄μ© μ 체λ₯Ό 볡λΆν΄μ£Όμλ©΄ λ©λλ€.
λ ΈνΈ λΈλ‘μ μ°μ£Όνλ λͺ¨λ νλ‘μΈμλ λͺ¨λ λ ΈνΈ λΈλ‘(block1, block2...)κ³Ό 1κ°μ λ©λͺ¨λ¦¬ μ (cell1)μ μ°κ²°λμ΄ μμ΄μΌ νλ©°, νΉν 첫 λ²μ§Έμ λ§μ§λ§ νλ‘μΈμλ 1κ°μ μ€μμΉ(switch1)μλ μ°κ²°λμ΄ μμ΄μΌ ν©λλ€. μ°κ²°λ λ©λͺ¨λ¦¬ μ μ 0λ² μΉΈμ 0~9μ μ«μλ₯Ό μ λ ₯νλ©΄ μ°μ£Όν μ κΈ°λ₯Ό κ²°μ ν μ μκ³ , 1λ² μΉΈμ μ°μ£Όν ννΈλ₯Ό κ²°μ νκΈ° λλ¬Έμ ν¨λΆλ‘ μμ νλ€κ° κ³‘μ΄ λ€μ£½λ°μ£½μ΄ λ μλ μμ΅λλ€.
κ·ΈλΌ κ±΄λ° λͺ¨λλ 88κ°μ λΈλ‘μ μ°κ²°ν΄μΌ νλ κ² μλλκ³ μ? κ·Έλ μ΅λλ€! λ무 νλ μΌ μλλκ³ μ? κ·Έλμ κ±΄λ° λͺ¨λ μ μ© λ§΅λ μ€λΉνμ΅λλ€. piano.msavλ₯Ό νμΈν΄ 보μΈμ!
μ΄λ° κΈμ μ¨λ³Έ μ μ΄ λ³λ‘ μμ΄μ λ§μ΄ λμ‘ν΄λ μν΄ λΆνλλ €μ.
λΉλ‘ λμ€μ λ μ’μ νλ‘κ·Έλ¨μ΄ λμ¨λ€κ³ ν΄λ, μ κ° μ΄λ° κ²μ μλνλ€λ κ²μ κΈ°μ΅ν΄ μ£ΌμΈμ...
(Translator is used)
This is a program that reads a midi file and creates a logic code to play the note block of 'Betamindy,' one of the mods of the game 'Mindustry.' Recommend 'Infinite Processor' mod when using. If you have some basic knowledge of Mindustry and Python, it will help you use it.
Python and mido module(currently 1.2.10) are required to use this program. Also, it is recommended to run with IDLE. Running with IDLE does not mean running one line at a time, but opens the file with 'File -> Open' in the shell window and then runs it at once with F5. To install the mido module, type 'pip install mido' without quotes at the command prompt.
This program reads and writes to files in the same folder as this program. The corresponding file is as follows. Just in case, please check to prevent accidents in which existing files are deleted: λ―Έλ.txt(read/write), λ‘μ§.txt(write only), (midi name).mid(receives input in program, read only)
Sometimes it can't read the midi file automatically(i think there is an encoding error). In that case, copy the part that says Squeezed text and paste it to λ―Έλ.txt(in the same folder as the program) and save. If you try to force the process without pasting it, an error occurs because the file is empty.
When the conversion is completed, blocks and lines are displayed in the shell window. 'blocks' is the number of note blocks required to fully play the midi. 'lines' is the number of code lines required only for 'play'(except switch state detection, memory cell input/output, etc.). If keyboard mode, in which 84 note blocks each play only one note, is turned on, the blocks are fixed at 84.
When converting, if the playing code exceeds 900 lines, it is divided into several pages and output. Because it can fit up to 999 lines in one processor. You need to prepare as many processors as the number of pages and copy and paste the entire contents of each page.
All processors playing the note block must be connected to all note blocks(block1, block2...) and a memory cell (cell1). In particular, the first and last processors must also be connected to the switch(switch1). The 0th column of the memory cell determines the instrument to play(available from 0 to 9), and the 1st column determines the part to play(starting from 0, automatically managed).
It's my first time using Github, so I ask for your understanding even if it's very chaotic.
Even if a better program comes out later, please remember that I tried this...
