<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Generate .mood moodbar files for your whole music collection</title> <atom:link href="https://bogdan.org.ua/2011/04/10/generate-mood-moodbar-files-for-your-whole-music-collection.html/feed" rel="self" type="application/rss+xml" /><link>https://bogdan.org.ua/2011/04/10/generate-mood-moodbar-files-for-your-whole-music-collection.html</link> <description>Tiny bits of bioinformatics, [web-]programming etc</description> <lastBuildDate>Mon, 01 Jan 2024 17:12:20 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>https://wordpress.org/?v=3.8.27</generator> <item><title>By: Bogdan</title><link>https://bogdan.org.ua/2011/04/10/generate-mood-moodbar-files-for-your-whole-music-collection.html#comment-266876</link> <dc:creator><![CDATA[Bogdan]]></dc:creator> <pubDate>Mon, 18 Aug 2014 21:51:45 +0000</pubDate> <guid
isPermaLink="false">http://bogdan.org.ua/?p=1561#comment-266876</guid> <description><![CDATA[Scott,
thanks for sharing!
I think I haven&#039;t used mood files generation since I&#039;ve switched to Clementine as my primary music player and configured BitTorrent Sync of my music between 3 PCs I&#039;m using the most frequently... This setup seems to only have minor drawbacks, and lots of benefits - including in-file storage of rating, score, play and skip counts, so that every separate Clementine instance will be aware of updates made on other PCs.]]></description> <content:encoded><![CDATA[<p>Scott,<br
/> thanks for sharing!</p><p>I think I haven&#8217;t used mood files generation since I&#8217;ve switched to Clementine as my primary music player and configured BitTorrent Sync of my music between 3 PCs I&#8217;m using the most frequently&#8230; This setup seems to only have minor drawbacks, and lots of benefits &#8211; including in-file storage of rating, score, play and skip counts, so that every separate Clementine instance will be aware of updates made on other PCs.</p> ]]></content:encoded> </item> <item><title>By: Scott</title><link>https://bogdan.org.ua/2011/04/10/generate-mood-moodbar-files-for-your-whole-music-collection.html#comment-266670</link> <dc:creator><![CDATA[Scott]]></dc:creator> <pubDate>Mon, 18 Aug 2014 00:37:28 +0000</pubDate> <guid
isPermaLink="false">http://bogdan.org.ua/?p=1561#comment-266670</guid> <description><![CDATA[&lt;code&gt;
if [[ ! -e &quot;$OUTF&quot; ]] ; then
nice moodbar -o &quot;$OUTF&quot; &quot;$i&quot; &amp;&gt;/dev/null &amp;
&lt;/code&gt;
Somehow this code was not included in my previous comment. it goes just above the &quot;fi&quot; at the end of the script]]></description> <content:encoded><![CDATA[<p><code><br
/> if [[ ! -e "$OUTF" ]] ; then<br
/> nice moodbar -o "$OUTF" "$i" &amp;&gt;/dev/null &amp;<br
/> </code></p><p>Somehow this code was not included in my previous comment. it goes just above the &#8220;fi&#8221; at the end of the script</p> ]]></content:encoded> </item> <item><title>By: Scott</title><link>https://bogdan.org.ua/2011/04/10/generate-mood-moodbar-files-for-your-whole-music-collection.html#comment-266668</link> <dc:creator><![CDATA[Scott]]></dc:creator> <pubDate>Mon, 18 Aug 2014 00:27:02 +0000</pubDate> <guid
isPermaLink="false">http://bogdan.org.ua/?p=1561#comment-266668</guid> <description><![CDATA[The shell script offered on KDE.org for multi-core CPUs will peg all cores at 100% and eventually lock up the machine even without using all available RAM.  This version takes steps to avoid that problem.
&lt;code&gt;
#!/bin/bash -
# This program creates moodbar files for use with Amarok.  It is designed for
# multi-core processors, but will also run on single-core processors.  This is
# a modified version of the script offered on KDE&#039;s website.  Changes in this
# version include using $HOME/Music by default unless a different directory is
# specified on the command line, changing $NUMCPU to $NUMTHREADS, using one-
# less core than is installed in the system, and launching moodbar using nice.
# I found that the version on KDE&#039;s site pegged all 8 cores in my CPU and
# locked up my computer after a time while using very little of the 32GB of
# installed RAM.  Additionally, I included several more filename extensions to
# the regex in the find command line.
#
# This version is designed to be run from a cron job.  Mine is set up to run
# once per week.  This version also checks to ensure that moodbar is installed.
#
# On dual-core and single-core processors this program will run one instance
# of moodbar.  Effectively, only quad-core, or higher, processors will be used
# with multiple threads of execution.  Moodbar is very CPU-intensive.  Nice is
# about all that can be done to hold it back on single-core CPUs.  On dual-
# core, and higher, CPUs, one core is held in reserve for other tasks as an
# additional measure.
if ! which moodbar &amp;&gt;/dev/null; then
echo &#039;moodbar must be installed to use this program&#039;
exit 1
fi
MUSIC=${1:-$HOME/Music}
if [[ -d $MUSIC ]]; then
cd $MUSIC
else
echo &quot;$MUSIC is not a directory or does not exist&quot;
exit 1
fi
NUMTHREADS=$(( $(grep ^processor /proc/cpuinfo &#124; wc -l) - 1 ))
[[ $NUMTHREADS -gt 0 ]] &#124;&#124; NUMTHREADS=1
find . -type f -regextype posix-awk \
-iregex &#039;.*\.(wav&#124;mp3&#124;ogg&#124;oga&#124;flac&#124;fla&#124;wma&#124;aiff&#124;aac&#124;m4a)&#039; &#124; \
while read i ; do
while [[ $(jobs -p &#124; wc -l) -ge $NUMTHREADS ]] ; do
sleep 0.1
done
TEMP=&quot;${i%.*}.mood&quot;
OUTF=$(sed &#039;s#\(.*\)/\([^,]*\)#\1/.\2#&#039; &lt;&lt;/dev/null &amp;
fi
done
&lt;/code&gt;]]></description> <content:encoded><![CDATA[<p>The shell script offered on KDE.org for multi-core CPUs will peg all cores at 100% and eventually lock up the machine even without using all available RAM.  This version takes steps to avoid that problem.</p><p><code><br
/> #!/bin/bash -</p><p># This program creates moodbar files for use with Amarok.  It is designed for<br
/> # multi-core processors, but will also run on single-core processors.  This is<br
/> # a modified version of the script offered on KDE's website.  Changes in this<br
/> # version include using $HOME/Music by default unless a different directory is<br
/> # specified on the command line, changing $NUMCPU to $NUMTHREADS, using one-<br
/> # less core than is installed in the system, and launching moodbar using nice.<br
/> # I found that the version on KDE's site pegged all 8 cores in my CPU and<br
/> # locked up my computer after a time while using very little of the 32GB of<br
/> # installed RAM.  Additionally, I included several more filename extensions to<br
/> # the regex in the find command line.<br
/> #<br
/> # This version is designed to be run from a cron job.  Mine is set up to run<br
/> # once per week.  This version also checks to ensure that moodbar is installed.<br
/> #<br
/> # On dual-core and single-core processors this program will run one instance<br
/> # of moodbar.  Effectively, only quad-core, or higher, processors will be used<br
/> # with multiple threads of execution.  Moodbar is very CPU-intensive.  Nice is<br
/> # about all that can be done to hold it back on single-core CPUs.  On dual-<br
/> # core, and higher, CPUs, one core is held in reserve for other tasks as an<br
/> # additional measure.<br
/> if ! which moodbar &amp;&gt;/dev/null; then<br
/> echo 'moodbar must be installed to use this program'<br
/> exit 1<br
/> fi<br
/> MUSIC=${1:-$HOME/Music}<br
/> if [[ -d $MUSIC ]]; then<br
/> cd $MUSIC<br
/> else<br
/> echo "$MUSIC is not a directory or does not exist"<br
/> exit 1<br
/> fi<br
/> NUMTHREADS=$(( $(grep ^processor /proc/cpuinfo | wc -l) - 1 ))<br
/> [[ $NUMTHREADS -gt 0 ]] || NUMTHREADS=1<br
/> find . -type f -regextype posix-awk \<br
/> -iregex '.*\.(wav|mp3|ogg|oga|flac|fla|wma|aiff|aac|m4a)' | \<br
/> while read i ; do<br
/> while [[ $(jobs -p | wc -l) -ge $NUMTHREADS ]] ; do<br
/> sleep 0.1<br
/> done<br
/> TEMP="${i%.*}.mood"<br
/> OUTF=$(sed 's#\(.*\)/\([^,]*\)#\1/.\2#' &lt;&lt;/dev/null &amp;<br
/> fi<br
/> done<br
/> </code></p> ]]></content:encoded> </item> </channel> </rss>