.Assembly Window Assembly 1
.Assembly variables piano keys, graphic buttons,, "0"
.Assembly variable black key, integer type,, "0"
.Assembly variable white key, integer type,, "0"
.Assembly variable last key, graphic button
.Assembly variable last key black and white, logic type
.Assembly variables old notes, byte type
.Assembly variable volume knob drag, logic type
.Assembly variable volume knob position, integer type
.Assembly variable score group, text type,, "0"
.Assembly variable Music score position, integer type
.Assembly variable recording status, logic type
.Assembly variable recording length, text type,, "255"
.Assembly variable recording text, text type
.Assembly variable stop, logic type
.Assembly variables set instruments, logic type
.Assembly variable, sound wave value, integer type,,, for analog sound wave
.Assembly variable Sound wave value history group, integer type,, "0", used for analog sound wave
.Assembly variable big key code, integer type,, "0"
.Assembly variable phoneme, integer type,, "0"
.Assembly variables Repeated keystrokes, logic type
.Assembly variable white key code, integer type,, "0"
.Assembly variable Normal tone, text type
.Assembly variables higher, text type
.Assembly variable high two points, text type
.Assembly variables lower, text type
.Assembly variable low two points, text type
.Assembly variables press key, integer type,, "0"
.Assembly variables exist, logical type
.Assembly variable key group, integer type,, "0"
.Assembly variable mark group, logical type,, "0"
.Assembly variable Current playing, integer type
.Assembly variables have been executed, logic type
.Assembly variable playing code, integer type
.Assembly variable format, integer
.Assembly variable End of line, logical type
.Assembly variable file number, integer
.Assembly variable Temporary score, text type
.Assembly variable system play, logic type
.Assembly variables are paused, logic type
.Subroutine __start window_created
.Local variable Black key position, integer type,, "0"
.Local variable black key mark, integer type,, "0"
.Local variable left channel, integer type
.Local variable right channel, integer type
.Local variables, marked difference, integer type
.Local Variables Tagged Value, Integer Type
.Local Variable Variable, Integer Type
Load (splash screen,, false)
Set the shape picture (#底图资源, #黑)
'//Initialization
White key code = {36, 38, 40, 41, 43, 45, 47, 48, 50, 52, 53, 55, 57, 59, 60, 62, 64, 65, 67, 69, 71, 72, 74 , 76, 77, 79, 81, 83, 84, 86, 88, 89, 91, 93, 95}
Big key code = {90, 88, 67, 86, 66, 78, 77, 65, 83, 68, 70, 71, 72, 74, 81, 87, 69, 82, 84, 89, 85, 49, 50 , 51, 52, 53, 54, 55, 56, 57, 48, 189, 187, 220, 8, 46, 35, 34, 45, 36, 33, 8, 73, 79, 80, 219, 221, 188 , 190, 191, 75, 76, 186, 222}
Phoneme = {36, 38, 40, 41, 43, 45, 47, 48, 50, 52, 53, 55, 57, 59, 60, 62, 64, 65, 67, 69, 71, 72, 74, 76, 77, 79, 81, 83, 84, 86, 88, 89, 91, 93, 95, 84, 86, 88, 89, 91, 93, 95, 72, 74, 76, 77, 79, 48, 50, 52, 60, 62, 64, 65}
Redefine the array (press key, false, take the number of array members (large key code))
Key group = big key code
Redefine the array (mark group, false, take the number of array members (large key code))
.Counting cycle first (take the number of array members (tag group), variable)
Tag group [variable] = false
.Counting cycle end ()
Old note = -1
Format = 2
Start phoneme = 0
Effect 1. Selected = true
.Counting cycle first (MIDI1. Take the number of devices (), variable)
Device name combo box. Add item (MIDI1. Take device name (variable-1),)
.Counting cycle end ()
MIDI1. Open (0)
Device name combo box. Currently selected item = 0
.Counting cycle first (MIDI1. Take the number of instruments (), variable)
Instrument name combo box. Add item (MIDI1. Take instrument name (variable), variable)
.Counting cycle end ()
Instrument name combo box. Currently selected item = 4
MIDI1. Set the instrument (4,)
'//Take the volume:
.If (system volume 1. turn on (#volume type. master volume) = 0)
Message box ("System volume failed to open!, you may not hear the sound!", 48,)
.otherwise
System volume 1. Take the volume (left channel, right channel)
Master volume button. Top edge = 116-rounded (rounded up ((left channel + right channel) ÷ 2 ÷ 1489.43), 0)
If it ends
System volume 1. Off (2)
.If (system volume 1. open (#volume type. software synthesizer) = 0)
Message box ("Software synthesizer failed to open!, you may not hear the sound!", 48,)
.otherwise
System volume 1. Take volume (left channel, right channel)
Software synthesizer button. Top edge = 116-rounded (rounded up ((left channel + right channel) ÷ 2 ÷ 1349.81), 0)
If it ends
System volume 1. Off (2)
'//The key code is generated below:
Redefine the array (key, false, 71)
.Counting cycle first (71, variable)
If true (variable ≠ 6 and variable ≠ 14 and variable ≠ 20 and variable ≠ 28 and variable ≠ 34 and variable ≠ 42 and variable ≠ 48 and variable ≠ 56 and variable ≠ 62 and variable ≠ 70 and variable ≠ 76 and variable ≠ 84)
Mark difference = Mark difference + 1
Copy widget (key1, key [variable])
Marked value = 35 + mark difference
.Judgment start (variable% 2 = 0)
Key [variable]. Width = 12
Key [variable]. Width = 70
Key [variable]. Top side = 0
Key [variable]. Normal picture = Piano key 2. Normal picture
Key [variable]. Press the picture = Piano 2. Press the picture
Key [variable]. Transparent color = #white
Key [variable]. Adjust level (#Top level)
Key [variable]. visible = true
Key [variable]. Mark = to text (mark value)
Join members (black key, marked value)
Key [Variable]. Left = Key 2. Left + Key 1. Width × (Absolute rounding (variable ÷ 2) - 1)
.default
Key [variable]. visible = true
Key [variable]. Mark = to text (mark value)
Key [Variable]. Left = Key 1. Left + Key 1. Width × Absolute rounding (variable ÷ 2)
Join members (white key, mark value)
.The end of judgment
.If it really ends
.Counting cycle end ()
.Subroutine button sound
.Parameters note, byte type
MIDI1. Play (starting pitch + note,)
Old note = start phoneme + note
.Subroutine _Key1_The left mouse button is pressed, logic type
.Parameters horizontal position, integer type
.Parameters longitudinal position, integer type
.Parameter Function key status, integer
.Local variable Current key, graphic button
Current key = take event component ()
.If true (MIDI1. Open () = false)
MIDI1. Open (0)
MIDI1. Set the instrument (instrument name combo box. The currently selected item,)
.If it really ends
.If true (whether it has been created (current key))
Button sound (to value (current key.mark))
.If it really ends
.If true (recording status = true)
Clock 3. Clock period = 100
Recording text = recording text + to text (to value (current key. mark)) + "@"
.If it really ends
Current play = to value (current key. mark)
.Subroutine stop
.Parameter v, integer, nullable
.If (is it empty (v))
MIDI1. Stop (old note,)
.otherwise
MIDI1. Stop (old note, v)
If it ends
.Subroutine _Key1_Left mouse button is released, logic type
.Parameters horizontal position, integer
.Parameters longitudinal position, integer type
.Parameter Function key status, integer type
Stop play ()
Clock 3. Clock period = 0
.If true (recording status = true and exists = true)
.If true (playing code ≤ 0)
Return ()
.If it really ends
.Judgment start (to value (recording tone length [playing code]) ≤ 2)
Recording Tone Length [Playing Code] = "8"
.Judgment (to the value (recording tone length [playing code]) = 3)
Recording length [playing code] = "4."
.Judgment (to the value (recording tone length [playing code]) = 4)
Recording Tone Length [Playing Code] = "4"
.Judgment (to the value (recording pitch [playing code]) > 4 and to the value (recording pitch [playing code]) ≤ 6)
Recording Tone Length [Playing Code] = "2."
.Judgment (to the value (recording tone length [playing code]) > 6 and to the value (recording tone length [playing code]) ≤ 8)
Recording Tone Length [Playing Code] = "2"
.Judgment (to the value (recording tone length [playing code]) > 10 and to the value (recording tone length [playing code]) ≤ 12)
Recording Tone Length [Playing Code] = "1"
.default
Recording length [playing code] = "1."
.The end of judgment
Recording text = recording text + recording tone length [playing code] + ""
.If it really ends
_Start window. Flag = "2"
Set instrument = false
Common dialog 1. Type = 0
.If true (common dialog 1. open ())
Recording text = ""
.If it really ends
.Judgment start (take the extension (common dialog 1. file name) = "MIDI" or take the extension (common dialog 1. file name) = "MID")
Format = 1
.default
Format = 2
.The end of judgment
.Subroutine _play_clicked
.Local variable file score, text type,, "0"
_Start window. Get focus ()
.If true (whether to pause)
Media playback 1. Play (-1)
Clock 5. Clock period = 50
Return ()
.If it really ends
.Judgment to start (Play. Select = True)
Normal tone = ""
Higher = ""
High two point = ""
Two points lower = ""
Lower = ""
.Judgment start (format = 0)
.If true (recorded text ≠ “”)
.If true (MIDI1. Open () = false)
MIDI1. Open (0)
.If it really ends
Play file (recorded text + "p@2")
.If it really ends
.Judgment (format = 1)
End of line = true
.Judgment start (number of tracks (common dialog 1. file name) = 1)
.If true (MIDI1. Open () = false)
MIDI1. Open (0)
.If it really ends
.If true (repair file (common dialog box 1. file name))
Conversion format emid (common dialog box 1. file name)
Play file (temporary score)
Return ()
.If it really ends
.default
.If true (message box ("This MIDI music does not currently support analog key effects, are you sure to continue playing?", 64 + 1,) = #Confirm button)
MIDI1.Close ()
Media player 1. Open (Common dialog 1. File name)
Media playback 1. Play (-1)
System play = true
Clock 1. Clock period = 350
Clock 5. Clock period = 50
.If it really ends
.The end of judgment
.Judgment (format = 2)
.Judgment start (Common dialog box 1. File name ≠ "")
.If true (MIDI1. Open () = false)
MIDI1. Open (0)
.If it really ends
File score = Split text (to text (import file (common dialog box 1. file name)), # line break,)
.If true (file sheet music [1] ≠ "emid")
Message box ("Not easy language MIDI music text file!", 16,)
Play. Selected = False
Return ()
.If it really ends
MIDI1. Set the instrument (to value (file score [2]),)
Play file (file score [3])
.default
Message box ("There is no track to play!", 48,)
Play. Selected = False
Return ()
.The end of judgment
.default
.The end of judgment
Sound wave. Selected = true
.default
Continuous assignment (0, clock 1. clock period, clock 2. clock period, clock 4. clock period)
.If (system play)
Media playback 1. Pause ()
Play. Selected = False
System play = false
Whether to pause = true
Clock 5. Clock period = 0
.otherwise
Simulate pressing a key (old note-start pitch, true)
Stop play ()
If it ends
.The end of judgment
.Subroutine conversion format emid
.Parameter File name, text type
.Local Variables Variables
.Local Variable Temporary, Byte Set
Close file (file number)
File number = open file (file name, #read in,)
Move to the beginning of the file (file number)
Temporary score = ""
Move the reading and writing position (file number,, 24)
.Judging the beginning of the loop (whether it is at the end of the file (file number,) = false)
Temporary = read in byte set (file number, 6)
.Judgment start (take byte set length (temporary) <6)
Temporary score = Temporary score + "p@2"
.default
.Judgment start (temporary [3] = 3)
Temporary score = Temporary score + to text (temporary [1]) + "@" + to text (32) + ""
.Judgment (temporary [3] = 6)
Temporary score = Temporary score + to text (temporary [1]) + "@" + to text (16) + ""
.Judgment (temporary [3] = 12)
Temporary score = Temporary score + to text (temporary [1]) + "@" + to text (8) + ""
.Judgment (temporary [3] = 18)
Temporary score = Temporary score + to text (temporary [1]) + "@" + to text (8) + ". "
.Judgment (temporary [3] = 24)
Temporary score = Temporary score + to text (temporary [1]) + "@" + to text (4) + ""
.Judgment (temporary [3] = 36)
Temporary score = Temporary score + to text (temporary [1]) + "@" + to text (4) + ". "
.Judgment (temporary [3] = 48)
Temporary score = Temporary score + to text (temporary [1]) + "@" + to text (2) + ""
.Judgment (temporary [3] = 64)
Temporary score = Temporary score + to text (temporary [1]) + "@" + to text (2) + ". "
.Judgment (temporary [3] = 72)
Temporary score = Temporary score + to text (temporary [1]) + "@" + to text (1) + ""
.Judgment (temporary [3] = 96)
Temporary score = Temporary score + to text (temporary [1]) + "@" + to text (1) + ". "
.default
Temporary score = Temporary score + to text (temporary [1]) + "@" + to text (4) + ""
.The end of judgment
.The end of judgment
.Determine the end of the loop ()
Write to file (file name + ".txt", to byte set ("emid" + #newline character + to text (MIDI1. Take the instrument number ())) + #newline character + delete tail empty (temporary score)))
'//Upstream code is to save MIDI music as easy language files.
Close file (file number)
.Subroutine repair file, logical type
.Parameter File name, text type
.Local variable temporary 1, byte set,, "8"
.Local Variable Temporary 2, Byte Set
.Local variable Number of tracks, integer type
.Local variable size, integer type
.Local Variable Variable, Integer Type
.Local Variable File No. 1, Integer Type
.Judgment start (number of tracks (file name) = 1)
Close file (file number)
File number = open file (file name, #read in,)
File number 1 = open file (file name + ".bak", #rewrite,)
Move to the beginning of the file (file number)
Temporary 1 [1] = read byte set (file number, 8)
Temporary 1 [2] = read byte set (file number, 2)
Temporary 1 [3] = read byte set (file number, 2)
Temporary 1 [4] = read byte set (file number, 2)
Temporary 1 [5] = read byte set (file number, 4)
Temporary 2 = read byte set (file number, 4)
Temporary 1 [6] = read byte set (file number, 2)
Size = Temporary 2 [1] × 255 × 255 × 255 + Temporary 2 [2] × 255 × 255 + Temporary 2 [3] × 255 + Temporary 2 [4]
'Move to the beginning of the file (file number)
Write out byte set (file number 1, take blank byte set (24))
.Judging the beginning of the loop (whether at the end of the file (file number,) = false)
Temporary 2 = read byte set (file number, 1)
.Judgment start (temporary 2 [1] = 129 or temporary 2 [1] = 130 or temporary 2 [1] = 131)
Size = size-1
.default
Move to the end of the file (file number 1)
Write out byte set (file number 1, temporary 2)
.The end of judgment
.Determine the end of the loop ()
Move to the beginning of the file (file number 1)
.Counting cycle first (5, variable)
Write out the byte set (file number 1, temporary 1 [variable])
.Counting cycle end ()
Temporary 2 = to byte set (size)
.Counting cycle first (4, variable)
.Judgment start (temporary 2 [4-variable + 1] = 0)
Write out byte set (file number 1, {0 })
.default
Write out byte set (file number 1, to byte set (character (temporary 2 [4-variable + 1])))
.The end of judgment
.Counting cycle end ()
Write out the byte set (file number 1, temporary 1 [6])
Close file (file number 1)
Close file (file number)
.Judgment start (delete file (file name))
.Judgment start (file rename (file name + ".bak", file name))
Return (true)
.default
Return (false)
.The end of judgment
.default
Return (false)
.The end of judgment
'Message box ("repair completed", 0,)
.default
Return (true)
.The end of judgment
.Subroutine Number of tracks, integer
.Parameter File name, text type
.Local Variable Temporary, Byte Set
.Local variable Number of tracks, integer type
Close file (file number)
File number = open file (file name, #read in,)
Move to the beginning of the file (file number)
Move the reading and writing position (file number,, 10)
Temporary = read byte set (file number, 2)
Number of tracks = Temporary [1] × 255 + Temporary [2]
Return (number of tracks)
.Subroutine _clock 2_period event
.Local variable Current sound, text type,, "0"
.Local variables, musical notes, graphic buttons
.Local Variable Variable, Integer Type
.Local variable identification, integer type
.If true (music score position ≠ 0)
Stop (old note)
.If it really ends
.If true (musical score position = take the number of array members (music score group))
Clock 1. Clock period = 0
Clock 2. Clock period = 0
Clock 4. Clock period = 0
Sonic drawing board. Visible = false
Score position = 0
'Simulate pressing a key (old note, true)
Old note = 0
Play. Selected = False
Recording. Prohibited = False
Return ()
.If it really ends
Music score position = music score position +1
.If true (musical score group [musical score position] ≠ "|" and score group [musical score position] ≠ “||”)
Current note = Split text (Music score group [Music score position], “@”,)
.If (current tone [1] = "p")
Clock 2. Clock period = 960 \ to value (current tone [2])
.otherwise
.If true (take the number of array members (current tone) = 2)
MIDI1. Play (to value (current note [1]),)
Simulate pressing a key (to value (current note [1]))
Sound wave value = to value (current tone [1])
Old note = to value (current note [1])
.If (take the right side of the text (current tone [2], 1) = ".")
Clock 2. Clock period = 960 \ to value (current tone [2]) + 960 \ to value (current tone [2]) ÷ 2
.otherwise
Clock 2. Clock period = 960 \ to value (current tone [2])
If it ends
.Counting cycle first (take the number of array members (white key code), variable)
.If true (white key code [variable] = to value (current tone [1]))
Out of loop ()
.If it really ends
.Counting cycle end ()
Logo =1
.Judgment start (take the text length (normal tone) <22)
.Judgment start (variable% 7 = 0)
.Judgment start (round (variable ÷ 7) ≠ 0)
.Judgment start (variable% 7 = 0)
Normal tone = normal tone + "7"
.default
Normal tone = normal tone + "" + to text (variable% 7)
.The end of judgment
.Judgment (variable% 7 = 0)
Normal tone = normal tone + "0"
Logo = 0
.default
Normal tone = normal tone + "" + to text (variable% 7)
.The end of judgment
.default
Normal tone = normal tone + "" + to text (variable% 7)
.The end of judgment
.Judgment (variable% 7 = 0)
.Judgment start (round (variable ÷ 7) ≠ 0)
.Judgment start (variable% 7 = 0)
Normal tone = "7"
.default
Normal tone = "" + to text (variable% 7)
.The end of judgment
.Judgment (variable% 7 = 0)
Normal tone = "0"
Logo = 0
.default
Normal tone = "" + to text (variable% 7)
.The end of judgment
.default
Normal tone = "" + to text (variable% 7)
.The end of judgment
Music score. Title = normal tone
Low 1. Title = ""
Low 2. Title = ""
High 2. Title = ""
High 1. Title = ""
.Judgment start (take the text length (normal tone) < 22)
.Judgment start (to value (current tone [1]) ≤ 47)
.Judgment Start (Identification = 0)
Low two points = low two points + "" + ""
A little lower = a little lower + "" + ""
.default
Low two points = low two points + "" + "."
A little lower = a little lower + "" + "."
.The end of judgment
Higher = Higher + ""
High two point = high two point + ""
.Judgment (to the value (current tone [1]) > 47 and to the value (current tone [1]) ≤ 59)
.Judgment Start (Identification = 0)
A little bit lower = a little bit lower + "" + ""
.default
A little lower = a little lower + "" + "."
.The end of judgment
Low two points = low two points + ""
Higher = Higher + ""
High two point = high two point + ""
.Judgment (to the value (current tone [1]) > 59 and to the value (current tone [1]) ≤ 71)
Low two points = low two points + ""
A little lower = a little lower + ""
Higher = Higher + ""
High two point = high two point + ""
.Judgment (to the value (current tone [1]) > 71 and to the value (current tone [1]) ≤ 83)
Low two points = low two points + ""
A little lower = a little lower + ""
.Judgment Start (Identification = 0)
A little higher = a little higher + "" + ""
.default
A little higher = a little higher + "" + "."
.The end of judgment
High two point = high two point + ""
.Judgment (to the value (current tone [1]) > 83 and to the value (current tone [1]) ≤ 95)
Low two points = low two points + ""
A little bit lower = a little bit lower + ""
.Judgment Start (Identification = 0)
High two points = high two points + "" + ""
A little higher = a little higher + "" + ""
.default
High two points = high two points + "" + "."
A little higher = a little higher + "" + "."
.The end of judgment
.default
Low two points = low two points + ""
A little bit lower = a little bit lower + ""
Higher = Higher + ""
High two point = high two point + ""
.The end of judgment
.default
Higher = ""
Lower = ""
Senior two points = ""
Two points lower = ""
.The end of judgment
1. Title = lower
Low 2. Title = Low two points
High 2. Title = High two points
1. Title = higher
.If it really ends
If it ends
.If it really ends
.Subroutine Simulate pressing the keys
.Parameters note, byte type
.Parameter end, logical, nullable
.Local variables Current key, graphic button
.Local variable Current key black and white, logic type
.Local Variable Variable, Integer Type
.Counting cycle first (take the number of array members (black key), variable)
.If true (black key [variable] = note)
Current key black and white = true
Out of loop ()
.If it really ends
.Counting cycle end ()
.If true (whether created (last key))
Last key. Normal picture = select (last key black and white, #黑normal, #白normal)
.If it really ends
.If true (stop)
Return ()
.If it really ends
.If true (note ≠ 255 and note ≠ 0)
Current key = take mark component (note)
.If it really ends
.If true (end = true)
Return ()
.If it really ends
.If true (whether it has been created (current key))
Current key. Normal picture =Select (current key black and white, #black press, #white press)
.If it really ends
Last key = current key
Last key black and white = current key black and white
.Subroutine Play file
.Parameter content, text type
Music score group = split text (content, "",)
Clock 2. Clock period = 50
Clock 1. Clock period = 350
Clock 4. Clock period = 150
Sonic drawing board. Visual = true
.Subroutine _Recording_ Clicked
.Judgment Start (Recording. Selected = True)
Redefine the array (recording sound length, false, 255)
Recording text = ""
Clock 3. Clock period = 100
_Start window. Get focus ()
Recording status = true
Format = 0
Play. Prohibit = Invert (Play. Prohibit)
.default
Clock 3. Clock period = 0
.If true (currently playing =0)
Return ()
.If it really ends
.Judgment start (to the value (recording length [current playing]) ≤ 2)
Recording length [current playing] = "8"
.Judgment (to the value (recorded tone length [current playing]) = 3)
Recording length [current playing] = "4."
.Judgment (to the value (recording tone length [current playing]) = 4)
Recording Tone Length [Current Playing] = "4"
.Judgment (to the value (recorded pitch [current playing]) > 4 and to the value (recorded pitch [current playing]) ≤ 6)
Recording length [current playing] = "2."
.Judgment (to the value (recording sound length [current playing])> 6 and to the value (recording sound length [current playing]) ≤ 8)
Recording length [current playing] = "2"
.Judgment (to the value (recording sound length [current playing]) > 10 and to the value (recording sound length [current playing]) ≤ 12)
Recording length [current playing] = "1"
.default
Recording Tone Length [Currently Playing] = "1."
.The end of judgment
Recording text = recording text + recording tone length [current playing] + “”
Recording Tone Length [Current Playing] =""
Recording status = false
Recording status = inverted (inverted (recording. selected))
Play. Prohibit = Invert (Play. Prohibit)
.The end of judgment
.Subroutine _clock 3_period event
.If true (current play > 0)
Recording tone length [current playing] = to text (to value (recording tone length [current playing]) + 1)
.If it really ends
.Subroutine _graphic button 3_ clicked
Load (setting window,, true)
.Subroutine _stop playing_clicked
.If true (recording.prohibited = true)
Recording. Prohibited = False
.If it really ends
MIDI1.Close ()
Continuous assignment (false, play. selected, record. selected, sound wave drawing board. visible)
Continuous assignment (0, clock 1. clock period, clock 2. clock period, clock 2. clock period, clock 4. clock period)
.If (system play)
Media playback 1. Stop ()
System play = false
.otherwise
Simulate pressing a key (old note, true)
If it ends
MIDI1. Open (0)
MIDI1. Set the instrument (instrument name combo box. Currently selected item)
Score position = 0
_Start window. Get focus ()
.Subroutine _save_ clicked
.Local variable Instrument name, byte type
'Easy keyboard format description:
'emid ------------------- is an easy electronic keyboard file mark;
'4 ---------------------- is the instrument number, corresponding to the value of each instrument;
'48@4 71@4 69@4....p@2 --- sheet music group, its arrangement is: sheet music value @音长, separated by a space, ending with p@2.
.If true (recording text = "")
Return ()
.If it really ends
Common dialog 1. Type =1
.If true (common dialog 1. open ())
Instrument name = MIDI1. Take the instrument number ()
.Judgment start (take the extension (common dialog 1. file name) = "MIDI" or take the extension (common dialog 1. file name) = "MID")
Output midi (recording text + "p@2", common dialog 1. File name)
.default
Write to file (Common dialog 1. File name, to byte set ("emid" + #newline character + to text (instrument name) + #newline character + trailing blank (recording text)))
.The end of judgment
Message box ("Save file successfully", #Info icon,)
.If it really ends
.Subroutine output midi, logic type
.Parameter Sound source, text type
.Parameter File name, text type
.Local variable text group, text type,, "0"
.Local Variables Counting Variables, Integer Type
.Local variable current tone, text type,, "0"
.Local Variable File No. 1, Integer Type
.Local variable length, integer type
.Local Variable Variable, Integer Type
.Local Variable Temporary, Byte Set
.Local variable current value, integer type
File number 1 = open file (file name, #rewrite,)
Text group = split text (audio source, "",)
.Counting cycle first (take the number of array members (text group), counting variable)
Current tone = split text (text group [counting variable], “@”,)
.If true (current tone [1] ≠ “p”)
.If true (take the number of array members (current tone) = 2)
Variable = variable + 1
.If it really ends
.If it really ends
Handle event ()
.Counting cycle end ()
Length = variable × 6 + 5
Write out the byte set (file number 1, {77, 84, 104, 100, 0, 0, 0, 6, 0, 1, 0, 1, 0, 48, 77, 84, 114, 107 })
Temporary = to byte set (length)
.Counting cycle first (4, variable)
.Judgment start (temporary [4-variable + 1] = 0)
Write out byte set (file number 1, {0 })
.default
Write out byte set (file number 1, to byte set (character (temporary [4-variable + 1])))
.The end of judgment
.Counting cycle end ()
Write out the byte set (file number 1, {0, 144 })
.Counting cycle first (take the number of array members (text group), counting variable)
Current tone = split text (text group [counting variable], “@”,)
.If true (take the number of array members (current tone) = 2 and current tone [1] ≠ "p")
Write out byte set (file number 1, to byte set (character (to value (current sound [1]))))
.Judgment start (current tone [2] = "1.")
Current value = 96
.Judgment (current tone [2] = "1")
Current value = 72
.Judgment (current tone [2] = "2.")
Current value = 64
.Judgment (current tone [2] = "2")
Current value = 48
.Judgment (current tone [2] = "4.")
Current value = 36
.Judgment (current tone [2] = "4")
Current value = 24
.Judgment (current tone [2] = "8.")
Current value = 18
.Judgment (current tone [2] = "8")
Current value = 12
.Judgment (current tone [2] = "16")
Current value = 6
.Judgment (current tone [2] = "32")
Current value = 3
.default
.The end of judgment
Write out byte set (file number 1, {64 })
Write out byte set (file number 1, to byte set (character (current value)))
Write out byte set (file number 1, to byte set (character (to value (current sound [1]))))
Write out the byte set (file number 1, {0, 0 })
.If it really ends
Handle event ()
.Counting cycle end ()
Write out the byte set (file number 1, {255, 47, 0 })
Close file (file number 1)
Return (true)
.Subroutine extension, text type
.Parameter file, text type
Back (to uppercase (take the right side of the text (file, take the length of the text (file)-find the text backwards (file, ".",, false))))
.Subroutine _About_ was clicked
Load (about window,, true)
.Subroutine _Graphic button 4_ is clicked
Load (setting window,, true)
.Subroutine _Master Volume Button_The left mouse button is pressed, logic type
.Parameters horizontal position, integer
.Parameters longitudinal position, integer
.Parameter Function key status, integer
Volume knob position = vertical position
Volume button drag = true
Capture the mouse (master volume button. take window handle ())
.Subroutine _Master volume button_The left mouse button is released, logic type
.Parameters horizontal position, integer type
.Parameters longitudinal position, integer type
.Parameter Function key status, integer type
Volume button drag = false
Release the mouse ()
.Subroutine _Master Volume Button_Mouse position is moved, logic type
.Parameters horizontal position, integer type
.Parameters longitudinal position, integer type
.Parameter Function key status, integer
.If true (volume button drag)
.If true (vertical position ≥ master volume button. height and vertical position ≤ 65535)
Return ()
.If it really ends
.Judgment start (vertical position <volume button position and master volume button. top edge> 72)