LMMS / lmms

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

Additional jack channels audio output #524

Open DoosC opened 10 years ago

DoosC commented 10 years ago

It would be nice to have a possiblity to add jack channels output in LMMS (as it exists in Hydrogen), this would allow for routing audio to external mixer (like non-mixer which has ambisonics) or effects (like rakarrack) to further expand LMMS capabilities and modularities. This would take the form of additional jack channels audio output. A typical implementation would for example consist in adding a checkbox labelled "jack send" on each mixer strip (off by default) that would activate two additional (stereo) jack channels output for the current channel mixer (each L/R channel would be prefixed with the related mixer strip label, those which are by default "FX 1", "FX 2",etc).

grammoboy2 commented 10 years ago

+1

Sti2nd commented 9 years ago

Implemented

badosu commented 9 years ago

What is this request about? How was it implemented?

Sti2nd commented 9 years ago

Darnit, I think I'll head off to bed now, I read "per instrument audio export".

badosu commented 9 years ago

I still don't know what's this issue about, is it solo mode? Because solo mode was indeed implemented.

Sti2nd commented 9 years ago

It is about sending signals from LMMS to other programs.

badosu commented 9 years ago

Oh, so this issue is about showing output jack channels for each instrument.

This issue need better title and description if this is the case.

DoosC commented 9 years ago

@badosu : Okay, updated title and description. How about now => fine or still confusing ?

badosu commented 9 years ago

@DoosC Yes, thanks!

unfa commented 9 years ago

What about the FX-mixer outputs? 31 sty 2015 02:15 "Amadeus Folego" notifications@github.com napisał(a):

Oh, so this issue is about showing output jack channels for each instrument.

This issue need better title and description if this is the case.

— Reply to this email directly or view it on GitHub https://github.com/LMMS/lmms/issues/524#issuecomment-72297150.

badosu commented 9 years ago

This is not my area of expertise, it's probably viable but we need to consider 3 things:

  1. If this adds too much overhead so that more processing is required.
  2. If this passes the first one, then we need to figure out what would be the functionality and how this can be useful for artists, instruments, only mixers? Etc... This is where a demanding LMMS artist would help.
  3. Whether it's practical to have 30+ JACK outputs related to bigger projects for LMMS. This can be a usability and/or a performance issue.

There are some solutions for all these issues:

  1. Enable a single instrument/mixer output to be provided for JACK manually, this would make a lot of sense instead of being automatic.
  2. If automatic output for JACK is desired, making this an opt-out feature that must be enabled via Settings.
DoosC commented 9 years ago

As the typical use case would be to send specific audio streams out of LMMS for further processing I have zero doubt that this should not automatically be activated by default. As I proposed this should be a per mixer channel option that's all. I probably have no idea what I'm talking about, because I'm no dev but I don't see why there would be any overhead as all those audio streams already exist inside LMMS. As for jack scalabilty I have no worries either, ardour is using it extensively and also non-mixer and none seems to have any known scalability issue. Now I have no idea if this is difficult to implement or not with the current state of the audio engine. Probably easier said than done, and I'm the one saying :wink:

badosu commented 9 years ago

@DoosC A per mixer action looks like the best proposal for me.

PhysSong commented 5 years ago

If I remember correctly, it was implemented very long time ago but disabled for some reason. One can enable that by defining AUDIO_PORT_SUPPORT, but it failed to build. With these little changes, it at least builds:

diff --git a/src/core/audio/AudioJack.cpp b/src/core/audio/AudioJack.cpp
index bca41356b..5dd2a8512 100644
--- a/src/core/audio/AudioJack.cpp
+++ b/src/core/audio/AudioJack.cpp
@@ -328,8 +328,12 @@ void AudioJack::renamePort( AudioPort * _port )
                    _port->name() + " R" };
        for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch )
        {
+           // FIXME: jack_port_set_name is deprecated in favor of jack_port_rename
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
            jack_port_set_name( m_portMap[_port].ports[ch],
                    name[ch].toLatin1().constData() );
+#pragma GCC diagnostic pop
        }
    }
 #endif
@@ -358,22 +362,22 @@ int AudioJack::processCallback( jack_nframes_t _nframes, void * _udata )

 #ifdef AUDIO_PORT_SUPPORT
    const int frames = qMin<int>( _nframes, mixer()->framesPerPeriod() );
-   for( jackPortMap::iterator it = m_portMap.begin();
+   for( JackPortMap::iterator it = m_portMap.begin();
                        it != m_portMap.end(); ++it )
    {
        for( ch_cnt_t ch = 0; ch < channels(); ++ch )
        {
-           if( it.data().ports[ch] == NULL )
+           if( it.value().ports[ch] == NULL )
            {
                continue;
            }
            jack_default_audio_sample_t * buf =
            (jack_default_audio_sample_t *) jack_port_get_buffer(
-                           it.data().ports[ch],
+                           it.value().ports[ch],
                                _nframes );
            for( int frame = 0; frame < frames; ++frame )
            {
-               buf[frame] = it.key()->firstBuffer()[frame][ch];
+               buf[frame] = it.key()->buffer()[frame][ch];
            }
        }
    }
fogti commented 3 years ago

I opened https://github.com/LMMS/lmms/pull/5841 which fixes the compilation issue based upon the above patch.

luzpaz commented 1 year ago

What's the status of this ticket ?

netzgestaltung commented 1 month ago

I just came across the same issue(LMMS 1.2.2/Fedora 39) - i wanted to get every instrument as seperate tracks in ardour (and edit/effects there with calf plugins). There is somehow a setting "output channels" but the hint on it says: select 2 of 2 channels.

Otherwise, LMMS seems to not have JACK master support so it doesn't start to play remotly with ardour(like hydrogen does). Finaly i seperated each Instrument to a single Beat/Bassline and found "Export Tracks" and just added these files to the ardour project.