Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Encode same FLAC to multiple MP3s when repeated in playlist (Read 6607 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Encode same FLAC to multiple MP3s when repeated in playlist

This is a rather unusual situation, specific to adding multiple copies of some festive (Christmas pop) background music to my normal non-festive compilation of quiet background music. The backgound in more detail is below my main question and is in Times Font

I have 31 festive tracks - about 2 hours' duration
My normal non-festive playlist is 618 tracks (~31.7 hours), which almost entirely fills a 2GB SD card (1.9 GiB USB Image Tool image backup file)

I wish every 5th track to be a festive track so it remains festive but not boringly repetitive. That means I'll need to trim off the last 125 or so non-festive tracks to make room, as I'll repeat the festive tracks in the same order after the 31st one.

I accomplished this by exporting playlists as .m3u and importing as text into Microsoft Excel worksheets titled Normal and XMAS and picking them in the desired sequence using Excel functions like MOD, INT and INDIRECT.

The target device is limited to 8.3 filenames on FAT16, has no tagging support and no playlists. Play order in any folder depends on the order in which files were written to the SD-card, so fb2k's File Operations/Copy... working in playlist order means I don't have to have Upside Down - Diana Ross followed by Upside Down - Jack Johnson, for example, as I would with Windows Explorer's copy method.

For my normal non-repeating playlist I'm able to use Title Formatting to get a fairly sensible 8 character filename with no repeats in my playlist. The following naming scheme for the Right Click/File Operations/Copy to... function (which can be used to populate a SD card or USB stick in a particular order) produces fairly recognisable titles (basically truncated to 6 non-punctuation characters) with an abbreviation of the ARTIST as up to two initial characters with "The" or "A" moved to the end, so "Rock & Roll Music" by "The Beatles" would become ROCKNRBT.MP3, or "Shake Your Groove Thing" by "Peaches & Herb" would be SHAKEYPH.MP3.
It will eliminate characters like ! . - ( ) and replace & with N in titles (but eliminate & in artists) for example, which mostly suffices.
Code: [Select]
$left($replace($replace($replace($replace($replace($replace($replace(
$replace($replace(%title%,&,N),!,),$char(41),),$char(40),),-,), ,),',',)
,'',),.,),6)$left($abbr($replace($swapprefix(%artist%),&,)),2)


To avoid duplicated 8.3 file names I could quite happily stick to Windows XP's long-filename support for %title% - %artist%, which gives UPSIDE~1.MP3 and UPSIDE~2.MP3 for the two songs titled "Upside Down" by different artists.

However, I actually want numerous versions of the exact same song. It appears that the Right-Click Context/Convert... function removes duplicates of the same file and that the file naming pattern is unable to use items like %queue_indexes% (valid only for playlists which have been queued, not functions acting in the context of playlist items that are queued) which would have enabled me to differentiate the instances.

I've considered using a command prompt / batch file to iterate through invoking the encoder each time and specifying the output filename required.

Possibly the simplest way is to select the first 31 x 5 = 155 tracks and convert those to MP3, then select tracks 156-310 from my playlist and convert those with a different filename style with a leading digit and 5 characters from the title, such as 0ROCKNBT.MP3, then for 311-465 use 1ROCKNBT.MP3. Equally, I could use 0 to items 0-99, 1 for 100-199, 2 for 200-299 etc. but that's more human interventions.

I think this will do for a once-a-year task, but I feel there ought to be a more automatic way of doing this, so...

Does anyone have any better ideas? I'm pretty new to title formatting and filename construction and how fb2k processes such selections under the hood, and maybe it's obvious to someone that this is readily achievable.

Background info on my normal preparation/encoding/SD card loading process:
• Target device: DABone DAB/FM radio with MP3 support via SD card - about 2 years old, cheap but decent sound quality for a portable radio (aside from moderate DAB reception, a coarse (~6dB step?) volume control at low settings and the odd MP3 playback glitch (a crack sound), maybe once or twice in 8 hours, not reproducible with speicific tracks or passages)
• This device is limited to 8.3 filenames on FAT16, has no tagging support and no playlists. Play order in any folder depends on the order in which files were written to the SD-card, so fb2k's File Operations/Copy... working in playlist order means I don't have to have Upside Down - Diana Ross followed by Upside Down - Jack Johnson, for example, as I would with Windows Explorer's copy method.
• I've filled a 2GB SD card with about a 31 hour compilation of MP3s averaging 130 kbps (131 kbps taking into account "size-on-disk") for this device, aimed at providing background music at low volume.
• I form the playlist of desired music from my archive then process them all using fb2k Converter, Processing with foo_dsp_vlevel (Str:100%,MaxMult:25,LookAheadBuffer:5.0s) to a new folder of FLAC files. (I'll consider trying a VST plugin like this 3-band dynamic compressor with psychoacoustic features in future, to see if the perceived volume is more closely maintained).
• Track Gain is calculated. This irons out the 5-8 dB or so of track-to-track variation still found after vlevel - e.g. Robbie Williams - Millennium sounds a good bit louder than most surrounding tracks with vlevel alone, and Replay Gain agrees with my judgement, and that's true of a few other tracks with a certain modern EQ and DRC type also)
• I then encode to MP3 (lately using Helix hmp3.exe - %d -X2 -U2 -V60 setting, which is fast and ample quality for quiet-to-moderate background music, in my experience) and use a filename of about 6 characters from the title and a 1-to-2 character abbreviation of the artist using Title Formatting syntax (see codebox, above), and I have DSP disabled but ReplayGain Track Gain turned on.
• Then I load the MP3 files back into fb2k and finalise the playlist order (mostly random, but moving similar songs or same artist tracks apart), then I save that playlist.
• I then use mp3gain to set my target Track Gain volume for all files (to overcome the coarse volume control on the target device). fb2k's Apply Gain to mp3 will only set to 89 dB, it seems, regardless of pre-amp settings.
• Finally I Select All in this playlist in my desired order and use File Operations/Copy... to copy to a folder on the formatted SD card. (Something doesn't like more than about 255 files on the root level of the drive).
• I use USB Image Tool to take a backup Image of the SD card and store it on my external HDD (e.g. for easy reloading with the same track order after the festive season, for example).


{editing: trying to get CODEBOX to scroll horizontally. Works fine in Preview but post gets very wide when actually posted. Will replace with CODE instead and use line-feeds to limit width.}
Dynamic – the artist formerly known as DickD

 

Encode same FLAC to multiple MP3s when repeated in playlist

Reply #1
...file naming pattern is unable to use items like %queue_indexes%

you can use %list_index% if that helps

also aesthetically you could use $replace() just once: $replace(%title%,&,N,!,,$char(41),,etc)

Encode same FLAC to multiple MP3s when repeated in playlist

Reply #2
Thank you so much, 2E7AH.  That's a great help and works for what I want including multiple copies of the same file. I should be able to create a single-character prefix automatically to give all duplicates a unique filename.

...And I thought I'd seen some method of multiple replacing somewhere before on these forums (but before I reinstalled my PC and lost my old title-formatting strings and tried to reconstruct it myself using the Title Formatting reference on my hard disk (fb2k's Help in that context), which doesn't seem to mention the option of multiple find-replace pairs, though the Knowledgebase (Wiki) version does.
Dynamic – the artist formerly known as DickD