: ) wonderful world ( :

the metasyntactic variable

Archive for the ‘music’ Category

split mp3 with mencoder

without comments

Update: this solution uses an .avi file as auxiliary medium, but I’d like to emphasize that your mp3 won’t be reencoded in any sense. In the other hand, the id3 information won’t survive AFAIK. All in all, this is a hack. Normally you don’t use mencoder and mplayer to split mp3 files but it’s clearly possible. If you’re looking for a command line tool with which you can split your mp3 files without reencoding, feel free to use mp3splt which is also free. (Homepage is here.)

 

Let’s say your mp3 is 1804 seconds long. You need some jpeg file (some.jpg from now on) to use as video content because mencoder works only with video files regarding the split functionality.

First, create the list of frames. The only thing you need here is a file which contains the filename of your jpeg in as many lines as seconds long your mp3 is. On Linux machines or in a Cygwin shell you can do it like this:

$ seq 1 1804 | sed 's/^.*$/some.jpg/' > listfile.txt

 

Or in a cmd.exe window (probably on Windowns):

c:\splitdir>del listfile.txt
c:\splitdir>for /l %i in (1,1,1804) do echo some.jpg >> listfile.txt

 

Let’s say your mp3 file is music.mp3:

mencoder "mf://@listfile.txt" -mf fps=1 \
  -audiofile music.mp3 -oac copy -ovc lavc -o music.avi

 

Now you have a video which constantly shows your jpeg file and plays the mp3 file in the meanwhile. Mencoder can split this file now:

mencoder -ss 300 -endpos 5 \
  -oac copy -ovc copy -o part.avi music.avi

 

You have the right (let’s say you need the 5:00 – 5:05 one) part, but as an avi file. With mplayer, you can dump the audio part:

mplayer -dumpaudio -dumpfile part.mp3 part.avi

 

Enjoy.U

Written by grault

July 28, 2009 - 2:15 pm at July 28, 2009 - 2:15 pm

Posted in command line, music

split mp3 files again

without comments

afroid-laptop% cat filesplitter.sh
#!/usr/bin/zsh
FILE=$1; sox "$FILE" -e stat 2>&1 | grep ^Length | cut -d':' -f2 | sed -e 's/$/
d [1+]si 300 ~ 0 <i sp sf lf lp ~ 0 <i sl 0 [d ll + d lf >s]ss 0 0 =s f/' | dc |
 sed -e '1d' | tac | ( echo TITLE \"x\"; echo PERFORMER\"x\"; echo FILE \"$FILE\
" MP3; x=1; while read i; do echo \ TRACK $x AUDIO; echo \ \ TITLE \"x$x\"; echo
 \ \ PERFORMER \"x\"; echo \ \ INDEX 01 `echo $i "60 ~ sn p" | dc`:`echo $i "60
~ p" | dc`:0; (( x = x + 1)) ; done ) | sed -e 's/"x\([0-9]\)"/"x0\1"/' | sed -e
 's/\ \([0-9]\):/ 0\1:/' | sed -e 's/:\([0-9]\):/:0\1:/' | sed -e 's/:\([0-9]\)$
/:0\1/' | sed -e 's/TRACK\ \([0-9]\) /TRACK 0\1 /' > /tmp/splitter.cue && mp3spl
t -c /tmp/splitter.cue $FILE -o @t
afroid-laptop%

Written by grault

March 28, 2008 - 9:46 pm at March 28, 2008 - 9:46 pm

Posted in command line, linux, music

cue timings

without comments

This is for roadmovie #116 – there she goes again.

00:00
02:28
06:39
10:02
13:21
15:35
19:08
21:24
25:22
28:33
32:38
36:56
40:27
44:10
47:51
51:39
57:00
59:47

Written by grault

January 30, 2008 - 7:34 pm at January 30, 2008 - 7:34 pm

Posted in music

cue files

without comments

Cue file for the mix roadmovie #118 – i wish i’d stayed asleep today starts like this:

TITLE "118"
PERFORMER "roadmovie"
FILE "roadmovie118_080127.mp3" MP3
  TRACK 01 AUDIO
    TITLE "silver-stallion--the-highwaymen-cover"
    PERFORMER "cat-power"
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    TITLE "anything"
    PERFORMER "david-n-the-citizens"
    INDEX 01 02:45:00

So this is the format. Later I’ll publish only the timings.

00:00
02:45
06:20
10:07
14:05
17:44
22:17
26:02
29:35
33:20
36:45
39:47
44:11
47:50
54:02
56:59

The same for 117:

00:00
01:30
06:20
09:10
12:27
16:08
20:44
23:27
25:22
29:01
32:58
35:02
37:41
42:53
49:59
53:39
56:14

Written by grault

January 29, 2008 - 10:11 pm at January 29, 2008 - 10:11 pm

Posted in music

split mp3 to wav slices

without comments

Update: if you’re looking for splitting mp3 files without reencoding and by using only mplayer and mencoder command line tools, read this post instead.

 

I have a Sony mznh600 which uses the brilliant SonicStage bloatware to upload music to the equipment. This shit put little glitches into the tracks I upload in case those are mp3 files. With wavs this isn’t an issue. Therefore I always have to convert my files to wav first and upload then. I tend to listen kinda electronic music (I prefer files published as mixes) instead of popular crap, so I feel the need to split them into smaller pieces. SonicStage runs only on windowns, so I set up an environment to perform previous steps.

First of all I installed Vim as a useful tool long ago. As a preparation step change your _vimrc as follows.

C:\Program Files\Vim>diff _vimrc _vimrc-orig
3c3
< " source $VIMRUNTIME/mswin.vim
---
> source $VIMRUNTIME/mswin.vim

C:\Program Files\Vim>

This change allows to use Ctrl-A as incremental operator. Download and unzip mplayer e.g. from here then create an initial command file like this:

D:\z\split>type split.cmd
d:\z\mplayer\mplayer.exe -ss 0 -endpos 300 Beatman_and_Ludmilla-Breakout_Breeze-
_-The_Breakbeat_Show_at_Radio_Tilos-LINE-22_12_2007.mp3 -ao pcm:file=tr01.wav

D:\z\split>

Change file names as convenient for you. Open it in Vim and start with a “:set nrformats=” command. This last one enables the behavior when you press Ctrl-A on a number like 07 it becomes 08 (and on 09 it will be 10). Then do the followings:

qayyp/-ss<enter>4l300<Ctrl-a>/=tr<enter>3l<Ctrl-a>0q12@a

This will create command line statements for the track sequence (300 sec (5 min) for every track). You should change the 12 before @ to cover the full length. A bigger number is good as well because then the wavs out of scope won’t contain data and you can delete those afterwards. Finally just run the command file and enjoy the results.

Of course some changes should be made to suit your needs, but these are the basics.

Written by grault

January 6, 2008 - 12:12 pm at January 6, 2008 - 12:12 pm

new earbud

without comments

After a very close relationship with a Koss The Plug one I came over. My new buddy is a Sennheiser CX300-S, which is like this:

Which is crazy because I feel high sounds more intense. Other attributes are:

Written by grault

November 26, 2007 - 10:07 pm at November 26, 2007 - 10:07 pm

Posted in music, noise

CLM & stuff

without comments

LINK

Written by grault

November 1, 2007 - 12:20 am at November 1, 2007 - 12:20 am

Posted in lisp, music

rythm by CM

without comments

One can directly execute this command in a CM prompt producing a 120 BPM C7 sound for half a minute :)

(events
 (process for i below 60
	  output
	  (new midi :keynum 'c7
	       :time (/ i 2)
	       :duration .5)
	  wait .1)
 "intro.mid")

Written by grault

October 31, 2007 - 11:02 pm at October 31, 2007 - 11:02 pm

Posted in lisp, music, noise

algorithmic noise generation

without comments

I always have ideas when listening music. E.g. things should be changed to make it more enjoyable for me. I often feel the need to express my thoughts on this which materialize itself in forms like hacking CM and in searching for composers’ work. I’d like to be able to create compositions like Christopher Burns did with his Kepler’s Monsters. Direct links are 1, 2, 3.

Written by grault

October 31, 2007 - 10:06 pm at October 31, 2007 - 10:06 pm

Posted in contemporary, lisp, music, noise

contemporary organ

without comments

I happened to participate on a contemporary organ & quire concert. The performer was Iveta Apkalna who played fantasies from Thierry Escaich, Saint-SaĆ«ns, etc. I didn’t manage to find any useful sites about ‘em. It was really really good.

Written by grault

October 30, 2007 - 8:32 pm at October 30, 2007 - 8:32 pm

Posted in contemporary, music, organ