midi to control volume, change title in amarok

What other apps and distros do you use to round out your studio?

Moderators: MattKingUSA, khz

User avatar
Capoeira
Established Member
Posts: 1321
Joined: Tue May 12, 2009 1:01 pm
Location: Brazil
Has thanked: 3 times
Been thanked: 2 times

midi to control volume, change title in amarok

Post by Capoeira »

trying to find a way to use midi to control volume, change title, ect in amarok as here: http://ubuntuforums.org/showthread.php? ... ost7472310

perhaps it is possible to control amarok with jack-transport? since it is possible to control jack-transport with midi. (with jackctlmmc: http://sourceforge.net/project/showf...roup_id=245788)
said here that almost every jack-client can be jack-transport-client: http://jackaudio.org/files/docs/html/tr ... ortclients
User avatar
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

Post by spm_gl »

A friend made a custom version of jackctlmmc for me, which works with any midi cc (if you edit the source). I needed it to be able to control jack with a jl cooper cuepoint. So if you can get amarok to listen to jack transport, you can control it through midi. Only the transport state though, not the volume.
--- Spreemusik ---
Jan Fuchsmann, Audio Engineer
Check our blog at http://www.spreemusik.com/blog
User avatar
Capoeira
Established Member
Posts: 1321
Joined: Tue May 12, 2009 1:01 pm
Location: Brazil
Has thanked: 3 times
Been thanked: 2 times

Re: midi to control volume, change title in amarok

Post by Capoeira »

ohh, till learning about MIDI, CC, MTC, MMC, ect.

didn't realized that a my midi-controler doesn't send MMC-comands, doesn't it? so it would have realy to be with CC-command.
thinking it over, amarok doesn't even appear corectly in jackctrl, xine appears only during playback. perhaps this is impossible without change in amarok source-code!?
brummer

Re: midi to control volume, change title in amarok

Post by brummer »

there is MidiKinesis out there, dont know about the state, I dont use it, but maybee it could help for your setup.
http://www.sci.ccny.cuny.edu/~brinkman/ ... dikinesis/
User avatar
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

Post by spm_gl »

Perhaps try http://aqualung.factorial.hu/ Don't think it supports midi control natively, but it does have command-line control, so you only need a small program that converts midi cc's into console commands. I've seen something along those lines somewhere, but can't remember where.
Oh, volume control ist easier through a midi-controlled mixer.
--- Spreemusik ---
Jan Fuchsmann, Audio Engineer
Check our blog at http://www.spreemusik.com/blog
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: midi to control volume, change title in amarok

Post by raboof »

Capoeira wrote:trying to find a way to use midi to control volume, change title, etc in amarok
Exactly what do you want to be able to control?

Recent versions of Amarok can be remote-controlled though qdbus(viewer). Use qdbusviewer to see which commands are available, then call them from the command-line something like this:

Code: Select all

qdbus org.kde.amarok /Player VolumeSet 10
Now you want to trigger that command from your midi controller. What MIDI messages does it emit? I'm guessing CC7. Now all you need (as spm_gl mentioned) is a way to trigger the command above based on the midi stream. A quick google didn't turn up much yet - anyone? :)
Last edited by raboof on Wed Jun 17, 2009 9:43 pm, edited 1 time in total.
User avatar
Capoeira
Established Member
Posts: 1321
Joined: Tue May 12, 2009 1:01 pm
Location: Brazil
Has thanked: 3 times
Been thanked: 2 times

Re: midi to control volume, change title in amarok

Post by Capoeira »

raboof wrote: Exactly what do you want to be able to control?

well, the basic functions: volume, play, stop, forward/back track, rewind/fforward

raboof wrote:
Recent versions of Amarok can be remote-controlled though qdbus(viewer). Use qdbusviewer to see which commands are available, then call them from the command-line something like this:

Code: Select all

qdbus org.kde.amarok /Player VolumeSet 10
Now you want to trigger that command from your midi controller.
will have a look at this

raboof wrote:What MIDI messages does it emit? I'm guessing CC7.

yes CC7, but I have 19 knobs,buttons and a fader for those i can individualy assign CC-Numbers



thanks for giving a first direction of a perhaps-solution.
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: midi to control volume, change title in amarok

Post by raboof »

raboof wrote:

Code: Select all

qdbus org.kde.amarok /Player VolumeSet 10
Now you want to trigger that command from your midi controller.
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;

while (<STDIN>)
{
        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

aseqdump | perl scriptfilename.pl
User avatar
Capoeira
Established Member
Posts: 1321
Joined: Tue May 12, 2009 1:01 pm
Location: Brazil
Has thanked: 3 times
Been thanked: 2 times

Re: midi to control volume, change title in amarok

Post by Capoeira »

nice, tomorrow i will try to understand this, and try it out

could even result in an amarok-sript, coulden't it? could even result in an amarok-sript, coulden't it? http://amarok.kde.org/wiki/Development/ ... _HowTo_2.0
Last edited by Capoeira on Thu Jun 18, 2009 12:55 am, edited 1 time in total.
User avatar
Capoeira
Established Member
Posts: 1321
Joined: Tue May 12, 2009 1:01 pm
Location: Brazil
Has thanked: 3 times
Been thanked: 2 times

Re: midi to control volume, change title in amarok

Post by Capoeira »

ooo, here in my 64studio 3.0 beta (based on hardy ubuntu) i have to install dozens of pakages to install amarok2 from ppa-repositries. i don't know if i'll install this.

could this work with dcop too (Amarok1)?
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: midi to control volume, change title in amarok

Post by raboof »

Capoeira wrote:could this work with dcop too (Amarok1)?
Sure, just replace '`qdbus org.kde.amarok /Player VolumeSet $volume` with something like `dcop amarok player setVolume $volume` (untested).
User avatar
Capoeira
Established Member
Posts: 1321
Joined: Tue May 12, 2009 1:01 pm
Location: Brazil
Has thanked: 3 times
Been thanked: 2 times

Re: midi to control volume, change title in amarok

Post by Capoeira »

spm_gl wrote:A friend made a custom version of jackctlmmc for me, which works with any midi cc (if you edit the source). I needed it to be able to control jack with a jl cooper cuepoint.
this thread could become more interesting - there is a pakage called jackdbus, would be more easy to for controling jack!?
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: midi to control volume, change title in amarok

Post by raboof »

Capoeira wrote:this thread could become more interesting - there is a pakage called jackdbus, would be more easy to for controling jack!?
Why would you want to control jack?

If you just want to control amarok, it'd be much easier to just control amarok, instead of controlling jack and having jack control amarok.
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: midi to control volume, change title in amarok

Post by raboof »

Capoeira wrote:could even result in an amarok-sript, coulden't it? http://amarok.kde.org/wiki/Development/ ... _HowTo_2.0
Not sure what you mean here?
User avatar
Capoeira
Established Member
Posts: 1321
Joined: Tue May 12, 2009 1:01 pm
Location: Brazil
Has thanked: 3 times
Been thanked: 2 times

Re: midi to control volume, change title in amarok

Post by Capoeira »

raboof wrote:
Capoeira wrote:this thread could become more interesting - there is a pakage called jackdbus, would be more easy to for controling jack!?
Why would you want to control jack?
me not, but spm_gl f.e. is controling jack via midi

raboof wrote: Not sure what you mean here?
one could make a script for amarok out of this, but wouldn't be interesting for much people though.




can't test the dcop-thing now but here is a list of other dbus-functions for amarok2:
amarok2 wrote: #play:
dbus-send --type=method_call --dest=org.kde.amarok /Player org.freedesktop.MediaPlayer.Play

#pause:
dbus-send --type=method_call --dest=org.kde.amarok /Player org.freedesktop.MediaPlayer.Pause

#next title:
dbus-send --type=method_call --dest=org.kde.amarok /Player org.freedesktop.MediaPlayer.Next

#previous title:
dbus-send --type=method_call --dest=org.kde.amarok /Player org.freedesktop.MediaPlayer.Prev

#stop:
dbus-send --type=method_call --dest=org.kde.amarok /Player org.freedesktop.MediaPlayer.Stop

#quit:
dbus-send --type=method_call --dest=org.kde.amarok / org.freedesktop.MediaPlayer.Quit


and here for amarok1: http://amarok.kde.org/wiki/DCOP_Functions
.
.
Post Reply