lmms icon indicating copy to clipboard operation
lmms copied to clipboard

Additional jack channels audio output

Open DoosC opened this issue 11 years ago • 17 comments

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).

DoosC avatar Mar 27 '14 21:03 DoosC

+1

grammoboy2 avatar Mar 27 '14 22:03 grammoboy2

Implemented

Sti2nd avatar Jan 31 '15 00:01 Sti2nd

What is this request about? How was it implemented?

badosu avatar Jan 31 '15 00:01 badosu

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

Sti2nd avatar Jan 31 '15 01:01 Sti2nd

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

badosu avatar Jan 31 '15 01:01 badosu

It is about sending signals from LMMS to other programs.

Sti2nd avatar Jan 31 '15 01:01 Sti2nd

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.

badosu avatar Jan 31 '15 01:01 badosu

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

DoosC avatar Jan 31 '15 17:01 DoosC

@DoosC Yes, thanks!

badosu avatar Jan 31 '15 20:01 badosu

What about the FX-mixer outputs? 31 sty 2015 02:15 "Amadeus Folego" [email protected] 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.

unfa avatar Feb 04 '15 21:02 unfa

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.

badosu avatar Feb 04 '15 21:02 badosu

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:

DoosC avatar Feb 05 '15 21:02 DoosC

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

badosu avatar Feb 07 '15 15:02 badosu

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];
 			}
 		}
 	}

PhysSong avatar Apr 23 '19 13:04 PhysSong

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

fogti avatar Dec 11 '20 20:12 fogti

What's the status of this ticket ?

luzpaz avatar Jul 01 '23 02:07 luzpaz

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.

netzgestaltung avatar May 11 '24 10:05 netzgestaltung