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

Jump & Drop Settings problems. #8

Closed
louis-barman opened this issue Jul 14, 2021 · 12 comments
Closed

Jump & Drop Settings problems. #8

louis-barman opened this issue Jul 14, 2021 · 12 comments

Comments

@louis-barman
Copy link
Contributor

I am raising this issue mainly to let you know that I am reworking these settings.
The Jump & Drop settings have never worked for me. It is not clear how to completely disable these settings. The docs state:

The Jump setting controls how difficult it is to move directly to the second register, and the Drop controls how difficult it is to drop directly from the second register to silence. You can increase these variables if you find you are "jumping" or "dropping" inadvertently, or decrease them if you are unable to move up or down between silence and the second register.

However looking at the code it seems you have to set them to the max to disable them.

It would best if they ran from 0 for completely off to 100 to be maximum (100%) effect.

It looks quickest for me to re-write that part of the code which you can then review.

@louis-barman
Copy link
Contributor Author

Ok this is more complicated than I thought and I am writing my thoughts here while they are fresh in my mind so that I can park this issue for a bit.

There are three allowed states which are SILENCE, BOTTOM_REGISTER and TOP_REGISTER. The problem we are trying to fix is when going directly from SILENCE, to TOP_REGISTER (a jump) but we don't want the BOTTOM_REGISTER to sound but the pressure curve will go through BOTTOM_REGISTER to get there. The same applies for a drop (going directly from TOP_REGISTER to SILENCE.

I have summarised my points below:

  • I am not sure if the algorithm that is suggested in the code is the best one to use. (Looking for a sudden pressure jump or drop and holding off changing the state until the jumpTime or dropTime holdoff time has elapsed). The problem with this algorithm (if I have understood it correctly) is that once triggered you always have to wait for the holdoff time even if this wait is unnecessary.
  • Having four controls to adjust things make it very difficult to set up. It would be better with just two variables and I think just two controls called 'max jump time' and max drop time would be the best.
  • An improved algorithm might be as follows. However I have made a big simplification which is not true , but helps with describing the idea. The simplification is that pressure changes linearly when doing a drop or a jump. I'll just describe the drop algorithm but same idea applies to a jump and we will assume the maxDropHoldoffTime is set to 20 mSec. When we first cross the BOTTOM_REGISTER and TOP_REGISTER boundary we allow a maximum time of 20 mSec to get to SILENCE. If we get to SILENCEbefore 20 mSec great, we immediately output a note off and there has been no delay to anything. If however at any point the pressure curve starts to flatten out then immediately we would move to the BOTTOM_REGISTER state and send a note on for that ocative. An extra delay would have been added when sending the note on for the BOTTOM_REGISTER. This delay would be less than maxDropHoldoffTime and would depend on how soon we can detect the pressure curve flattening out or even reversing direction.
  • To really understand what is happening pressure curves need to be collected and analysed when jumping between silence and the top octave and also when jumping between the bottom and top octave with no silence.
  • There is an argument that we should do nothing and that it is the job the sound generator/synth should to handle this correctly. The problem is that many synth do not handle this well including fluidsynth especially with soundfonts that have a percussive start.

@amowry
Copy link
Owner

amowry commented Sep 14, 2021

Many thanks Louis for all your work on this, and I apologize that's it taken me so long to look at your suggestions in detail! I agree that this algorithm could use improvements, and that the settings are confusing :). I think there is a bit of a misunderstanding about how it currently works-- it just takes two pressure readings over the course of a few mS and uses the difference to represent rate of change. If that is high enough, it immediately "jumps" or "drops". In other words, there's no additional waiting time. The "jump time" and "drop time" just prevent oscillations after the jump or drop has occurred, by preventing an additional state change right away. For example, say a drop has just occurred because of a sudden loss of pressure. It was triggered by the large rate of change of pressure, not the actual value of the pressure crossing the threshold required to turn off a note. So, based on the current pressure alone, a new note would be immediately turned on again after the drop occurred. The drop time is just a pause to allow the pressure to reach its desired level before a second state change is allowed to happen, i.e. turning on a new note. Because the additional time is only needed after the jump or drop occurs, it's relatively rare

If I understand your suggestion for a new algorithm correctly, it would require multiple pressure samples to monitor the shape of the curve, correct? My only concern with that is that it sounds like it might add some additional latency, unless I'm misunderstanding, whereas the current method only needs two sample points, so 2mS to (try to) determine the player's intent.

Thanks again! I'll be looking at all your other suggestions here very soon. I really appreciate all the thoughtful input and your willingness to wade through my subpar code!

@louis-barman
Copy link
Contributor Author

Hi Andrew, don't worry about the slow reply I have been very busy with other things as well.

With using breath controller I am not sure that these Jump & Drop Settings are needed at all since the the volume is rising from zero (jump) or falling very quickly (drop) so you cannot hear the problem so much. On a real whistle you also get the same effects when jumping and dropping. It might still be useful if the breath controller is not being used though.

I guess that most of your users don't use overblowing so would not need these settings. But I don't want to adjust my playing style when using the warbl. With my other fixes the Warbl is working very well for me.

@seisiuneer
Copy link
Collaborator

seisiuneer commented Sep 14, 2021 via email

@louis-barman
Copy link
Contributor Author

louis-barman commented Sep 14, 2021

My guess is that (and probably this guess is totally wrong) that a lot of users who would like to use over blowing have adapted their playing to use the thumb hole to get the upper octave because for me over blowing had lots of problems initially. (Also using over pressure with the non-vented mouthpiece might work better but I have not tried this) . If users are using overblowing on the Warbl my guess is that they are using a lot more over pressure than on a regular whistle. But I want to adjust the warbl to my playing and not the other way round.

Fortunately for me I because i am a programmer I can just go in and fix all the overblowing problems that I did not like. If you want to try out my fixes please see my last comment here: #6. I would be interested to hear your views.

@seisiuneer
Copy link
Collaborator

seisiuneer commented Sep 14, 2021 via email

@seisiuneer
Copy link
Collaborator

seisiuneer commented Sep 14, 2021 via email

@amowry
Copy link
Owner

amowry commented Sep 14, 2021

I made a decision tree to try to illustrate how the "state machine" works, something that I've been meaning to do forever :) :

https://warbl.xyz/WARBL%20state%20machine.pdf

I would agree that most WARBL users seem to be using overblowing, but I wouldn't be opposed to improvements if there are some that could be made. It's definitely just sort of a workaround to try to approximate the real thing. There has been a question about this on the WARBL forum too:

https://warbl.xyz/phpbb/viewtopic.php?f=3&t=235

I see your point about not needing the jump and drop if using as a breath controller, though I believe most people are using apps like Michael's Celtic Sounds, without breath control, hence the need for some sort of workaround. by the way, I believe if you increase both the "jump" and "drop" settings all the way, that effectively turns off this feature by requiring quite rapid changes in pressure.

@seisiuneer
Copy link
Collaborator

seisiuneer commented Sep 14, 2021 via email

@amowry
Copy link
Owner

amowry commented Sep 14, 2021

Thanks! I just made a few fixes to it.

@k0872
Copy link
Collaborator

k0872 commented Sep 15, 2021 via email

@louis-barman
Copy link
Contributor Author

Closing. please see #12

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

4 participants