Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom instruments using a different pitch aren't actually pitched in the export #4

Closed
CubixL opened this issue Apr 24, 2022 · 1 comment

Comments

@CubixL
Copy link

CubixL commented Apr 24, 2022

The instruments using a different starting pitch (going to Instrument Settings in ONBS and changing the Pitch column) doesn't actually change the pitch in the final export.

I'm not actually sure if the issue resides within this program or Note Block Studio, because I think the Pitch column is actually bugged and reversed in the editor (for example, having an instrument with it's default sound sounding like a D#4 should actually be set to A4 in order to be accurate). I might be wrong, though.

@Bentroen
Copy link
Member

Bentroen commented Apr 25, 2022

Thank you for your report! This is a known issue caused by the note pitch calculation not taking into account the pitch of the instrument, which you can set in Note Block Studio.

The issue is caused by the following line:

https://github.com/Bentroen/nbswave/blob/e24a77a53a3ebfd1945967bf3fbdc3c679356bd0/nbswave/nbs.py#L47

In order to figure out the note's pitch, nbswave subtracts 45 from the key, which is the default pitch value for all vanilla instruments (F#4). However, it's possible to change this value for custom instruments, and currently, it doesn't take that setting into account. Rather, it should read the note's instrument pitch value and use that instead. This will be fixed on the next release.

About the pitch setting being reversed in Note Block Studio, I believe what's happening is that, when you lower the instrument's pitch, it acts as shifting the piano up. So, let's say you've picked D#4 as the instrument pitch -- imagine the D#4 key on the piano being moved up until it occupies the position of F#4. So, although it's a bit counter-intuitive, I believe it has the correct behavior. Feel free to tell me if you find otherwise! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants