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

Float note positions and tuplets #1251

Draft
wants to merge 37 commits into
base: development
Choose a base branch
from

Conversation

oddtime
Copy link
Contributor

@oddtime oddtime commented Apr 27, 2021

After some tests I am pushing the experimental work (in progress) with double note tick positions.
I have not implemented a class for note positions, just using the 192/whole note resolution as a unit.

It includes the minimal gui used to test tuplets in #1127 that can be used to input fractional position notes.
Note: reloading a file using other branch versions, transforms all fractional positions to zero (not the fractional part but the number indeed), because of QLocale::toInt() in readXMLInt()

Note: piano roll is not working for tuplets

…fractional mismatch, make some old formulas more understandable + doc comments
@oddtime oddtime marked this pull request as draft April 27, 2021 07:57
@oddtime
Copy link
Contributor Author

oddtime commented Apr 28, 2021

Along with many things to discuss, there is the printing precision of double type values in XML nodes, affecting both Song export and copy/cut & paste. This is bonded together with the tolerance that the GUI accepts while searching the note (to overwrite or remove the note for example).

For the moment I am using 10 significant digits for the XML double nodes, and defined a POS_EPSILON in Pattern.h for the tolerance (wider than the XML precision).

@oddtime oddtime force-pushed the floatNotePositionsAndTuplets branch from b5bf419 to 3101b64 Compare April 28, 2021 19:26
@oddtime
Copy link
Contributor Author

oddtime commented Apr 28, 2021

I see Windows is not building the last commit. I have no idea, there were very few changes (maybe function fabs or missing a
parenthesis ?).

@theGreatWhiteShark
Copy link
Contributor

I see Windows is not building the last commit. I have no idea, there were very few changes (maybe function fabs or missing a
parenthesis ?).

Hey @oddtime ,

I think this was due to one of my commits which slipped into master and caused the Windows builds to break.

@theGreatWhiteShark
Copy link
Contributor

Hey @oddtime,

I'm currently working on a larger patch of Hydrogen's AudioEngine to make it support arbitrary tempo changes. Unfortunate for me but lucky for you, this will include changing the tick type from integer to float. At first, there will be a compatibility layer making everything except AudioEngine and Sampler still see the ticks as integers but from the engine perspective there won't be much missing to support arbitrary tuplets.

@oddtime
Copy link
Contributor Author

oddtime commented Dec 15, 2021

Hi @theGreatWhiteShark
this seems good ;) thanks for it
and thanks for the information here, send the link when you upload the thing.
I am afraid that I will have to rewrite all this PR at the end...

@theGreatWhiteShark
Copy link
Contributor

I am afraid that I will have to rewrite all this PR at the end...

Well, at least the AudioEngine stuff I'm doing right now is more or less orthogonal to your PR. But there was indeed quite some progress during the last year.

@oddtime
Copy link
Contributor Author

oddtime commented Oct 13, 2022

@theGreatWhiteShark is your patch of Hydrogen's AudioEngine fully merged now? Thanks

@theGreatWhiteShark
Copy link
Contributor

@theGreatWhiteShark is your patch of Hydrogen's AudioEngine fully merged now? Thanks

Hmm. So, the audio engine already uses double precision ticks internally. That's merged. But there are still a number of glitches due to me getting some things not right the first time and some conceptional legacy still prevailing. I'm in the process of fixing these things and make the engine (hopefully) run as smooth as it gets. It still needs some more testing but it feels like its almost done. https://github.com/theGreatWhiteShark/hydrogen/tree/phil-introduce-transport-position

That aside, Note placement is still only possible on integer tick positions. I did not touch this in order to not change too many things at the same time. From the perspective of the audio engine, however, this should take only some minor changes to support double precision note placement. But the remainder of the core and the GUI has to be adapted. This is probably quite some work.

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

Successfully merging this pull request may close these issues.

2 participants