danielathome19 / MIDIToComputerCraft

A conversion script for converting MIDI files to executable Lua code for ComputerCraft and the Create mod steam pipes.
Apache License 2.0
22 stars 3 forks source link

Issue with "." when time values are written in the lua program for each sub controller #1

Closed Pierremkb29 closed 2 years ago

Pierremkb29 commented 2 years ago

In the lua files created with your program, the time instructions are written using a "," instead of a "." I give you an example with chpn-p4b (your original program given with the demo) and Pirates (My program created using your code) Pirates.txt chpn-p4b.txt Thank you for your project anyway Have a good day Pierre_mkb

danielathome19 commented 2 years ago

@Pierremkb29 this might be a language issue depending on your localization; I calculate the sleep duration using the following line: if (key > timepassed) sb.Append($"sleep({key - timepassed})\n"); So the script is just calculating the difference (i.e., sleep(difference) ) as a float. Your compiler might be set to a language setting that delimits decimals using commas.