Simple, my controller has a wonderful shuttle wheel, which doensn't work in ardour, but now I can smoothly scroll the timeline of all jack-transport enabled programs (especially xjadeo) together, which is perfect for video sync work.raboof wrote: Why would you want to control jack?
midi to control volume, change title in amarok
Moderators: MattKingUSA, khz
- spm_gl
- Established Member
- Posts: 358
- Joined: Wed Apr 22, 2009 7:58 am
- Location: Spreewald, Germany
- Contact:
Re: midi to control volume, change title in amarok
- raboof
- Established Member
- Posts: 1865
- Joined: Tue Apr 08, 2008 11:58 am
- Location: Deventer, NL
- Has thanked: 52 times
- Been thanked: 80 times
- Contact:
Re: midi to control volume, change title in amarok
Oh yes, jack transport is definitely usefulspm_gl wrote:Simple, my controller has a wonderful shuttle wheel, which doensn't work in ardour, but now I can smoothly scroll the timeline of all jack-transport enabled programs (especially xjadeo) together, which is perfect for video sync work.raboof wrote:Why would you want to control jack?
- raboof
- Established Member
- Posts: 1865
- Joined: Tue Apr 08, 2008 11:58 am
- Location: Deventer, NL
- Has thanked: 52 times
- Been thanked: 80 times
- Contact:
Re: midi to control volume, change title in amarok
Hmm, I found out that on some systems, this would introduce some unwanted buffering. The following version solves this, and requires aseqdump and IO::Pty (packaged as libio-pty-perl on debian):raboof wrote:I found 'aseqdump' for dumping ALSA midi data to stdout. With that, it's quite easy to whip together a small script that translates midi events into qdbus calls
Code: Select all
#!/usr/bin/perl
use strict;
use IO::Pty;
use IPC::Open2;
my $pty = IO::Pty->new;
open2(">&" . fileno($pty), my $in, "aseqdump");
my $s = $pty->slave;
while (<$s>)
{
print $_;
if ($_ =~ /controller 7, value (\d+)/)
{
my $ccValue = $1;
my $volume = int($ccValue * 100 / 127);
print "Setting volume to $volume\n";
`qdbus org.kde.amarok /Player VolumeSet $volume`
}
}.. then start it with:
Code: Select all
./scriptfilename.pl