Hi! This will a much needed improvement for OpenNBS, and also I'm quite excited, as the solution I had bugged me quite a bit
so I've been doing synthesia videos of Minecraft noteblock songs on my youtube channel, and my previous solution was to render the song with fluidsynth and a custom soundfont, however that had quite a lot of drawbacks (especially with more than one of the same note playing)
its pretty cool that there will be this tool that I can automate
I may also try contributing some stuff to gain some experience in that
os: Ubuntu 20.04
python version: 3.8.10
numpy (1.20.1) (this is lower than in the pyproject.toml file :/ )
pydub (0.25.1)
pynbs (0.4.2)
1.
So I had a few errors while trying to get it working, first it said:
File ".../nbs-audio-main/nbsaudio/audio.py", line 139, in Track
tags: Optional[dict[str, str]] = None,
TypeError: 'type' object is not subscriptable
this is the first time I see static typing in Python so I don't know exactly whats going on, but with
from typing import Optional, Dict
importing Dict and changing all the dict
to Dict
fixed the problem
if this is the right solution, I'd gladly open a pull request with it!
2.
then I got an error in the test thing but that may be because I dont know how to setup the environment,
File "./test.py", line 15, in <module>
os.environ["USERPROFILE"], "Minecraft Note Block Studio", "Data", "Sounds"
File "/usr/lib/python3.8/os.py", line 675, in __getitem__
raise KeyError(key) from None
KeyError: 'USERPROFILE'
anyway thats also installation dependent, so I just hardcoded the sounds
path for testing purposes
3.
so when trying to render the test.nbs
file, I got an error that something's not right with the instruments (though I indeed didn't provide any custom instruments, custom_sounds_path
was just the absolute path of the normal sounds folder):
Sound file for instrument fizz.ogg couldn't be found; skipping
Sound file for instrument Villager_idle3.ogg couldn't be found; skipping
Sound file for instrument wood_click.ogg couldn't be found; skipping
Sound file for instrument entity.firework.blast_far.ogg couldn't be found; skipping
Sound file for instrument Wither_death.ogg couldn't be found; skipping
Sound file for instrument Villager_accept1.ogg couldn't be found; skipping
Sound file for instrument Custom instrument #7 wasn't assigned; skipping
Traceback (most recent call last):
File ".../nbs-audio-main/nbsaudio/main.py", line 153, in _mix
sound1 = self._instruments[note.instrument]
KeyError: 16
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./test.py", line 23, in <module>
render_audio(song, output, custom_sound_path=custom_sound_path, format="mp3")
File ".../nbs-audio-main/nbsaudio/main.py", line 222, in render_audio
renderer.mix_song().save(
File ".../nbs-audio-main/nbsaudio/main.py", line 194, in mix_song
return self._mix(self._song.sorted_notes())
File ".../nbs-audio-main/nbsaudio/main.py", line 157, in _mix
f"The sound file for instrument f{ins.name} was not found: f{ins.file}"
AttributeError: 'int' object has no attribute 'name'
well idk about this one, but trying one of my nbs files it actually worked so pretty cool :D