openAVproductions / openAV-Luppp

Luppp is a live performance tool, created by OpenAV productions.
http://openavproductions.com/luppp
GNU General Public License v3.0
258 stars 45 forks source link

Full Stereo Processing #174

Closed harryhaaren closed 7 years ago

harryhaaren commented 7 years ago

Implement stereo audio processing from source to end of the audio chain

georgkrause commented 7 years ago

This would need a pretty well designed concept, since some users (including me) may mostly work with mono sources (gits, mics, even some (most?) synths) and i think the new panning is pretty handy. Would this get lost? Can i choose between mono and stereo? Maybe per channel? (you know, i love configuration possibilities :D)

coderkun commented 7 years ago

I mostly work with a stereo keyboard input and would love to see stereo support in luppp. But @georgkrause is right that a mono workflow must not suffer from this.

georgkrause commented 7 years ago

@coderkun sure its real stereo and not two times the same signal? i have some softsynths and one hardware synthesizer which simply output two times the same...

sub26nico commented 7 years ago

+1, I'd like to see it too

coderkun commented 7 years ago

@georgkrause, I am sure: The source is a Nord Electro 5 which hase some stereo effects etc. – it is a true stereo signal.

coderkun commented 7 years ago

Two options I can currently think of:

  1. Provide a configuration option for each channel to be either mono or stereo and adjust the inputs on the fly
  2. Provide mono and stereo input for each channel at the same time and map the mono input to the stereo input internally (using panning), using the stereo part for further processing
harryhaaren commented 7 years ago

Two options I can currently think of:

  1. Provide a configuration option for each channel to be either mono or stereo and adjust the inputs on the fly
  2. Provide mono and stereo input for each channel at the same time and map the mono input to the stereo input internally (using panning), using the stereo part for further processing

This can be done automatically by checking if the stereo port is connected in JACK, and handling the audio streams appropriately.

Another option is to just expose stereo, and demand both L and R ports need to be connected, so the user is more aware of a mono -> stereo conversion.

Either way, let's not over complicate things :) -Harry

coderkun commented 7 years ago

Is there any documentation about the signal flow? I would like to see when the mono inputs get converted into a stereo signal, when send, return and fx are applied etc. I think it would be best to see how it is currently done and line out how it will be done using (optional) stereo signals.

georgkrause commented 7 years ago

@harryhaaren i didnt missed the panning when it wasnt there but now i dont want to live without. so if connecting a mono source with the two stereo inputs still allows me to pan, i am fine with it!

harryhaaren commented 7 years ago

@coderkun nope no docs, just code, sorry. Currently, its like this:

(mono) input -> looper -> sends (Rev + JACK) -> ***pan dial / stereo convert volume/ *** => Master fader
(stereo) input => looper => sends (Rev + JACK) => pan (stereo panner, amp / delay dunno which yet) => master

Aka; stereo the whole way trough.

We can discuss this more, but really its about just getting into the code and reworking it to be stereo. Tweaking details of exactly how mono -> stereo works at the start of the chain is the icing on the cake :)

coderkun commented 7 years ago

Hey @harryhaaren, which data structure do you suggest to pass a stereo signal around (e. g. sample)? The mono signals are just one float but we would need two floats for stereo …

harryhaaren commented 7 years ago

Hi @coderkun, there are two options for dealing with stereo, either A) pass two buffers of floats (aka, one per channel), B) interleave the samples, so a single buffer is passed in, with channel A and B mixed like so : ABABABABA

coderkun commented 7 years ago

I have a full stereo chain working locally, just need fix the panning and make sure stereo files are read and written.

harryhaaren commented 7 years ago

Sounds good - file a PR when you have something you want me to look at :) Cheers

harryhaaren commented 7 years ago

Hey @coderkun - this can be marked closed right? Your PR adding stereo to the audio pipeline, so I'll close this?

coderkun commented 7 years ago

@harryhaaren, yes, please close it.

I cannot close it myself, can I?

harryhaaren commented 7 years ago

Just wanted to make sure there was no remaining "thing" you had in mind as part of this PR. Thanks again!

coderkun commented 7 years ago

Yeah, sorry, I could have been more clear on this. Thanks for merging.