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

[Feature Request] Time stretching/shrinking for midi/drum parts #1037

Closed
cezaryece opened this issue Jul 9, 2021 · 3 comments · Fixed by #1065
Closed

[Feature Request] Time stretching/shrinking for midi/drum parts #1037

cezaryece opened this issue Jul 9, 2021 · 3 comments · Fixed by #1065
Assignees

Comments

@cezaryece
Copy link

Sorry if it is possible right now and I dont know how to do it, but if it not possible I vote for that possibility.

If it is possible just tell me how I can adjust duration of some midi part.
Let say I have 2 bars with 4 quarter-notes each (2 x 4 = 8) and I would like to get 3 bars with same 8 quarter-notes shifted in time to fill 3 bars.

@spamatica
Copy link
Member

There is currently no way to stretch midi dynamically.
Our scripting interface could be used to make such a stretch tool. Currently there are the related scripts doublespeed and halfspeed.

@StaffanMelin
Copy link
Contributor

I have created and tested a new Python script that solves this.

There was a bug in scripts.cpp, so when reading back the modified MIDI data from the script, all CONTROLLER events were misinitialized (tick was not read and set). I have fixed this too:

                if (line.startsWith("CONTROLLER"))
                {
                    QStringList sl = line.split(" ");

                    Event e(Controller);
                    int tick = sl[1].toInt(); // added line
                    int a = sl[2].toInt();
                    int b = sl[3].toInt();
                    int c = sl[4].toInt();
                    e.setTick(tick); // added line

@StaffanMelin
Copy link
Contributor

I am closing this. Is this the right thing to do or should I wait for review and merge?

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

Successfully merging a pull request may close this issue.

3 participants