You are not logged in.

#1 2011-06-19 10:00:17

rejoin
Member
Registered: 2011-06-06
Posts: 43

Soundcloud player.

Hello forum, I'm looking for a program/script, or whatever you want to call it, for soundcloud. For example you run it and it plays a random song from soundcloud, or you search for songs and play them if they exist. I have tried searching around the net and I found some apps (http://soundcloud.com/apps/category/discover-listen) from the soundcloud website, but I'm looking for something lightweight, like a mocp integration. I would love some input.
Cheers smile

Offline

#2 2011-06-19 10:50:04

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: Soundcloud player.

Writing one could be fun! http://developers.soundcloud.com/docs/api


neutral

Offline

#3 2011-06-19 11:30:29

rejoin
Member
Registered: 2011-06-06
Posts: 43

Re: Soundcloud player.

Sure it will, but I don't have any programming knowledge. sad

Offline

#4 2011-06-24 10:12:20

rejoin
Member
Registered: 2011-06-06
Posts: 43

Re: Soundcloud player.

Bump.

Offline

#5 2011-08-06 14:48:11

kulpae
Member
From: Bremen
Registered: 2010-02-06
Posts: 34

Re: Soundcloud player.

Hello guys,
take a look here:
https://github.com/kulpae/cloudruby

I wrote it in ruby. It uses ncurses to show an user interface in a terminal emulator and plays it with mpg123.
Install all the requirements:

sudo pacman -S ruby mpg123 ncurses
sudo gem install rbcurse --pre
sudo gem install ncurses 

if the last step fails, do this:

wget http://github.com/downloads/rkumar/rbcurse/ncurses-1.2.4.gem
sudo gem install --local ncurses-1.2.4.gem

Then open it with

cloudruby

or

cloudruby "my favorite artist or genre" 

Please report any bugs, so I can fix them.
cheers, kulpae

Offline

#6 2011-08-06 16:02:44

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Soundcloud player.

Why soundcloud, if you want to just listen to music?  Why not the dozens of free actual internet radio services?  Grooveshark, Pandora and Last.FM have client available for Linux, and all these sites do is play the music you want to hear.

Offline

#7 2011-08-06 18:44:23

rejoin
Member
Registered: 2011-06-06
Posts: 43

Re: Soundcloud player.

@kulpae Thanks a lot, will try it out!

@ANOKNUSA Well, i quite like the music uploaded to soundcloud and last.fm gives me a trial when i register, like 24 hours of playing or so. Haven't looked into the other you've mentioned, but i will check them.

Offline

#8 2011-08-06 18:58:09

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Soundcloud player.

Great stuff! I'll create a PKGBUILD and put it in the AUR if you don't mind. I've been looking for a software like that, because there's a lot on soundcloud I'd like to listen to, but it doesn't really work well here in the browser.

Offline

#9 2011-08-06 19:28:53

kulpae
Member
From: Bremen
Registered: 2010-02-06
Posts: 34

Re: Soundcloud player.

yeah of course wink

I'm planing to improve it, so that it'll show the playlist. Maybe it'll also shuffle the playlist and play it continuously, so that it's possible to go to the previously played track...

Offline

#10 2011-08-07 10:45:11

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Soundcloud player.

Ok, I'll have to ask here first, because I've never created a PKGBUILD for a ruby package, especially this gem stuff is something I don't know much about.
Here's my prototype
PKGBUILD

# Maintainer: Army <uli armbruster who uses the google mail service>

pkgname=cloudruby-git
pkgver=20110807
pkgrel=1
pkgdesc=""
arch=('i686' 'x86_64')
url="https://github.com/kulpae/cloudruby"
license=(custom)
depends=('ruby')
makedepends=('git')
provides=('cloudruby')
conflicts=('cloudruby')
source=(https://github.com/downloads/rkumar/rbcurse/ncurses-1.2.4.gem sh)

_gitroot="https://github.com/kulpae/cloudruby.git"
_gitname="cloudruby"

build() {
    cd "$srcdir"
    msg "Connecting to GIT server...."
    
    if [ -d ${_gitname} ] ; then
        cd ${_gitname} && git pull origin
        msg "The local files are updated."
    else
        git clone ${_gitroot} ${_gitname}
    fi
    msg "GIT checkout done or server timeout"
    msg "Starting make..."

    rm -rf "${srcdir}/${_gitname}-build"
    cp -a "${srcdir}/${_gitname}" "${srcdir}/${_gitname}-build"

    ln -s "${srcdir}/ncurses-1.2.4.gem" "${srcdir}/${_gitname}-build/ncurses-1.2.4.gem"
}

package() {
    cd "${srcdir}/${_gitname}-build"

    local _gemdir="$(ruby -rubygems -e'puts Gem.default_dir')"
    gem install -i "$pkgdir$_gemdir" rbcurse --pre
    gem install -i "$pkgdir$_gemdir" ncurses

    install -Dm755 "${srcdir}/sh" "${pkgdir}/usr/bin/${_gitname}"
    install -Dm755 "${_gitname}" "${pkgdir}/opt/${_gitname}/${_gitname}"
    install -Dm644 "mpg123player.rb" "${pkgdir}/opt/${_gitname}/mpg123player.rb"
    install -Dm644 "ncurses_ui.rb" "${pkgdir}/opt/${_gitname}/ncurses_ui.rb"
    install -Dm644 "soundcloud.rb" "${pkgdir}/opt/${_gitname}/soundcloud.rb"
    # license
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
}
md5sums=('2a64363e453731a268d98440e3e03177'
         '3503e26a3c31b7521ffec60485c03df9')

sh

#!/bin/sh
cd /opt/cloudruby
./cloudruby

I guess this PKGBUILD is crap, because instead of building that ncurses stuff I'd better use them as dependencies. There is a package ruby-ncurses in the AUR, but it doesn't work with that one.

kulpae, I have a first feature request:

cloudruby http://soundcloud.com/iambulb/jetpacks-was-yes-slow

It would be awesome if it was possible, that cloudruby then plays that file. Would be perfect for scripting.

Offline

#11 2011-08-07 13:09:43

kulpae
Member
From: Bremen
Registered: 2010-02-06
Posts: 34

Re: Soundcloud player.

right... ncurses is pretty buggy with ruby 1.9 now, so only this locally installed gem works on my system (x86_64)...
and it's better to install with "gem install -i" I suppose, because it also supports RVM.
As far as I know ruby-ncurses installs to system lib folder, so RVM won't find it, as RVM saves the gems in ~/.rvm/gems/${ruby-version}@${gemset}/gems/...
this stuff with RVM makes it much more complicated... maybe we should start it with the system's ruby, then ruby-ncurses will suffice, if it'll compile wink

regarding the feature request,
I'll first allow this:
cloudruby iambulb/jetpacks-was-yes-slow
then I'll parse the url to this notation. Yepp, doable wink

edit: this now works: (thanks to /resolve api)

cloudruby http://soundcloud.com/iambulb/jetpacks-was-yes-slow

Last edited by kulpae (2011-08-07 14:07:54)

Offline

#12 2011-08-07 14:32:51

kulpae
Member
From: Bremen
Registered: 2010-02-06
Posts: 34

Re: Soundcloud player.

ruby-ncurses is stil lbugy and throws this error:

undefined symbol: STR2CSTR

maybe we can help them fixing it...

I found a fix for it (here)
and tried it and it works!
All I'm doing is the same ruby-ncurses from AUR is doing, except I apply some changes before `make`.

I already wrote a comment on ruby-ncurses AUR site, so hopefully the maintainer will adapt it. If he will, then we can use ruby-ncurses as a dependency.

cheers, kulpae

Last edited by kulpae (2011-08-07 16:13:28)

Offline

#13 2011-08-07 16:26:42

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Soundcloud player.

Ok, will it then be enough to install the files into /opt ?
By the way, I tried cloudruby http://soundcloud.com/iambulb/jetpacks-was-yes-slow but other tracks are being played.

Offline

#14 2011-08-07 16:34:21

kulpae
Member
From: Bremen
Registered: 2010-02-06
Posts: 34

Re: Soundcloud player.

Army wrote:

Ok, will it then be enough to install the files into /opt ?

rbcurse is still required... but I'll try to get rid of this dependancy and do all the ncurses stuff by myself...

Army wrote:

By the way, I tried cloudruby http://soundcloud.com/iambulb/jetpacks-was-yes-slow but other tracks are being played.

forgot `git pull origin master`?
if not, then it's weird sad
if I try the same command as you, it plays the correct track...

Last edited by kulpae (2011-08-07 16:51:25)

Offline

#15 2011-08-07 17:12:39

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Soundcloud player.

Yes I'm on the most up to date snapshot. But cloudruby behaves as if there was no argument at all.

Could you try it with my PKGBUILD? It's in the AUR

Offline

#16 2011-08-07 17:33:17

kulpae
Member
From: Bremen
Registered: 2010-02-06
Posts: 34

Re: Soundcloud player.

easy to fix:
in the file `sh`

#!/bin/sh
cd /opt/cloudruby
./cloudruby $*

and if we want to make it unaffected by RVM, this version is better:

#!/bin/sh
cd /opt/cloudruby
/usr/bin/ruby cloudruby $*

Offline

#17 2011-08-07 17:51:33

kulpae
Member
From: Bremen
Registered: 2010-02-06
Posts: 34

Re: Soundcloud player.

oh, I think $* is not correct, though it works mostly... better to replace it with $@

Offline

#18 2011-08-07 18:05:55

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Soundcloud player.

Damn, I'm so stupid!!!!! Thanks!

Offline

#19 2011-08-07 22:53:00

kulpae
Member
From: Bremen
Registered: 2010-02-06
Posts: 34

Re: Soundcloud player.

new update!
new feature: with the key `p` you can go to previously played track!

also got rid of the rbcurse gem, the ui changed the look a little in the process...
another nice side effect: the cpu load dropped significantly.

cheers, kulpae

Last edited by kulpae (2011-08-07 22:57:37)

Offline

#20 2011-08-08 07:44:19

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Soundcloud player.

Great! I'll update my PKGBUILD.

Offline

#21 2011-08-11 22:23:21

kulpae
Member
From: Bremen
Registered: 2010-02-06
Posts: 34

Re: Soundcloud player.

new update!

  • Added a playlist widget.

  • Fixed resize bug.

Screenshot:
cloudruby-%2525237767fc4.png

Last edited by kulpae (2011-08-13 19:26:39)

Offline

#22 2011-08-11 23:05:42

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Soundcloud player.

Very nice Alter! But seems like cloudruby doesn't play the most recent files anymore if it gets no argument. Is this intended?

Offline

#23 2011-08-11 23:19:20

kulpae
Member
From: Bremen
Registered: 2010-02-06
Posts: 34

Re: Soundcloud player.

it does!
Before playing the tracks, cloudruby shuffles the playlist...
I'll implement a `--no-shuffle` argument later, so we have an option to avoid it.

cheers, Paul

Offline

#24 2011-08-12 07:54:23

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Soundcloud player.

Ok, I guess this was caused by the bad internet connectivity I had for a few moments yesterday. Now it works again. Sorry for the false alarm wink

Offline

#25 2011-08-16 23:21:56

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Soundcloud player.

What about the ability to download the files?

Offline

Board footer

Powered by FluxBB