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

Writing back pedal and control change #5

Open
Yikai-Liao opened this issue Dec 17, 2023 · 2 comments
Open

Writing back pedal and control change #5

Yikai-Liao opened this issue Dec 17, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Yikai-Liao
Copy link
Owner

Pedals are actually stored twice, in controls and pedals of a track

If someone change controls or pedals, there might be some inconsistence between them.

Now, in symusic, we just write all the controls back and ingoring the pedal events in pedals.

Well, a solution is to remove all the corresponding control events in controls, but I'm not sure if it is a good design.

What's your opinion @Natooz ?

@Natooz
Copy link
Contributor

Natooz commented Dec 17, 2023

Good point, that's actually something I kept in my head for later when working on miditoolkit.

I think keeping all the controls in Track.controls is better, and it's simpler to write only the controls. Track.pedals should just be for users to use.

Now avoid any pedal-control inconsistency, we could ensure that each pedal stored has its Control equivalent. This shouldn't be a problem when parsing as the pedals are deduced from the controls. But then, if a user is adding a pedal to any Track.pedals, we could add the equivalent control in Track.controls. And also each time a control is added to Tracks.controls, if its a pedal we could just add the pedal to Track.pedals.

Setting Track.pedals as a property with setters / deleters would achieve this purpose.

It would make sure that the user can use/add any pedals without duplication, even for let's say two identical pedals (that may append even if it's not natural).

@Yikai-Liao Yikai-Liao added the enhancement New feature or request label Dec 17, 2023
@Yikai-Liao
Copy link
Owner Author

It would be challenging to achieve this encapsulation if common operations in list is allowed for pedal like slice.
Also, in this case, we may need to store two references of the corresponding control change in pedal, and a reference of pedal in control change event.

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

No branches or pull requests

2 participants