FrancescoCeruti / linux-show-player

Linux Show Player - Cue player designed for stage productions
https://linux-show-player.org
GNU General Public License v3.0
211 stars 49 forks source link

Display volume fader next to media cues #10

Closed nodiscc closed 8 years ago

nodiscc commented 8 years ago

Hi, currently there is no way to adjust the volume of a playing cue, except using a Volume control action cue linked to it (which currently only fades out/in at a preset volume/time) - or manually in Edit options > Media settings > Volume > OK.

Can you consider one of the following improvements:

There might be another way to do this, using eg. Collection cues but I was not able to find it.

Thanks again

FrancescoCeruti commented 8 years ago

Actually the Volume control cue will probably be removed in favor to a generic Fade cue.

I think that, while a Fade cue that allow multiple target is "simpler" to use, to avoid similar an too complex components it's probably better to combine more Fade cue using a Collection.

nodiscc commented 8 years ago

it's probably better to combine more Fade cue using a Collection.

Yes this works great.

Volume control cue will probably be removed in favor to a generic Fade cue

Great also

Is there a way to adjust the volume for each Media cue directly from a slider in the main view? Or do I have to Edit options > Media settings > Volume > OK.?

FrancescoCeruti commented 8 years ago

Currently there is no way to change the volume directly in the CartLayout.

A possible way is to do something that looks like the seek-bar, probably exclusive with this one, what do you think?

schermata da 2016-03-01 17-40-06

nodiscc commented 8 years ago

A possible way is to do something that looks like the seek-bar

Yes! An horizontal or vertical slider like the seek bar would do the trick (though vertical would make more sense, since volume faders tend to be vertical. But either works for me).

FrancescoCeruti commented 8 years ago

@nodiscc let me know how it works

nodiscc commented 8 years ago

Sorry for the delay. I will test ASAP.

FrancescoCeruti commented 8 years ago

@nodiscc Hi, if you can confirm that it works as expected, now I can move on the 0.4 release

Thanks :)

nodiscc commented 8 years ago

Ok, I am trying to build the latest version but can't get it to compile because of missing files:

$ pip3 install --pre .
Processing /home/bsp/tmp/linux-show-player
Requirement already satisfied (use --upgrade to upgrade): sortedcontainers in /usr/lib/python3/dist-packages (from linux-show-player===0.4)
Requirement already satisfied (use --upgrade to upgrade): mido in /usr/local/lib/python3.5/dist-packages (from linux-show-player===0.4)
Collecting python-rtmidi (from linux-show-player===0.4)
  Using cached python-rtmidi-0.5b1.zip
Collecting JACK-Client (from linux-show-player===0.4)
  Using cached JACK_Client-0.4.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): CFFI in /usr/lib/python3/dist-packages (from JACK-Client->linux-show-player===0.4)
Building wheels for collected packages: linux-show-player, python-rtmidi
  Running setup.py bdist_wheel for linux-show-player ... done
  Stored in directory: /root/.cache/pip/wheels/4e/66/b6/76b04a8886ba153eb2eff3b1be5fb3eead240b36270828dbc4
  Running setup.py bdist_wheel for python-rtmidi ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8rk2q8f1/python-rtmidi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmphn3j334apip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.5
  creating build/lib.linux-x86_64-3.5/rtmidi
  copying rtmidi/midiconstants.py -> build/lib.linux-x86_64-3.5/rtmidi
  copying rtmidi/midiutil.py -> build/lib.linux-x86_64-3.5/rtmidi
  copying rtmidi/__init__.py -> build/lib.linux-x86_64-3.5/rtmidi
  copying rtmidi/release.py -> build/lib.linux-x86_64-3.5/rtmidi
  creating build/lib.linux-x86_64-3.5/osc2midi
  copying examples/osc2midi/device.py -> build/lib.linux-x86_64-3.5/osc2midi
  copying examples/osc2midi/midiio.py -> build/lib.linux-x86_64-3.5/osc2midi
  copying examples/osc2midi/__init__.py -> build/lib.linux-x86_64-3.5/osc2midi
  copying examples/osc2midi/oscdispatcher.py -> build/lib.linux-x86_64-3.5/osc2midi
  copying examples/osc2midi/lru_cache.py -> build/lib.linux-x86_64-3.5/osc2midi
  copying examples/osc2midi/midievents.py -> build/lib.linux-x86_64-3.5/osc2midi
  copying examples/osc2midi/main.py -> build/lib.linux-x86_64-3.5/osc2midi
  running build_ext
  building 'rtmidi._rtmidi' extension
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -D__PYX_FORCE_INIT_THREADS -D__LINUX_ALSA__ -D__UNIX_JACK__ -Isrc -I/usr/include/python3.5m -c src/_rtmidi.cpp -o build/temp.linux-x86_64-3.5/src/_rtmidi.o
  cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
  src/_rtmidi.cpp:4:20: fatal error: Python.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for python-rtmidi
  Running setup.py clean for python-rtmidi
Successfully built linux-show-player
Failed to build python-rtmidi
Installing collected packages: python-rtmidi, JACK-Client, linux-show-player
  Running setup.py install for python-rtmidi ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8rk2q8f1/python-rtmidi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-4jqfw_4p-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/rtmidi
    copying rtmidi/midiconstants.py -> build/lib.linux-x86_64-3.5/rtmidi
    copying rtmidi/midiutil.py -> build/lib.linux-x86_64-3.5/rtmidi
    copying rtmidi/__init__.py -> build/lib.linux-x86_64-3.5/rtmidi
    copying rtmidi/release.py -> build/lib.linux-x86_64-3.5/rtmidi
    creating build/lib.linux-x86_64-3.5/osc2midi
    copying examples/osc2midi/device.py -> build/lib.linux-x86_64-3.5/osc2midi
    copying examples/osc2midi/midiio.py -> build/lib.linux-x86_64-3.5/osc2midi
    copying examples/osc2midi/__init__.py -> build/lib.linux-x86_64-3.5/osc2midi
    copying examples/osc2midi/oscdispatcher.py -> build/lib.linux-x86_64-3.5/osc2midi
    copying examples/osc2midi/lru_cache.py -> build/lib.linux-x86_64-3.5/osc2midi
    copying examples/osc2midi/midievents.py -> build/lib.linux-x86_64-3.5/osc2midi
    copying examples/osc2midi/main.py -> build/lib.linux-x86_64-3.5/osc2midi
    running build_ext
    building 'rtmidi._rtmidi' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -D__PYX_FORCE_INIT_THREADS -D__LINUX_ALSA__ -D__UNIX_JACK__ -Isrc -I/usr/include/python3.5m -c src/_rtmidi.cpp -o build/temp.linux-x86_64-3.5/src/_rtmidi.o
    cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
    src/_rtmidi.cpp:4:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8rk2q8f1/python-rtmidi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-4jqfw_4p-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-8rk2q8f1/python-rtmidi/

-> src/_rtmidi.cpp:4:20: fatal error: Python.h: No such file or directory

I have installed all development packages related to rtmidi:

libportmidi-dev - library for real-time MIDI input/output
libportmidi0 - library for real-time MIDI input/output
python-pypm - Python interface to libportmidi
librtmidi-dbg - C++ library for realtime MIDI input/ouput (debugging symbols)
librtmidi-dev - C++ library for realtime MIDI input/ouput (development files)
librtmidi2v5 - C++ library for realtime MIDI input/ouput

@FrancescoCeruti any clue why this happens?

FrancescoCeruti commented 8 years ago

Looks like you miss the python headers, on debian the python-dev package should fix the problem

nodiscc commented 8 years ago

Yay it works!

(With a popup warning on start:)

ERROR:: Failed "Midi" lading
Details: Backend loading failed: mido.backends.rtmidi

I will update the documentation for required packages and send a Pull Request.

The new volume control is great, thanks! Huge step forward in usability

cap1

Only minor remarks:

I like that the control is able to decrease or boost the volume (will be useful for samples recorded with low level), however there's no easy way to find the middle point back. I had a sample at 0dB, decreased the volume; when trying to set it back to normal it started clipping as soon as I passed the middle point. Possible solutions:

Another minor problem is the curve of volume changes. Put the volume all the way down, increase by a single step (1 pixel up), the bump in volume (from mute to minimum) is very noticeable. Do you use a log scale for volume changes? Or is it linear

Thanks again for your work

FrancescoCeruti commented 8 years ago

I've added markers every 50% volume on the slider, and now should works when using the mouse wheel to move it. The increase/decrease is linear from 0% to 200%, the minimum change is 1%, if you need a better change the volume-change cue is your best options (for the problem below).

A problem I've noticed is that sometimes the volume remain stuck on a value for a moment (especially during fast movements) and this cause a bump, I think that's something out of my control but I'll try to investigate on it.

FrancescoCeruti commented 8 years ago

@nodiscc now the sliders goes from 0dB to -100dB, let me know if you think they work better this way. The only drawback is that when the cue volume is set with a > 0dB value the first step down will be more considerable.

nodiscc commented 8 years ago

Will test ASAP

FrancescoCeruti commented 8 years ago

@nodiscc have you tested it? In the 0.4 version I've included the last (-100db to 0db) version.

If other changes are needed (and feasible) I'll move the issues in the 0.4.1 millstone, thanks :)

nodiscc commented 8 years ago

Hi @FrancescoCeruti I've just been playing with the latest changes.

As an example, the kind of volume fader curve that I expect, can be found on most mixing consoles (eg. take a look at the DM1000 faders. Notice that

So if you happen to implement the following, it would be a damn fine fader!

:+1:

FrancescoCeruti commented 8 years ago

Logarithmic curve Allows for a +10dB boost

Actually it's some kind of logarithmic, probably you are looking for something like this? http://forum.cockos.com/showpost.php?s=012b5bf782c8aaaf09eb03cac04d251a&p=580744&postcount=2

Fader value should not replace, but sum with the Cue volume property defined in Edit cue (Cue volume +12dB, Fade level -10dB = Cue plays at +2dB). This would fix the problem you were talking about.

This can be solved by using the same value range.

Maybe stopping the cue should not reset the fader value to 0? I don't know but this is fine for now.

The "live" widget, controls the property in a different way (the same as the VolumeControl cue), this allow to have a slightly faster response, and I believe it's more functional with this kind of behaviour.

nodiscc commented 8 years ago

http://forum.cockos.com/showpost.php?s=012b5bf782c8aaaf09eb03cac04d251a&p=580744&postcount=2

Yes this is what I meant

faders

(the 10th value should probably be closer to -144dB which is the dynamic range of 24-bit data. Or if -inf is actually possible this would be even better - "real" mute). I had no idea common desk faders did not use a really logarithmic curve.

This can be solved by using the same value range. slightly faster response, and I believe it's more functional with this kind of behaviour.

Ok .

FrancescoCeruti commented 8 years ago

Now the curve is something like that: db

GStreamer use the linear value, so we have "real" mute: value

The CartLayout slider have a 0.001 precision.

nodiscc commented 8 years ago

Will test this soon, thank you

nodiscc commented 8 years ago

One month already, sorry for the delayyyy. @FrancescoCeruti I wanted to let you know that it works perfectly. Thanks! I have used it in a live setting (theatre cues) and mouse/keyboard control is shaping up nicely in Linux Show Player.

I will try to do some more testing, improve the documentation and share project templates soon. Props for your work on LiSP.

Fixed.