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

A duplicate (copy+paste) feature for instruments #1925

Open
quasilyte opened this issue Jan 1, 2024 · 4 comments
Open

A duplicate (copy+paste) feature for instruments #1925

quasilyte opened this issue Jan 1, 2024 · 4 comments

Comments

@quasilyte
Copy link

quasilyte commented Jan 1, 2024

Hydrogen version * : 1.2.2
Operating system + version : Linux Mint
Audio driver + version : alsa


Let's suppose you want to modify some drumkit to make it work with your drum better.
Take the case from #1919 for example.

The drum device could emit 2 notes for a single pad (let's say it's 26 and 46 for an open hi-hat).
If we enable "use output note as input note" and assign a different note value to the "MIDI output note", we could only handle a single MIDI note with that instrument.

So either there should be a way to handle more than one note in there (sounds tricky with the current "output as input note" model) or the user is expected to copy/paste the instrument to get two identically sounding instruments in their drumkit with different output notes assigned to each other.

I found it not very convenient to do it right now: there seems to be no feature to duplicate the instrument. I see two ways for a user right now:

  1. Create a completely new instrument and fill the layers manually. This is inconvenient if you're not a drumkit author, since you have no idea about the samples, you just want to re-assign the note range)
  2. Open the drumkit XML file and copy/paste the target instrument section. It looks painful due to the ID values: the user will have to assign some unique (?) value on their own. This XML file doesn't look like it's supposed to be edited by hand.

A "duplicate instrument" feature would make both of these methods obsolete for the case described in this ticket. The user may also adjust the samples if they want to (if different sound for these MIDI notes is desired).

The "duplicate instrument" action could be added to the context menu that is being opened by right-clicking the instrument. There is a "duplicate" action for the patterns, so I think it will be a good addition to have it for the instruments too.

@theGreatWhiteShark
Copy link
Contributor

The "duplicate instrument" action could be added to the context menu that is being opened by right-clicking the instrument. There is a "duplicate" action for the patterns, so I think it will be a good addition to have it for the instruments too.

+1. Sounds very reasonable!

there seems to be no feature to duplicate the instrument

You can import individual instruments from a kit in the Sound Library by click-dragging them into the Pattern Editor. If you did not modified any of the instrument's parameters, you can just import the stock one from the kit you are using. If you tweaked some parameters, added layers, changed samples etc, you have to save the kit associated with your song into a new drumkit first and drag-import the instrument later on.

But you are right, having a duplicate action would be way more intuitive (especially for first-day users).

@quasilyte
Copy link
Author

Dragging & dropping an instrument into a new drumkit sounds good.
The only problem is discoverability for the new users. Hopefully, issues like this one make it easier to find a feature like this with a Google (or GitHub issue) search.

With that being said, if you don't feel like it's adding to a feature bloat, the "duplicate" action for the drumkits could be a good first-time-contributor issue (unless there is a reason why it's more complicated than it might look).

@theGreatWhiteShark
Copy link
Contributor

The only problem is discoverability for the new users.

Definitely. Especially since drag and drop is not a feature widely supported within Hydrogen (yet).

With that being said, if you don't feel like it's adding to a feature bloat, the "duplicate" action for the drumkits could be a good first-time-contributor issue (unless there is a reason why it's more complicated than it might look).

Sure. It's basically just a refactoring of code used for drag-drop importing. In PatternEditorInstrumentList::dropEvent the SE_dragInstrumentAction undo/redo action is triggered. To allow for the above feature, one just needs to add a "Duplicate Instrument" action to the popup menu and make it create and enqueue a similar SE_dragInstrumentAction. (And rename it into something more descriptive, like "SE_importInstrumentAction").

Do you want to give it a shot?

@quasilyte
Copy link
Author

Do you want to give it a shot?

Whether I feel like doing some C++ lol. :D

I may send a PR eventually, but if anyone beats me to it it's totally fine too.

Right now I'm focusing on the latency issues (I wonder if it's the same on Windows and/or MacOS).
I'll check out https://github.com/hydrogen-music/hydrogen/discussions and see if it was discussed there already. Otherwise, I may create a new discussion thread. :)

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

No branches or pull requests

2 participants