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

units for egN_pitch #1032

Closed
Windsurfer152 opened this issue Nov 19, 2021 · 8 comments · Fixed by #1037
Closed

units for egN_pitch #1032

Windsurfer152 opened this issue Nov 19, 2021 · 8 comments · Fixed by #1037
Labels
bug Something isn't working
Milestone

Comments

@Windsurfer152
Copy link

My first contribution on any github project ever. Be gentle with me!

I'm a musician rather than a developer. Not sure if this is a bug or an issue.

Running sfizz1.1.1-0 inside Carla on Linux Peppermint 10.

I've loaded Unreal Instruments Two Whistles. All the instruments that utilize the egN_pitch opcode are glitchy. I've worked out that while the instruments are coded to use cents as the unit I think sfizz uses semitones. So I just get a pop or a silence where there should be a specific pitch.

I don't remember that being the case earlier this year when I was using an earlier version of sfizz, but I could be mistaken.

There's no entry for units in the sfzformat.com/opcodes listing for this parameter. And I don't currently have any other examples I can point to. But cents would seem to make more sense, in the same way it is used for calibrating LFOs.

Let me know if you need more info.

@paulfd paulfd added the bug Something isn't working label Nov 19, 2021
@paulfd paulfd added this to the 1.2.0 milestone Nov 19, 2021
@paulfd
Copy link
Member

paulfd commented Nov 19, 2021

Hi ! Thanks for the report :)

My first contribution on any github project ever. Be gentle with me!

Promise ! I'll look into it. I've used the pitch target (the _pitch part) for CC opcodes recently and it seemed to work, so there might indeed be a bug in the EG handling of this.

There's no entry for units in the sfzformat.com/opcodes listing for this parameter. And I don't currently have any other examples I can point to. But cents would seem to make more sense, in the same way it is used for calibrating LFOs.

SFZ tends to be fragmented, with partial documentation, and different implementations, so it's not really surprising that sfzformat is not complete in this regard even though it is already a remarkable resource. However, it is also possible to propose changes to the website and descriptions, so when we clear up what's happening here we can also document it.

@Windsurfer152
Copy link
Author

At the risk of stating the obvious; the issue also applies to egN_pitch_onccX.

@paulfd
Copy link
Member

paulfd commented Nov 20, 2021

So I think the main issue is that Sforzando is clamping the values of egN_levelX between -1 and 1. As a result, for example in Cut_HT.sfz you have

eg1_pitch=100
eg1_sustain=2
eg1_time0=0
eg1_level0=-100
eg1_curve0=2
eg1_time1=0.05
eg1_time1_oncc27=0.1
eg1_level1=-100
eg1_curve1=2
eg1_time2=0.01
eg1_level2=0.0
eg1_curve1=2

Note in particular eg1_level0=-100 and eg1_level1=-100. In sfizz, this creates a pitch bend of 100 semitones; obviously too much. I've prepped a fix where I clamp the input values for flex EGs. Note that it's very rare that Sforzando clamps the input values...

On another note, the egN_curve parameters seem ignored by both sfizz (normal, not implemented) and Sforzando. I will also open another issue because the default keyswitch seems wrong.

@paulfd
Copy link
Member

paulfd commented Nov 20, 2021

If you're open to trying the pull request you can download artifacts at https://github.com/sfztools/sfizz/actions/runs/1485244313 when they're up.

If not, I'll merge it in the develop branch. If you're using the main branch, a quick fix for the problem would be to set all the levels at 1 instead of 100 (or -1 instead of -100).

@Windsurfer152
Copy link
Author

Windsurfer152 commented Nov 20, 2021 via email

@paulfd
Copy link
Member

paulfd commented Nov 20, 2021

But in the Cut_HT example you give if I change the eg_pitch value from 100 to 1 I think it gives the right result without touching the eg1_level0=-100.

For sfizz yes, because 1 x -100 is the same as 100 x -1 since the level values are unclamped. But in Sforzando it will not sound the same, so you'd rather change the levels. If it still bugs for other keyswitches you can reopen the issue. By the way, I also corrected issues with the default keyswitch.

I merged it already to be honest, so you can try the develop branch. You can build it or try a package from the OBS builds.

@Windsurfer152
Copy link
Author

I'd misread your explanation even though you were very clear; egN_levelX, not "eg in general." So my points about pitch values that are >1 but <100 are irrelevant.

All seems to be fixed in the develop branch. Great work. Thank you.

@paulfd
Copy link
Member

paulfd commented Nov 21, 2021

Thanks for the report!

@paulfd paulfd modified the milestones: 1.2.0, 1.1.2 Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants