LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
8.04k stars 1k forks source link

Better MIDI support #1472

Open tresf opened 9 years ago

tresf commented 9 years ago

This is a placeholder to consolidate MIDI related issues. If a new MIDI enhancement is reported on the tracker, close it out and mark it as a duplicate of this bug (and naturally add to this list as needed) (#1472)

Note: As opposed to our other placeholder bug reports, MIDI is slightly different as it is mostly feature-complete. Version-specific MIDI bugs should remain open and tracked on a per-version basis. Don't close out valid bug reports simply because they use the word "MIDI" in them, first make sure they aren't attributed to a specific build. :+1:


Basic Functionality:

Enhanced Functionality:

Bugs:

Related:

badosu commented 9 years ago

@tresf Perhaps we could make this a checklist where we can tick each task as it is completed.

In my case I don't have a fully capable MIDI controller, but would like to work on the Export to MIDI feature.

Take a look at this reference on markdown checklists if you need.

diizy commented 9 years ago

On 12/26/2014 10:17 PM, Amadeus Folego wrote:

@tresf https://github.com/tresf Perhaps we could make this a checklist where we can tick each task as it is completed.

In my case I don't have a fully capable MIDI controller, but would like to work on the Export to MIDI feature.

Take a look at this reference https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments on markdown checklists if you need.

Export to MIDI should be implemented as an export plugin.

You don't need a MIDI controller for it.

badosu commented 9 years ago

I know, I am talking about the other features, this is an example of a feature that does not need a virtual/real midi controller.

So when this task is completed is is marked and we have a sense on how our MIDI support is evolving.

tresf commented 9 years ago

Perhaps we could make this a checklist where we can tick each task as it is completed.

Sounds good. Planned on using strikeout (~~strikeout~~) to mark as done if that sounds OK.

Reaper10 commented 9 years ago

Working on a keyboard layer plugin and keyboard layer track GUI mockup for #1381.

rheslip commented 9 years ago

I'm finding midi import crashes LMMS on about 30% of the files I've tried on V1.10, V1.12, Win64 and Win32 versions. These files seem to play OK in Windows Media Player. Audacity imports them OK. Example: http://en.midimelody.ru/midi.php?str=%2Fb%2FBeck%2C%20Jeff%2FBeck%2C%20Jeff%20-%20Blue%20Wind.mid

Sti2nd commented 9 years ago

Probably because it contains some feature that LMMS doesn't support

rheslip commented 9 years ago

I haven't found exactly what causes the crash but it appears to be something with pitch bends. There is a lot of pitch bending in that tune (Jeff Beck's "Blue Wind") and when I filter all the pitch bends out of the midi file it imports correctly. I'll see if I can narrow it down to something more specific.

badosu commented 9 years ago

@tresf Can you tick #699 as it was fixed?

tresf commented 9 years ago

@tresf Can you tick #699 as it was fixed?

:+1:

Umcaruje commented 9 years ago

This should be turned into a task list so its easier to mark fixed issues.

Reaper10 commented 9 years ago

The Play and Stop, buttons on the B&B Editor needs to be assigned to deferent MIDI CC numbers then main transport, so you can assign them to deferent buttons on your MIDI controler then the main transport.

Wallacoloo commented 9 years ago

@Reaper10 in the future, try to provide some context when you link to another issue. For example, say something simple like "#1977 should be added to this list" so that we know why you're linking us there.

Wallacoloo commented 9 years ago

So with these huge lists: if I want to discuss one specific item in depth, should I do it here or on the original issue that is linked (even though it's already closed)?

tresf commented 9 years ago

@Wallacoloo either is fine.

The closed topics are closed more for organization purposes, (technically they are still open and still valid) so feel free to use the original bugs as needed if you want to prevent bugs like this from turning into run-ons.

The consolidation was done because as you can see above, we have many, many duplicates and many related bugs that would otherwise be quite difficult to track independent of each other. :+1:

davetbass2 commented 9 years ago

Hey I definitely don't want to be pushy, because after all it's a volunteer project that you guys put massive amounts of time into, but (haha) is there a way to prioritize based on what the average or potential users need.

To me these 2 are the most basic:

MIDI pitch-bend support #1918 MIDI modulation wheel, sustain pedal and expression pedal support #1918 #1917 #1890 #1700 #1953

Again, just a suggestion, maybe there could be a poll somewhere?

Thanks! Dave

tresf commented 9 years ago

maybe there could be a poll somewhere

Someone could certainly do this. We've had some polls in the past. What we need more than anything is a few more people getting their hands dirty with the code, which a poll won't necessarily fix.

davetbass2 commented 9 years ago

Cool I hear you, I've actually started learning c++ (I had taken 2 semesters of c in school) but I think it'll be a while before I could contribute.

Thanks

drummyfish commented 9 years ago

@tresf Can you tick #699 as it was fixed?

So MIDI export works now? How?

tresf commented 9 years ago

@drummyfish in a future release, 1.2.0.

DeRobyJ commented 9 years ago

For the "MIDI mapping using custom key ranges #1743 #1381 #1792 ", we could use the new tab in the plugin window, the one used to disable transposition. It's a really important feature: with that you can use the B+B editor as a drum sampler #1460.

teknopaul commented 7 years ago

I've done some work for MIDI play/pause/stop/record, so I a Korg nanoKONRTOL assigned to control LMMS functions. on https://github.com/teknopaul/lmm. I'll see if I can make it a bit more generic.

musikBear commented 7 years ago

Supporting Advanced midi keyboard features / midi-HW drums-pads This request was caused from this http://lmms.io/forum/viewtopic.php?f=7&t=8627 The essence is that one single connection here means that eight pads have notes assigned to them like: [D3] [A2] [Eb3] [C#3] [C2] [D2] [[F#2] [Bb2] For the 8 pads resp.

I suppose stand-alone midi drum-pads has similar setups(?) In order to have this covered i suppose lmms need to be able to bind a single key to a midi-channel But, in the referenced issue, the keyboard only allow one channel connection. I suppose a sampler / customized edited soundfont solution, could be 'a' way, but if at all lmms should be made able to handle this scenario, i see this as a situation where:

tresf commented 7 years ago

@musikBear https://github.com/LMMS/lmms/issues/1460

Cangle50 commented 5 years ago

Why are the request in this Issues not being addressed? It's as if they are being swept under the rug for some reason. The mod wheel for Vestige is a must have for automation purposes imho.

musikBear commented 5 years ago

@Cangle50 You are at any moment more than welcome to address any or all of the requests. It will only take most of your spare-time, and you will almost have nothing to explain to other significant ones, about you being glued to a chair infront of a pc, instead of participating in life ..

The devs does an unbelievable job, and nothing is swept anywhere or under anything. Developing takes t i m e, and bug-fixing comes before feature-requests. Be patient, it will come

Cangle50 commented 5 years ago

@musikBear The mod wheel for Vestige has been requested for almost 5 years now. I don't think revisiting old request are unreasonable, if for no other reason then to remind the dev's that some request are still relevant.

I didn't mean to get under your skin musikBear. I know that the Dev's work hard and I appreciate their efforts, but I had do it. As the old saying goes, the squeaky chair gets the oil.

tresf commented 5 years ago

The mod wheel for Vestige has been requested for almost 5 years now

"Swept under the rug" suggests blame. We have a zero tolerance on this tracker. Next offense, you're banned.

I had do it. As the old saying goes, the squeaky chair gets the oil.

The proverb is "the squeaky wheel gets the grease". Please appreciate the irony of this statement when moderators have to issue ban warnings.

Amathadius commented 5 years ago

Any news about "Expose MIDI controls" and all sub-points? I know that I necrobump this, but it's really annoying to not be able to use such basic functions with midi controllers on lmms.

PhysSong commented 5 years ago

@Amathadius Which feature do you need the most in the list? We may prioritize the issue if it's valuable enough.

shdo commented 5 years ago

@PhysSong

"Which feature do you need the most in the list?"

Bank Select MSB, Bank Select LSB and Program Change... Or a way for us to choose what to send choosing one of Midi CC and setting the value to be sended.

musikBear commented 5 years ago

@PhysSong The feature that most ask us about, is a fast simple way to connect any instrument in song-editor to play through MIDI-keyboard. Ideally would be that the one in focus, would play transparently when a MIDI-kb key was pressed- Eg no manually "connect-to-midi" on the midi-tab

Spekular commented 5 years ago

This seems consistent with what I've seen, people want to play via MIDI keyboard the same way LMMS does for a typing keyboard.

DeRobyJ commented 5 years ago

That's true, but I feel like this should just add up over the existing Midi routing, so that you can still use LMMS with many keyboards connected to different synths, e.g. while not having any in focus.

So:

The "Faster access to MIDI assignment" point should still be addressed, but it would be far less important, as it would only affect users that are setting up an advanced project.

Amathadius commented 5 years ago

To be able to assign buttons, knobs, sliders... controller "sections"... to any functions of LMMS (play, pause, stop, volume, switch track, loop, etc.). Right click on option, assign key/button/knobs...

To be able to at last manually assign "things" to what ever you want makes LMMS more flexible and midi controller more usable.

musikBear commented 5 years ago

as it would only affect users that are setting up an advanced project.

I fear we even have to remember, that some like to use (be able to use ) LMMS in live-performance, so also relevant there.

michaelgregorius commented 5 years ago

I think #1857 should be added to the "Basic Functionality" section.

Edit: I have added it myself.

artur-twardowski commented 5 years ago

Some ideas that have come up to my mind so far. If needed, I can open separate tickets for them.

Speaking of transport control, the Play/Stop/Record controls could also be made assignable to MIDI events, but this was already mentioned by others.

benwiley4000 commented 5 years ago

What's the main blocker for midi pitch bend recording support? I was recording a solo via midi and was surprised that even though the pitch bends were correct during the recording, they were missing during later playback. If there's something I could contribute to help this make it into a near-term release I'd be happy to look into it!

michaelgregorius commented 5 years ago

Hi @benwiley4000,

I had a quick look at the problem, i.e. I have checked what happens if you play a note while recording and what happens if the pitch wheel is moved. Unfortunately it seems that there is no quick solution to your problem. In my opinion the main blocker is that MIDI is not a first class citizen in LMMS. So you have asked your question in the correct issue. ;)

MIDI and audio streams in other DAWs

Most other DAWs know at least the following two first class citizens:

If you record something (or import files) these DAWs will create containers which store or reference this data. The containers can be moved or copied around the timeline and tracks to build a song. If you record MIDI with a keyboard the container will still represent this information as a stream of MIDI events. And if you play back with the playhead over the container then the DAW will reproduce this stream of MIDI events and route it wherever it should go, e.g. to an instrument plugin. It's then up to the instrument plugin to interpret what to do with this data which allows for very flexible and different implementations. Because the data is still represented as MIDI events this also means that pitch bends would be played back without problems because they are simply events in that event stream.

What happens in LMMS?

Recording a note

Let's now see what happens in LMMS when you hit record in the piano roll and press a key on your keyboard. I have tested this with an instance of TripleOsc. A note is recorded as follows:

  1. As soon as you press a key on the MIDI keyboard the method InstrumentTrack::processInEvent is triggered. The switch statement in that code will trigger the MidiNoteOn case which in turn will call NotePlayHandleManager::acquire which creates an instance of a NotePlayHandle.
  2. In the constructor of NotePlayHandle the signal midiNoteOn is emitted for the associated instrument track because it is created with the origin being set to OriginMidiInput.
  3. The method PianoRoll::startRecordNote is connected to that signal and adds a new instance of Note to its recorded notes which are stored in m_recordingNotes.

Moving the pitch bend wheel

If you move the pitch wheel this will also trigger InstrumentTrack::processInEvent. In this case the MidiPitchBend case is handled. If you look at the code you will find that it only makes changes to the current state of the instrument track. That's the reason why you can hear the changes during recording. However, it does not trigger any code that will record the pitch bend events. This is because LMMS does not know how to store pitch wheel events and also has no place to store them. It does not make sense to store them in a NotePlayHandle because in that case the NotePlayHandle would now need to be able to store different states of pitch for different times.

A potential solution (how most other DAWs do it)

Put differently: LMMS is very quick to translate the MIDI data into its own representation which is not able to handle all the nuances of a MIDI stream. In my opinion it also does too much interpretation outside of the instruments and plugins (compared to having the interpretation implemented in plugins/clients). The best solution would be to represent all non-audio data as MIDI internally (or at least in a form that encompasses all of MIDI) and to route it accordingly. This would also enable the usage of plugins which transform the MIDI stream (e.g. transpose it, make all notes of equal volume, etc.). With the current implementation I assume that such plugins are not supported.

The fact that most plugin standards (VST2, VST3, LV2, etc.) differentiate between audio and MIDI is another indicator that it's a good idea for a DAW to be able to deal with streams of MIDI data internally.

If MIDI was a first class citizen it would likely make importing MIDI data easier as well. You would "simply" read the MIDI data, perhaps transform it and then put it into the containers. And then play it back to your hearts content.

benwiley4000 commented 5 years ago

@michaelgregorius what do you think some actionable steps could be? The "perfectly correct" way, and also, what would actionable steps be if I'm totally selfish and only want to get my feature implemented? 😜 I'm brand new to the code base but if there's a small task I could start with that would be great.

michaelgregorius commented 5 years ago

Hi @benwiley4000,

I guess even a "selfish" and perhaps even "hacked" implementation that only solves this single problem would be rather complex. The base problem can be described as "MIDI events are generated but only some of them are recorded so only a subset of the input events will be played back". So you'd have to solve the following problems:

  1. Find a way to record the events that are not recorded currently (or at least the pitch bend events). As noted above it likely does not make sense to also store them in the NotePlayHandle instances so you'd have to invent your own data structure and organisation of the structure during recording and playback.
  2. You will also to implement a way to store that new data structure in a saved file so that the recorded events are persisted across sessions.
  3. If you had this data structure then you'd also have to find out in some way how many voices are active for example in a given InstrumentTrack that gets the pitch bends applied. Because if you for example press three keys one after the other on your MIDI keyboard without releasing them and then move the pitch wheel then the pitch bend will have to be applied to all three active notes.

As you can imagine the steps that need to be implemented for the "perfectly correct" way would be even more complex. Things that come to mind are:

Once this infrastructure was available I think many interesting and useful things could be implemented. For example:

By the way, if you want to get your feet wet with regards to coding in LMMS there are some issues which are tagged as "good first issue". Perhaps you can find something interesting there even if it doesn't scratch your current personal itch. :wink:

musikBear commented 4 years ago

Has functional MIDI-export been implemented at any time? Afair : Yes. I believe it has been working. I can read the Notes in the archive, and the first time MIDI-export is mentioned, is in v1.1.90, under General Improvements as 6. item in that list:

    General Improvements
        Build support for Haiku (BeOS) Operating System
        Better handling of corrupt projects/presets
        Export as loop support for CLI (#2131)
        Added Apple MIDI support (#1153)
        Fix "Dummy" audio selection (#2376)
        MIDI export support

MIDI-export is broken in aspects of

in 1.2.1 #5287


Irrelevant: Yesterday i spend ~20 mins to search for the most relevant thread for (re)-reporting broken MIDI-export in 1.2.1. This thread did not appear in any search involving MIDI+ (fail | broken | lost) -So i made a new Issue. (5287) But it belongs here. Searching and getting relevant results here, are imo a problem. Some kind of 'header' with most relevant keywords -could that be an idea?

sebwahl commented 4 years ago

Hello ! Firstly, allow me to wish all of you a happy new year ! Secondly, as it is my first post here, I would like to thank really kindly all contributors to this project. I discovered LMMS a few days ago, and I'm very impressed by the quality of this software.

Now to the point : MIDI sound banks ! I also have a nice Yamaha CLP-645 with very high quality piano samples (Yamaha GH2 / Bösendorfer Imperial ...) and I would like to write some parts on LMMS and render them via MIDI. The problem is : i'm only allowed to select a program (from -1 to 127) that applies to the default bank. But to select the other voices, you need to send a MSB and LSB then a program... clp685_en_mr_b0.pdf

So, if my opinion is accepted : "MIDI bank-selection (MSB) support #62" item would be really appreciated ;)

Sadly it will be impossible for me to contribute, as my level in programming is too low ... wish I could help...

LNooteboom commented 4 years ago

@tresf With the merge of pullrequest #5499 "Faster access to MIDI assignment/auto-assignment" can be ticked now I think.

SeleDreams commented 2 years ago

I'm thinking of working on creating a midi out plugin similar to fl that will send midi data to specific channels of vestige instances i'll look into it

Spekular commented 2 years ago

I'm thinking of working on creating a midi out plugin similar to fl that will send midi data to specific channels of vestige instances i'll look into it

Why a plugin (where would it go?) and why only to VeSTige? Native effects would benefit from receiving MIDI as well, and ideally you'd be able to send that MIDI from any track (e.g. if you already have an instrument playing the "control" MIDI)

SeleDreams commented 2 years ago

I'm thinking of working on creating a midi out plugin similar to fl that will send midi data to specific channels of vestige instances i'll look into it

Why a plugin (where would it go?) and why only to VeSTige? Native effects would benefit from receiving MIDI as well, and ideally you'd be able to send that MIDI from any track (e.g. if you already have an instrument playing the "control" MIDI)

a plugin because it's the only way i'd imagine being able to send midi data to multiple midi channels of a same plugin at the same time

I said vestige mostly because it's mostly vst that require multi midi input, no lmms instrument uses it since they just use a single channel

icubex commented 1 year ago

LMMS on MacOS Ventura 13.3.1 crashes when any virtual MIDI port is created or disposed of. Also, unfortunately LMMS doesn't allow these virtual MIDI ports to be used so it's necessary to use a software like MIDI Pipe to route the messages from the virtual MIDI port to the IAC driver (which can be used in LMMS). LMMS_crash_report.zip

PhysSong commented 1 year ago

@icubex Duplicate of #5728, and the fix will be included in future releases.