SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-11-06 18:52:56

ivanovnegro
Ivan #000000
From: unstable madness
Registered: 2011-06-02
Posts: 5,423

Little MOC how-to

As suggested I will make here a little MOC how-to if someone is interested and does not have the time to hunt for it.

I think all #!'ers know what MOC is. In reality it is really easy to set up, the problem is that the infos on the home page are somehow old/outdated. So I will take the time to write my little how-to. Bear with me, it is my first one. wink

First of all, I really like this little CLI music program, it does everything you want, and more important it has out of the box gapless playback, you can use an EQ and you can set up also LastFM. The most used codecs are supported, just Ape does not work but maybe in the future. The app is still under development not as active but many users contribute patches etc.

I will speak of the actual MOC version from the Debian Testing repositories as I am on Wheezy, not sure if some patches are not working yet from the Stable repository.

First of all we will install the app with of course:

apt-get install moc

Then we will also install if needed the ffmpeg plugin:

apt-get install moc-ffmpeg-plugin

To configure MOC properly or to your likings we will need a MOC config, first start MOC with the command:

mocp

Now you can pull the config into your home folder with:

cd ~/.moc && cp /usr/share/doc/moc/examples/config.example.gz ./ && gunzip config.example.gz && mv config.example config 

Now we can begin to edit the config file with your preferred text editor.
You can see already some things you can change but I will speak about the most important.

First of all, if you want that MOC starts with your music directory you have to go to this section:

#MusicDir               = "/home/joe/music"

and change it with your music path, in my case as an example as my music is on an external drive:

MusicDir               = "/media/David Extern/Música"

Now change this line to look like this:

StartInMusicDir         = yes

Now when you start MOC it will open straight into your music directory of choice, with the keystroke m you can always go directly back to your music directory.

With q you can close MOC, open it again and it should be set up with your music directory. With Q you can also shutting down the whole service, as MOC runs also as a server.

With T
you can select some default themes, I prefer to use another one. That is also easy, just create a /themes folder in your /.moc directory, choose a text editor and create a file. I went the easy path and decided to take the theme of @rhowaldt as it fits well with my Xfce Greybird theme:

# Thank you Gutterslob & pvsage from #! forums!
# Example color theme for MOC.
# You can use a theme by copying it to ~/.moc/themes directory and using
# Theme config option or -T command line option.
#
# Fill free to make your own themes and send me them. It will be included in
# official MOC releases or on the MOC web site.
#
# The format of this file is:
# Lines beginning with # are comments.
# Blank lines are ignored.
# Every other line is expected to be in format:
#
# ELEMENT = FOREGROUND_COLOR BACKGROUND_COLOR [ATTRIBUTE[,ATTRIBUTE,..]]
#
# or
#
# colordef COLOR = RED GREEN BLUE
#
# Where names are case insensitive.
#
# ELEMENT is an element of MOC interface. This can be:
# background         - default background for regions when nothing is displayed
# frame              - frames for windows
# window_title       - the title of the window (eg name of the current
#                      directory)
# directory          - a directory in the menu
# selected_directory - a directory that is selected using arrows
# playlist           - playlist file
# selected_playlist  - see selected directory
# file               - an ordinary file in the menu (mp3, ogg, ...)
# selected_file      - see selected directory
# marked_file        - a file that is currently being played
# marked_selected_file - a file that is currently being played and is also
#                      selected using arrows
# info               - information shown at the right side of files
# selected_info      - see selected directory
# marked_info        - a file (its time) that is currently being played
# marked_selected_info - a file (its time) that is currently being played
#                      and is also selected using arrows
# status             - the status line with a message
# title              - the title of the file that is currently being played
# state              - the state: play, stop, or paused (>, [], ||)
# current_time       - current time of playing
# time_left          - the time left to the end of playing the current file
# total_time         - the length of the currently played file
# time_total_frames  - the brackets outside the total time of a file ([10:13])
# sound_parameters   - the frequency and bitrate numbers
# legend             - "KHz" and "Kbps"
# disabled           - disabled element ([STEREO])
# enabled            - enabled element
# empty_mixer_bar    - "empty" part of the volume bar
# filled_mixer_bar   - "filled" part of the volume bar
# empty_time_bar     - "empty" part of the time bar
# filled_time_bar    - "filled" part of the time bar
# entry              - place wher user can type a search query or a file name
# entry_title        - the title of an entry
# error              - error message
# message            - information message
# plist_time         - total time of displayed items
#
# FOREGOUND_COLOR and BACKGROUND_COLOR can have one of the following values:
# black, red, green, yellow, blue, magenta, cyan, white, default (can be
# transparent), grey (not standard, but works)
#
# Optional ATTRIBUTE parameters can be (from ncurses manual):
# normal      - default (no highlight)
# standout    - best highlighting mode of the terminal
# underline   - underlining
# reverse     - reverse video
# blink       - blinking
# dim         - half bright
# bold        - extra bright or bold
# protect     - protected mode
#
# You can specify a list of attributes separated by commas: attr1,attr2,attr3.
# Don't use spaces anywhere in such a list.
#
# With colordef you can change the definition of a color. It works only if
# your terminal supports it, if not those lines will be silently ignored.
# COLOR must be a valid color name and the RED GREEN and BLUE are numbers
# from 0 to 1000. Example:
#
# colordef red = 1000 0 0
#
# HINT: you have only 8 colors, but combined with attributes bold and/or
# reversed you actually get more colors.
#
# If you don't specify some elements, the default values will be used.
#
# Replaces the default configuration:

background        = default    default
frame            = default    default
window_title        = default    default
directory        = blue    default    
selected_directory    = blue    default    reverse
playlist        = default    default
selected_playlist    = default    default    reverse
file            = default    default
selected_file        = default    default    reverse
marked_file        = blue    default   bold
marked_selected_file    = blue    default    reverse
info            = default    default
selected_info        = default    default
marked_info        = blue    default    bold
marked_selected_info    = blue    default   bold 
status            = default    default
title            = blue    default     bold    
state            = default    default   
current_time        = default    default
time_left        = default    default    
total_time        = default    default   
time_total_frames    = default    default
sound_parameters    = default    default
legend            = default    default
disabled        = default    default
enabled            = blue  default  bold
empty_mixer_bar        = default    default
filled_mixer_bar    = default    default    reverse
empty_time_bar        = default    default
filled_time_bar        = default    default    reverse
entry            = default    default
entry_title        = default    default
error            = default    default    bold
message            = default    default    bold
plist_time        = default    default

I named it blue_theme. Now it will show up in the themes selection of MOC and you can use it. You need to change again this line:

# Theme                 = example_theme

with your theme of choice and with the next start of MOC it will use your theme. You can also change the line for Xterm there.

As I am a LastFM fan I needed also this. MOC does not have LastFM build in by default, there are also some patches but I prefer the easy way. Just install lastfmsubmitd with:

apt-get install lastfmsubmitd

and follow the instructions, you will be asked to set up your account. To make it work with MOC, we have again to edit the config. You have to go to this line and make it look like mine:

OnSongChange = "/usr/lib/lastfmsubmitd/lastfmsubmit --artist %a --title %t --length %d --album %b"

Restart MOC and now it will scrobble your tracks, not as nice, as it will scrobble them immediately and not after 50 %  of the played time e.g. but it works.

The last thing for me to do was to add an EQ. The sound is not bad but I need the possibilty to manipulate it.

Create a folder and name it e.g. eqsets. Now grab some presets from here, they are from Winamp: http://moc.daper.net/node/397. Put them in your EQ folder, with E
you can enable/disable the EQ, with k you can switch through the different EQ presets. You can even make your own.

I think that's it. If you want more on MOC, just press h and it will give you all the keystrokes or look at the documentation on their site for more things. I hope you have fun with MOC.

And here a screenshot how mine looks:

Bildschirmfoto_06_11_2011_19_40_35.jpg

Bildschirmfoto_06_11_2011_19_41_04.jpg

For more themes of our community look at this thread: http://crunchbanglinux.org/forums/topic … gs-themes/.

Ah, before I forget, a nice feature is the ability to search in your directories. With g you will be prompted to a text search, just if you would use a library based audio player. Nice thing. smile

Thanks go to @rhowaldt for the awesome theme, to @Slobby who gave me tips on the EQ and to @VastOne who also helped me to find some things.

Note: When setting up LastFM, it will ask you which group to use, put there audio.

Edit: If you want to use conky with MOC, then go here.

Edit (Nov. 16 2011): I must read something wrong, there is actually no cue sheet support. Tried it, did not work. Fixed that in the how-to.

Last edited by ivanovnegro (2011-11-16 06:35:38)

Offline

Help fund CrunchBang, donate to the project!

#2 2011-11-06 19:04:43

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: Little MOC how-to

nice howto ivanovnegro, and flattered you used my theme for it. as users can see in the comments of the theme, credits pass over to gutterslob and pvsage for providing me with the basis for my theme. what i also really liked about that theme-file is that it has the full documentation at the beginning, so you always know how it works.

Offline

#3 2011-11-06 19:09:04

ivanovnegro
Ivan #000000
From: unstable madness
Registered: 2011-06-02
Posts: 5,423

Re: Little MOC how-to

^ Yes, that is why I posted it with the names of @Slobby and @pvsage.

Offline

#4 2011-11-07 13:13:44

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 10,163
Website

Re: Little MOC how-to

Very nice How To mate... Well done!


VSIDO | SolusOS

Words That Build Or Destroy

Offline

#5 2011-11-07 14:10:40

ivanovnegro
Ivan #000000
From: unstable madness
Registered: 2011-06-02
Posts: 5,423

Re: Little MOC how-to

^ Thank you. smile And I will link also to your conky scripts.

Offline

#6 2011-11-07 14:55:21

Kexolino
#! Junkie
Registered: 2011-06-13
Posts: 293

Re: Little MOC how-to

Thanks for this, it's really helpful smile I have one question though: any ideas why it is that in some folders it mixes the tracks like this:
Screenshot_MOC_play_9_Bad_Religion_Individ.jpg roll

Offline

#7 2011-11-07 15:12:24

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: Little MOC how-to

^ if i were you, i'd just move through the config-file to check if there is an option there that might be causing this and/or might prevent this. the config-file for moc is pretty well-documented (at least mine is - if yours is not i'll post mine here) so should not be that difficult.

Offline

#8 2011-11-07 15:13:58

safetycopy
urban legend
From: The Chatsubo
Registered: 2010-04-03
Posts: 1,311

Re: Little MOC how-to

^^ moc is sorting your tracks by filename (which I think is the only option). If you rename your files like '01 Title.mp3', '02 Title.mp3', etc, it should order them properly smile

Last edited by safetycopy (2011-11-07 15:14:15)


i wonder if i missed the warning
Skinny Puppy, Love in Vein

Offline

#9 2011-11-07 15:14:16

ivanovnegro
Ivan #000000
From: unstable madness
Registered: 2011-06-02
Posts: 5,423

Re: Little MOC how-to

@kexolino: Not sure, by default it is set up to order by file name rather then other thing, that is the reason why it shows up this way, it is the exact copy how it looks like from your default file browser. When you add the files to the playlist you can order them with u and j, u for up and j for down.

Last edited by ivanovnegro (2011-11-07 15:14:58)

Offline

#10 2011-11-07 15:17:46

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: Little MOC how-to

@safetycopy: that's what i thought initially, but that doesn't explain the order '3, 8, 5'. so i think it must be something else. regardless, always a good idea to use '01' instead of '1' in mp3 filenames. looks nicer smile

Offline

#11 2011-11-07 15:19:53

safetycopy
urban legend
From: The Chatsubo
Registered: 2010-04-03
Posts: 1,311

Re: Little MOC how-to

^ Look at the song names - they're in alphabetical order...

Stranger Than Fiction
Television
The Handshake


i wonder if i missed the warning
Skinny Puppy, Love in Vein

Offline

#12 2011-11-07 15:23:17

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 10,163
Website

Re: Little MOC how-to

From the MoC web site, a good explanation...

The tracks are sorted in alphanumerical order but numbers are not considered, only digits are, so the solution is to have all files in an folder follow this rule:
$some_stuff$number$whatever. All the files in the folder must start exactly by the same $some_stuff and the number must always have as much digits as the track that has the most digits (2 digits usually works fine).
For instance:
% ls Symphonie\ n.5/
1 - Symphony No.5 in C minor Op 67 - Allegro con brio.mp3
2 - Symphony No.5 in C Minor Op 67 - Andante con moto.mp3
3 - Symphony No.5 in C Minor Op 67 - Allegro.mp3
4 - Symphony No.5 in C Minor Op 67 - Allegro.mp3
or:
% ls Metallica/The\ Best\ Of/ -1
Metallica_01.wma
Metallica_02.wma
Metallica_03 - Enter Sandman .wma
Metallica_04.wma
Metallica_05 - Sad But True.wma
Metallica_06.wma
Metallica_07.wma
Metallica_08 - Holier than Thou.wma
Metallica_09.wma
Metallica_10 Piste 10.wma
Metallica_11 Piste 11.wma
Metallica_12 Piste 12.wma
Metallica_13 Piste 13.wma
Metallica_14 Piste 14.wma
Metallica_15 Piste 15.wma


VSIDO | SolusOS

Words That Build Or Destroy

Offline

#13 2011-11-07 15:49:58

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: Little MOC how-to

@safetycopy: hey, didn't notice the alphabetical order!
@VastOne: good one. this must be it.

Offline

#14 2011-11-07 16:04:06

Kexolino
#! Junkie
Registered: 2011-06-13
Posts: 293

Re: Little MOC how-to

Thanks, that's it, the song files don't have the number in their names.

Offline

#15 2011-11-07 16:27:40

kowloonboy
#! Junkie
Registered: 2011-10-13
Posts: 443

Re: Little MOC how-to

@ivanovnegro
Thanks, I was waiting for your how-to for MOC, thanks I hope I can finally get LastFM to work with my MOC.

Cheers. smile


"To me, the extraordinary aspect of martial arts lies in its simplicity. The easy way is also the right way, and martial arts is nothing at all special; the closer to the true way of martial arts, the less wastage of expression there is." - Bruce Lee

Offline

#16 2011-11-07 16:33:28

ivanovnegro
Ivan #000000
From: unstable madness
Registered: 2011-06-02
Posts: 5,423

Re: Little MOC how-to

^ Thank you also. Just follow my instructions, LastFM works perfectly.

Offline

#17 2011-11-07 16:38:13

earsplit
#! Member
Registered: 2011-11-02
Posts: 71

Re: Little MOC how-to

Thanks a lot dude! This is a great little addition to my desktop terminal... now i gotta learn how to configure awesomewm

Offline

#18 2011-11-07 17:28:41

lowrider
#! Die Hard
From: Germany
Registered: 2011-09-10
Posts: 622

Re: Little MOC how-to

ivanovnegro wrote:

^ Thank you also. Just follow my instructions, LastFM works perfectly.

Yes, works like a charm on #! or my debian netinstall. Big thank you for this howto!
I have to figure out why it doesn't on my arch install. Hmm, i set my username and pass in /etc/lastfmsubmit.conf and start the demon on boot in the rc.conf file but no success...


came for the distro, stayed for the community
streamripper :: smxi

Offline

#19 2011-11-07 18:09:00

ivanovnegro
Ivan #000000
From: unstable madness
Registered: 2011-06-02
Posts: 5,423

Re: Little MOC how-to

^ Did you add audio to the group?

Here also from the Arch Wiki. But seems you did the Arch steps already.

Offline

#20 2011-11-07 18:17:55

lowrider
#! Die Hard
From: Germany
Registered: 2011-09-10
Posts: 622

Re: Little MOC how-to

Oh, again thank you for the link to the archwiki the chmod -R 777 to /var/spool/lastfm does the trick. Everything is fine now. smile


came for the distro, stayed for the community
streamripper :: smxi

Offline

#21 2011-11-07 18:20:01

ivanovnegro
Ivan #000000
From: unstable madness
Registered: 2011-06-02
Posts: 5,423

Re: Little MOC how-to

^ Great, then enjoy, I made such a bombastic EQ, my house is exploding, will see if the neighbors will come to my door. MOC is really loud here. wink

Offline

#22 2011-11-07 18:21:52

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 10,163
Website

Re: Little MOC how-to

ivanovnegro wrote:

^ Great, then enjoy, I made such a bombastic EQ, my house is exploding, will see if the neighbors will come to my door. MOC is really loud here. wink

How about posting those EQ settings?  I would like to see them and try them against pulseaudio EQ


VSIDO | SolusOS

Words That Build Or Destroy

Offline

#23 2011-11-07 18:38:15

lowrider
#! Die Hard
From: Germany
Registered: 2011-09-10
Posts: 622

Re: Little MOC how-to

ivanovnegro wrote:

^ Great, then enjoy, I made such a bombastic EQ, my house is exploding, will see if the neighbors will come to my door. MOC is really loud here. wink

Haha, but don't take it too far. I did once in my early days on Debian Bo (i think) and X11amp (anyone remember these days?) under influence of too much booze and wimmen and the result was that the german (very unfriendly big_smile ) police take my huge speakers with them and i have to take them back the next day (when i was sober). Not much fun... Hell, yes it was Fun when i think of it. big_smile


came for the distro, stayed for the community
streamripper :: smxi

Offline

#24 2011-11-07 19:43:41

ivanovnegro
Ivan #000000
From: unstable madness
Registered: 2011-06-02
Posts: 5,423

Re: Little MOC how-to

VastOne wrote:

How about posting those EQ settings?  I would like to see them and try them against pulseaudio EQ

It is just the Techno EQ preset modified by myself, I am still tweaking it, you posted it also in the Dropbox folder. Let me make still some tests. I should open a tweak your EQs thread. smile

@lowrider: Nice story. smile

Offline

Help fund CrunchBang, donate to the project!

#25 2011-11-08 14:18:45

kowloonboy
#! Junkie
Registered: 2011-10-13
Posts: 443

Re: Little MOC how-to

Cool, I got it to work now, thanks to you mate.

How to I change the EQ? I press shift-E, then it only display either wa_Club or off.

Do I only leave one preset in that folder? or is there another way to select it?


"To me, the extraordinary aspect of martial arts lies in its simplicity. The easy way is also the right way, and martial arts is nothing at all special; the closer to the true way of martial arts, the less wastage of expression there is." - Bruce Lee

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo