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

[WIP] Bars phrases and variable bpm in beats class #2512

Conversation

JaviVilarroig
Copy link
Contributor

This is still a WIP.
On BeatMaps, the infrastructure for adding variable Signature and BPM data and to mark beat as a bar beat or a phrase beat is mostly done.
On BeatGrids, the infrastructure for adding fixed Signature data and to indicate where to count bar and phrase beats is mostly done.
I have reached the point where it's possible to mark a beat as bar beat and to show them in the waveformrenderer. I have updated Tango skin (disclaimer: I'm not a designer, so it's ugly) to allow to mark bar beats.
By pressing the added button in the beat management interface, the nearest beat becomes a bar beat and all the following beats are recalculated accordingly up to the end of the track or the next phrase bar.
Bar beats are painted in a color defined in the skin, in my example in dim yellow.
Now I will move to add a button for phrase beats. But in the meantime I will love to have your review of the changes done until now.

Added support in BeatGrid and some minor fixes in BeatMap.
- Added Beats.setBar

The skin work is just a placeholder. I'm not so good in design.
- Extended BeatIterator for Bar and Phrase(partial) support.
- Extended BeatMap for Bar and Phrase(partial) management.
- Waveformrendererbeat extended to include the definition of the bar
beat color in the XML skin files.
- Tango Skin modified to include a button for marking bar beats.
@JaviVilarroig

This comment has been minimized.

@daschuer
Copy link
Member

Don't worry, just ignore them.

src/proto/beats.proto Show resolved Hide resolved
src/proto/beats.proto Outdated Show resolved Hide resolved
@Be-ing
Copy link
Contributor

Be-ing commented Feb 25, 2020

The new button to set the bar start beat shows as permanently pressed and pressing it does nothing:
image
This is with a new database. Tested with both BeatGrid and BeatMap.

src/proto/beats.proto Outdated Show resolved Hide resolved
src/track/beatmap.cpp Outdated Show resolved Hide resolved
src/track/beatmap.cpp Outdated Show resolved Hide resolved
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more comments.

d="M 12.52,33.264 H 11.4809 L 9.0746,11.116 C 8.96522,10.14989 8.91053,9.4298 8.91054,8.9558 c -2.6e-6,-1.1484 0.30077,-2.069 0.90234,-2.7617 0.61978,-0.69267 1.3581,-1.039 2.2148,-1.0391 0.85676,3.8e-5 1.5768,0.34639 2.1602,1.0391 0.60155,0.69274 0.90233,1.7227 0.90234,3.0898 -5.2e-5,0.43753 -0.03646,1.0482 -0.10938,1.832 l -2.4609,22.148 m -0.54688,4.5391 c 0.83853,5e-6 1.5495,0.30079 2.1328,0.90234 0.60155,0.58334 0.90233,1.2852 0.90234,2.1055 -1.3e-5,0.83854 -0.30079,1.5586 -0.90234,2.1602 -0.58334,0.58333 -1.2943,0.875 -2.1328,0.875 -0.83855,-1e-6 -1.5586,-0.29167 -2.1602,-0.875 -0.58334,-0.60156 -0.87501,-1.3216 -0.875,-2.1602 -2e-6,-0.82031 0.29166,-1.5221 0.875,-2.1055 0.60156,-0.60156 1.3216,-0.90234 2.1602,-0.90234"
style="fill:#ff3232;fill-opacity:1"
inkscape:connector-curvature="0" />
</svg>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider a bar symbol cut from staff lines with the lines in background? Is there anything else what we can use? IMHO the explanation mark is ambiguous.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe we can use a whole measure for a beat, and four measures for a phrase.
... Or one measure with a clef.

Ideas?

Copy link
Contributor Author

@JaviVilarroig JaviVilarroig Feb 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bufff. As I said, I consider myself a competent developer, just a little bit rusty.
But I'm a terrible designer. I will be very happy if someone with good designer skill can help on tat. I'm open to any kind of proposal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider a bar symbol cut from staff lines with the lines in background?

I like that idea. Maybe include a treble clef on the staff to clarify what it is. I am struggling to come up with an idea for a phrase icon though. @ronso0 do you have any ideas or want to contribute icons?

src/engine/controls/bpmcontrol.cpp Outdated Show resolved Hide resolved
@JaviVilarroig
Copy link
Contributor Author

The new button to set the bar start beat shows as permanently pressed and pressing it does nothing:
image
This is with a new database. Tested with both BeatGrid and BeatMap.

Curious, it works without problem for me.

I had some problems to create BeatMaps. To make sure you are not in a BeatGrid, press the button and look at the log. When in a BeatGrid clicking in the button generates a one line message "STUB BeatGrid::setBar".

Can you please check?

@Be-ing
Copy link
Contributor

Be-ing commented Feb 26, 2020

I thought we were planning to replace BeatMap and BeatGrid with a new class that handles all cases. I think it is a waste of time to work on both of them. BeatMap may be closer to what we need in the end.

@JaviVilarroig
Copy link
Contributor Author

I thought we were planning to replace BeatMap and BeatGrid with a new class that handles all cases. I think it is a waste of time to work on both of them. BeatMap may be closer to what we need in the end.

I agree on the point that BeatGrid is not really useful. It has a lot of limitations.

Must I read that as a proposal for a full revamp of the Beat class?

@Be-ing
Copy link
Contributor

Be-ing commented Feb 26, 2020

Must I read that as a proposal for a full revamp of the Beat class?

Yes. You could remove BeatGrid and make Beats into what BeatMap is now instead of keeping Beats as an abstract base class.

/// Return a string that represent the preferences used to generate
/// the beats object.
virtual QString getSubVersion() const;
virtual void setSubVersion(QString subVersion);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the purpose of this subversion concept. The version specifies the protobuf version so we can upgrade old data from the database to new versions in the future. What does a subversion add to that? I think we can remove it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how database migrations will work if we remove the subversion concept (along with versions as well).
Can this lead to problems?

/// Returns a string representing the version of the beat-processing code that
/// produced this Beats instance. Used by BeatsFactory for associating a
/// given serialization with the version that produced it.
virtual QString getVersion() const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QString? Shouldn't this be an int?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    static const QString BEAT_MAP_VERSION;
    static const QString BEAT_GRID_1_VERSION;
    static const QString BEAT_GRID_2_VERSION;

These will eventually be removed so I won't change anything about them.
We will rely on the preference settings just to check whether the user wants constant or dynamic BPM. BeatsFactory will read the preference instead of this version.

Do we agree on entirely removing the Beats versioning?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we cannot upgrade old data without versioning. The tricky situation we face now is that the legacy formats used a string to encode 2 different pieces of information, the version and the type (BeatMap or BeatGrid). Future upgrades will be more straightforward if we simply use an int to specify the version.

double previous_beatpos = -1;
track::io::Beat beat;

foreach (double beatpos, beats) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

foreach is a legacy Qt macro from before C++11. Use standard for (double beatpos : beats)

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

58be257
Is a really problematic commit.
It touches a lot of unrelated lines.

It looks like as if you have applied accidentally clang-format to many files.

There is a big risk that this has broken something. At least it is very hard to verify this in a review.

I am unsure how to proceed here. Mabe we can rebase this branch and redo the merge. But that involved another risk. I am unsure.

src/analyzer/analyzerbeats.cpp Show resolved Hide resolved
src/engine/controls/bpmcontrol.cpp Show resolved Hide resolved
@hacksdump
Copy link
Contributor

I would much prefer to get this into master ASAP. I hope that we can do that within the next week or sooner.

I'll be working to fix the outstanding issues and review comments on this PR this week and will try to get this merged by the weekend or the beginning of next week.

@daschuer
Copy link
Member

1851baf
is the real faulty commit. I will try to remove it.

@uklotzde
Copy link
Contributor

We need to rebuild this branch starting before the wrong merge from master in 1851baf! @daschuer Thanks for noticing and investigating.

@uklotzde
Copy link
Contributor

uklotzde commented Jun 12, 2020

Manually picking and re-committing changes from another branch is also not safe imho: d0e4b12

@daschuer
Copy link
Member

This is a branch that removes the faulty merge commit and also some issues from a previous master merge:
https://github.com/daschuer/mixxx/tree/bars_phrases_and_variable_BPM_in_beats_class2

Please reset this branch to mine and push to this PR.

If you have checked out this branch you can do it as follows:

git checkout -b bars_phrases_and_variable_BPM_in_beats_class_backup
git checkout bars_phrases_and_variable_BPM_in_beats_class
git pull https://github.com/daschuer/mixxx.git bars_phrases_and_variable_BPM_in_beats_class2
git reset 588b4957e87b896eda8401ad28b8a5dde9ec675b --hard
git push -f

to check the changes

git diff bars_phrases_and_variable_BPM_in_beats_class_backup

I am unsure about resolving conflicts in
res/skins/Tango/waveform.xml
I think that needs to be adjusted.

@Be-ing
Copy link
Contributor

Be-ing commented Jun 12, 2020

I am unsure about resolving conflicts in
res/skins/Tango/waveform.xml
I think that needs to be adjusted.

All GUI changes in this branch should be reverted. The GUI is implemented in #2844.

@hacksdump hacksdump mentioned this pull request Jun 13, 2020
7 tasks
@daschuer
Copy link
Member

OK, So please wait with the reset.
I will rebase my branch again, removing an earlyer merge commit as well.

By the way: for merging I use SmartGit. It works perfectly for resolving conflicts and is free for FOSS projects.

@hacksdump
Copy link
Contributor

hacksdump commented Jun 13, 2020

OK, So please wait with the reset.

Cool. I'll wait for the tree cleanup. Please let me know if I can help with the process.

By the way: for merging I use SmartGit. It works perfectly for resolving conflicts and is free for FOSS projects.

Thanks. This is really awesome.

@JaviVilarroig
Copy link
Contributor Author

Hi everybody.
This PR has become urgent due to the dependencies from the GSoC projects. And I have limited time to dedicate to it due to work and family issues. So I see that I can't offer the responsiveness that is required.
In different conversations with @hacksdump and @crisclacerda they have shown their willingness to use this PR as a base for their works so I propose to transfer the responsibility for this PR to them. I'm assuming that they are OK with this transfer (Can you confirm?)
This will facilitate the work in the GSoC projects, that are heavily time bounded
I'm not sure how to do it technically in GitHub. Any suggestion?
On my hand I can move to some other topics that I have in my personal todo list for Mixxx.
Feedback please.

@uklotzde
Copy link
Contributor

@JaviVilarroig Thanks for passing the baton to our GSoC students. I am confident they are able to finish the work you have started.

Unfortunately this branch is unmergeable due some errors that happened while resolving merge conflicts along the way. As mentioned in #2816 I have aggregated all necessary changes into a single commit and applied a final fix commit on top of that, see the branch uklotzde/mixxx/tree/rebuild-remove-beatmap-beatgrid. But I would like to keep you mentioned as the author, because it was not me that did all this work!

How about this pragmatic solution for a clean restart:

  1. You create create a new branch based on master
  2. Cherry pick the 1st commit from uklotzde/rebuild-remove-beatmap-beatgrid, i.e. 7b1c605
  3. Reset the branch to master while keeping the changes, i.e. mixed
  4. Create a new commit from these changes, so that you become the author of all these changes
  5. Finally cherry-pick the 2nd commit from uklotzde/rebuild-remove-beatmap-beatgrid, i.e. b73d015

Afterwards @hacksdump would be able to rebase his changes from #2861 on your branch and we are ready to go.

Also asking @daschuer @hacksdump @crisclacerda for comments.

@Holzhaus
Copy link
Member

@uklotzde if it's just about authorship, you can just use:

git commit --amend --author="Author Name <email@address.com>" --no-edit

@uklotzde
Copy link
Contributor

@Holzhaus Done.

I have force pushed uklotzde/mixxx/tree/rebuild-remove-beatmap-beatgrid, now with @JaviVilarroig as the author of the aggregate commit and a commit message that matches the title and number of this PR.

@Be-ing
Copy link
Contributor

Be-ing commented Jun 14, 2020

Thank you @uklotzde. @hacksdump please rebase your commits in #2861 onto @uklotzde's branch then force push #2861 and we can continue from there.

@JaviVilarroig
Copy link
Contributor Author

Does that mean that I must take no action?

@Be-ing
Copy link
Contributor

Be-ing commented Jun 14, 2020

Correct, there's nothing you need to do @JaviVilarroig.

@JaviVilarroig
Copy link
Contributor Author

Good Copy.
Do I am supossed to close that PR? Just for cleanup.

@Be-ing
Copy link
Contributor

Be-ing commented Jun 14, 2020

Sure, we can close this now in favor of #2861.

@Be-ing Be-ing closed this Jun 14, 2020
@daschuer
Copy link
Member

I have work in progress for a clean rebase of this branch.
Unfortunately tests are failing.

@daschuer
Copy link
Member

The clean rebase is here:
#2869

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

Successfully merging this pull request may close these issues.

9 participants