-
Notifications
You must be signed in to change notification settings - Fork 86
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
Attempt to fix #646 #649
Attempt to fix #646 #649
Conversation
Download the artifacts for this pull request: |
Thanks @diyelectromusic. It looks like my PR fixes one instance of this issue (at least the build log doesn't show one of the errors anymore); the other would need to be fixed by a similar change in Synth_Dexed. |
I think the issue is that the fixed length 10 might be correct - it is setting the voice string within the fixed DX voice structure I think... ... but I'll need to have a proper look as it is also tied up with the mess that is get/setName in Dexed (more here: #501) Kevin |
Ok, yes, looking again, we do need the fixed 10 in the strncpy as that is the size of the voice name in the voice structure for the DX7. So I think the fix will be the following:
A similar thing is probably required in Synth_Dexed/dexed.cpp but as I say that is mixed up with the problems described in #501 so that would be a breaking change in the API to fix... but it really ought to be fixed!? It does address my comment in #501 about SetVoiceName only have a buffer of 10 though - that is wrong and does need to be 11 as shown above. Kevin |
Why not use |
Because this function is about truncating whatever voice name is passed in (which could be any size) to the explicit 10 characters defined in the DX7 SysEx voice structure, so as I say, the 10 is actually correct in this case, just not really accounted for properly in how its used. We could make the argument that GetName should do all that - and yes, I agree it ought to - but GetName/SetName is a mess as per #501 and can't be fixed without breaking the API so I doubt that will happen. So best just to do the robust thing here. In an ideal world I agree we wouldn't have hardcoded sizes like this, but the DX7 voice structure has been fixed for over 40 years, so I don't think we need to worry about that in this case :) Kevin |
Good point 👍 |
#648