PDA

View Full Version : a little mac flac help please



exile
2006-10-14, 20:53
my apologies ahead for my lack of knowledge on the subject. I've tried to search the forums for as much info as possible but I'm now stumped.

my music library lives on a mac G4 and I've made most of the library flac files by ripping my cd's in max and using the default settings for flac ripping/encoding.

I've used mediarage to organize the tagging info and to add album art. all of that has worked marvelously.

but now I've reached the point where I want all of my music to play at the same volume level and this is now becoming my mt. everest challenge.

I don't use itunes to manage my music for the obvious reason that it doesn't support flac files. so I'm forced to find alternatives for adjusting metadata info.

In mediarage, i have the ability to adjust the volume levels on each track from between -100 to +100. the default is 0. I've done that on both flac files and mp3 files. In my slimserver, I've set it to read gain values if they are present.

I've rescanned the library and there is absolutely no change whatsoever in the volume levels of the files I've changed. what in the world am I doing wrong?

on a tangent, I've worked on computers professionally (I'm a tv editor) for the past 13 years and therefore I feel like I can maneuver these damn computer thingys well enough. but when it comes to what i perceive as ridiculously simple things like adjusting the volume levels of flac files I feel as though I have just landed on planet earth and I'm tackling a computer for the first time.

a lot of it may be contributable to the fact that I'm doing all of my music management from a mac and not a pc. but even with that reality, shouldn't it be much easier to work with music files? why do I have to do so many google searches/slim forum searches just to find out how flac files work and how you adjust metadata? am I just jealous that the programmer types here find all of this insanely easy? I'm thrilled with the slimserver and squeezebox but I feel very badly for the average consumer wanting to get one of these devices set up correctly. the average joe has a helluva large learning curve to get over before the box works like it's supposed to.

thanks for any and all help.

Josh Coalson
2006-10-14, 21:28
I think the closest you can get is to automatically assign
ReplayGain tags to the FLAC files, and tell slimserver to use
them. for the assignment part, I don't know if Max does it
but you can use metaflac to automatically assign them:
http://flac.sourceforge.net/documentation.html#metaflac_shorthand_add_replay_g ain
(see also http://replaygain.org/)

Josh

David Alexander
2006-10-15, 13:06
On Sat, 14 Oct 2006 20:53:38 -0700, exile
<exile.2fpaln1160884501 (AT) no-mx (DOT) forums.slimdevices.com> wrote:

>my music library lives on a mac G4 and I've made most of the library
>flac files by ripping my cd's in max and using the default settings for
>flac ripping/encoding.
>
>but now I've reached the point where I want all of my music to play at
>the same volume level and this is now becoming my mt. everest
>challenge.

Since you have Max encoding to flac I'll assume you have the flac and
metaflac programs installed. Metaflac can calculate the replaygain
for flac files and add the tags. If you tell it to work on a group of
files it will assume those files are an album and will add album and
track gain tags at the same time. Sooo... assuming (hoping) you have
each album in it's own directory you can add replaygain tags by
changing into that directory in the terminal application and running
the command:

metaflac --add-replay-gain --preserve-modtime *.flac

I have a little script that will traverse into subdirectories and
process all the flac files. Copy the following into a file and make
it executable. The run it from the top level directory where all your
flac files are. It will apply replay gain to all the flac files in
all the subdirectories treating all files in a directory as an album.
It will recalculate and apply the values even if the files already
have RG tags so after the first run use it directly in an album
directory to process newly added albums.

#!/bin/bash
BASE="$PWD"
find "$PWD" -type d | while read dir ; do
cd "$dir"
if [ $(ls | grep "\.flac$" | wc -l) -gt 0 ]; then
echo "$(date "+%T") Processing: ${PWD#$BASE/}"
metaflac --preserve-modtime --add-replay-gain *.flac
fi
done

exile
2006-10-16, 10:05
thanks for the suggestions. I have now figured out how to apply replay gain through command line.

I wasn't able to get your script to work though unfortunately.

another newbie question: do all of my flac files need to be labeled in a unix friendly manner (i.e. - any and all gaps/punctuation replaced with an underscore.)

i noticed that my metaflac command line for replay gain will only work if my flac files are labeled in the previous manner.

also, the metaflac command line for replay gain applies album gain to tracks but it doesn't seem to apply track gain. is that correct? and will the applied replay gain be saved in the file? it seems as though on a rescan of the music folders some of the replay gain settings get blown out.

thanks again. I feel as though I'm making progress.

bill fumerola
2006-10-16, 18:44
On Sun, Oct 15, 2006 at 01:06:31PM -0700, David Alexander wrote:
> #!/bin/bash
> BASE="$PWD"
> find "$PWD" -type d | while read dir ; do
> cd "$dir"
> if [ $(ls | grep "\.flac$" | wc -l) -gt 0 ]; then
> echo "$(date "+%T") Processing: ${PWD#$BASE/}"
> metaflac --preserve-modtime --add-replay-gain *.flac
> fi
> done

this will fail with many filenames.

find . -type f -name \*.flac -print0 | \
xargs -0 metaflac --preserve-modtime --add-replaygain


-- bill

Ben Sandee
2006-10-16, 19:42
On 10/16/06, bill fumerola <billf (AT) mu (DOT) org> wrote:
>
> On Sun, Oct 15, 2006 at 01:06:31PM -0700, David Alexander wrote:
> > #!/bin/bash
> > BASE="$PWD"
> > find "$PWD" -type d | while read dir ; do
> > cd "$dir"
> > if [ $(ls | grep "\.flac$" | wc -l) -gt 0 ]; then
> > echo "$(date "+%T") Processing: ${PWD#$BASE/}"
> > metaflac --preserve-modtime --add-replay-gain *.flac
> > fi
> > done
>
> this will fail with many filenames.
>
> find . -type f -name \*.flac -print0 | \
> xargs -0 metaflac --preserve-modtime --add-replaygain


This second script will not properly calculate album gain. The first script
does that, assuming each album is in its own directory.

Ben

David Alexander
2006-10-16, 21:41
On Mon, 16 Oct 2006 18:44:44 -0700, bill fumerola <billf (AT) mu (DOT) org>
wrote:

>On Sun, Oct 15, 2006 at 01:06:31PM -0700, David Alexander wrote:
>> #!/bin/bash
>> BASE="$PWD"
>> find "$PWD" -type d | while read dir ; do
>> cd "$dir"
>> if [ $(ls | grep "\.flac$" | wc -l) -gt 0 ]; then
>> echo "$(date "+%T") Processing: ${PWD#$BASE/}"
>> metaflac --preserve-modtime --add-replay-gain *.flac
>> fi
>> done
>
>this will fail with many filenames.
>
>find . -type f -name \*.flac -print0 | \
> xargs -0 metaflac --preserve-modtime --add-replaygain


No, my script assumes you place your files one album per directory,
which I stated in the text. I have yet to see a CD with enough tracks
to overload the command line.

Mine will also calculate album gain in addition to track gain. Yours
will not.

Josh Coalson
2006-10-17, 07:52
--- exile <exile.2fs62n1161018601 (AT) no-mx (DOT) forums.slimdevices.com> wrote:
> another newbie question: do all of my flac files need to be labeled
> in
> a unix friendly manner (i.e. - any and all gaps/punctuation replaced
> with an underscore.)
>
> i noticed that my metaflac command line for replay gain will only
> work if my flac files are labeled in the previous manner.

depends, whatever shell you are using will have some way of
"quoting" special characters but sometimes it can be tricky to
get all of them. e.g. if it's just spaces you can usually use

metaflac --add-replay-gain "$path"/*.flac

but if you have double quotes in the name, you have to change
those to \"

> also, the metaflac command line for replay gain applies album gain to
> tracks but it doesn't seem to apply track gain. is that correct? and
> will the applied replay gain be saved in the file? it seems as though
> on a rescan of the music folders some of the replay gain settings get
> blown out.

both gains are saved (they are just tags); which one is applied on
playback is selectable.

Josh

David Alexander
2006-10-17, 19:29
On Mon, 16 Oct 2006 10:05:46 -0700, exile
<exile.2fs62n1161018601 (AT) no-mx (DOT) forums.slimdevices.com> wrote:

>another newbie question: do all of my flac files need to be labeled in
>a unix friendly manner (i.e. - any and all gaps/punctuation replaced
>with an underscore.)
>
>i noticed that my metaflac command line for replay gain will only work
>if my flac files are labeled in the previous manner.
>
>also, the metaflac command line for replay gain applies album gain to
>tracks but it doesn't seem to apply track gain. is that correct? and
>will the applied replay gain be saved in the file? it seems as though
>on a rescan of the music folders some of the replay gain settings get
>blown out.

On my Mac (Intel mini w/10.4) I didn't need to clean up the file
names. I have spaces and punctuation all over the place. Specifying
*.flac on the metaflac command line works just fine for me. In fact I
just now tried it on my OpenBSD server and it works fine there too.

Metaflac doesn't alter the music file with the gain info. It writes
tags to the file that have the gain values in them and it's up to the
player to apply the appropriate gain values during playback. As such,
it's possible to have multiple gain tags. If you run metaflac against
a single file it will only write out the track gain. It might also
write out an album gain tag identical to the track gain, I'm not sure.
If you run metaflac against multiple files at the same time it will
assume they are all one album and it will write both track and album
gain tags in each file.

I suggest you try out the program Tag at http://sbooth.org/Tag/ so you
can take a look at the flac tags and verify that you're getting what
you want.