3096 / genshin_scripts Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
I was trying to make my own midi files to play in the program, but I ran into a weird bug.
This is lyre.zip, which contains two files: test.mid and doesnt_work.mid. The first was exported from Musescore 3 and the second was made in MidiEditor. They play the exact same notes and are superficially identical if you listen to them, but one of them triggers the error and one of them doesn't.
Here's the output in notepad. There's some note doubling evident here.
test.mid: hqwjeqrwte
doesn't_work.mid: hqhqjwjwqeqewrwretet
(I probably should have picked a test piece without chords, but it's too late now.)
I tried mucking around in the midi files with a binary editor to try and figure it out, but looking at binary code makes my head hurt. It might have something to do with the types of midi files (there's 3), but I wasn't able to find out a way to identify which type it was.
Honestly, I don't expect this to be fixed or anything, but I just found it interesting and thought I would at least make you aware of it.
Anyways, thank you for this beautiful program. You are truly blessed by Venti himself.
Traceback (most recent call last):
File "midi.py", line 263, in
File "midi.py", line 101, in init
File "midi.py", line 108, in load_config
FileNotFoundError: [Errno 2] No such file or directory: 'midi_config.json'
press any key to exit...
all the files are in the same folder and were working literally an hour ago. restarting doesn't work, nor does reinstalling. after doing that it just says 'auto root found root at _' when trying to play a song.
i use pyinstaller made it into exe
but it crash
how do i t do on .spec?
Hello,I ran into this error when I press tab 1 in game,and I've tried out on both my two laptops but both the same error reported,it would be nice if you can help me out the problem
PS C:\Windows\system32> cd C:\Users\MECHREVO\Desktop\genshin_scripts-main
PS C:\Users\MECHREVO\Desktop\genshin_scripts-main> pip install pynput mido
Collecting pynput
Downloading pynput-1.7.3-py2.py3-none-any.whl (99 kB)
|████████████████████████████████| 99 kB 223 kB/s
Collecting mido
Downloading mido-1.2.9-py2.py3-none-any.whl (52 kB)
|████████████████████████████████| 52 kB 990 kB/s
Collecting six
Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: six, pynput, mido
Successfully installed mido-1.2.9 pynput-1.7.3 six-1.15.0
WARNING: You are using pip version 20.2.3; however, version 21.0.1 is available.
You should consider upgrading via the 'C:\Users\MECHREVO\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.
PS C:\Users\MECHREVO\Desktop\genshin_scripts-main> python midi.py
Lyre Midi Player
Copyright (C) 2021 3096
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>.
1 - everglow.mid
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
loaded 1 songs from config!
loading everglow.mid
auto root found root at 40 with 2064/2122 (0.9726672950047125)
start playing
Task exception was never retrieved
future: <Task finished name='Task-1' coro=<LyrePlayer.play() done, defined at C:\Users\MECHREVO\Desktop\genshin_scripts-main\midi.py:167> exception=TypeError("init() got an unexpected keyword argument 'type'")>
Traceback (most recent call last):
File "C:\Users\MECHREVO\Desktop\genshin_scripts-main\midi.py", line 192, in play
for msg in mid:
File "C:\Users\MECHREVO\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\mido\midifiles\midifiles.py", line 376, in iter
for msg in merge_tracks(self.tracks):
File "C:\Users\MECHREVO\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\mido\midifiles\tracks.py", line 104, in merge_tracks
messages.extend(_to_abstime(track))
File "C:\Users\MECHREVO\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\mido\midifiles\tracks.py", line 62, in _to_abstime
yield msg.copy(time=now)
File "C:\Users\MECHREVO\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\mido\midifiles\meta.py", line 507, in copy
return self.class(**attrs)
TypeError: init() got an unexpected keyword argument 'type'
Hello, it would be nice if you could help me out, im a total noob when to this things.
I used PowerShell, it all started, but when in game, trying to use Tab 1 gave me that...
PS C:\WINDOWS\system32> cd F:\Programme\lyer_genshin\genshin_scripts-main
PS F:\Programme\lyer_genshin\genshin_scripts-main> python midi.py
Lyre Midi Player
Copyright (C) 2021 3096
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>.
1 - test.mid
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
file not found: put the path to your midi file here
loaded 1 songs from config!
loading test.mid
Task exception was never retrieved
future: <Task finished name='Task-1' coro=<LyrePlayer.play() done, defined at F:\Programme\lyer_genshin\genshin_scripts-main\midi.py:167> exception=ZeroDivisionError('division by zero')>
Traceback (most recent call last):
File "F:\Programme\lyer_genshin\genshin_scripts-main\midi.py", line 174, in play
note_key_map = self.auto_root_key_map(mid, song_config.auto_root_channels, song_config.auto_root_tracks,
File "F:\Programme\lyer_genshin\genshin_scripts-main\midi.py", line 164, in auto_root_key_map
print(f"auto root found root at {best_root} with {best_hits}/{total} ({best_hits / total})")
ZeroDivisionError: division by zero
loading test.mid
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LyrePlayer.play() done, defined at F:\Programme\lyer_genshin\genshin_scripts-main\midi.py:167> exception=ZeroDivisionError('division by zero')>
Traceback (most recent call last):
File "F:\Programme\lyer_genshin\genshin_scripts-main\midi.py", line 174, in play
note_key_map = self.auto_root_key_map(mid, song_config.auto_root_channels, song_config.auto_root_tracks,
File "F:\Programme\lyer_genshin\genshin_scripts-main\midi.py", line 164, in auto_root_key_map
print(f"auto root found root at {best_root} with {best_hits}/{total} ({best_hits / total})")
ZeroDivisionError: division by zero
Task exception was never retrieved
future: <Task finished name='Task-1' coro=<LyrePlayer.play() done, defined at midi.py:169> exception=OSError('MThd not found. Probably not a MIDI file')>
Traceback (most recent call last):
File "midi.py", line 174, in play
File "mido\midifiles\midifiles.py", line 316, in init
File "mido\midifiles\midifiles.py", line 340, in _load
File "mido\midifiles\midifiles.py", line 111, in read_file_header
OSError: MThd not found. Probably not a MIDI file
Hello,
I noticed that the script requires a "midi_config.json", but that file isn't included in the repository.
Is there a certain way the json file should be formatted if I do have to write it myself?
which programm i have to use to start this files or can u just give me advice, how to do it..
I use a QWERTZ keyboard, where the Z and Y keys are switched, but the program exspects the Y key to be next to the T key, so it plays the wrong note.
loaded 1 songs from config!
loading ghoul.mid
auto root found root at 58 with 404/404 (1.0)
start playing
Task exception was never retrieved
future: <Task finished name='Task-1' coro=<LyrePlayer.play() done, defined at midi.py:169> exception=TypeError("init() got an unexpected keyword argument 'type'")>
Traceback (most recent call last):
File "midi.py", line 194, in play
File "mido\midifiles\midifiles.py", line 376, in iter
File "mido\midifiles\tracks.py", line 104, in merge_tracks
File "mido\midifiles\tracks.py", line 62, in _to_abstime
File "mido\midifiles\meta.py", line 507, in copy
TypeError: init() got an unexpected keyword argument 'type'
it won't play any note after it has already been played previously
So a sequence of CDCFGAB CDEFGAB becomes CD_FGAB _ E _ _ _
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.