On 11/12/05, Scott McClelland <[EMAIL PROTECTED]> wrote:
> Another interesting idea would be to fit .mp3's on a CD.  The files can't be
> split, but larger and smaller files can be combined.  In the case of music,
> one might prefer to keep them in order, and then just look for small files
> to fill up the last remaining space.
>
> Search through directories, and group the files by composer, and fill up
> each directory with similar files (e.g. all Bach on a group of CD's, all
> Vivaldi on another group, etc., or possibly combine by category such as
> Classical)
>
> Classical
>   Bach
>   Bethoven
>   Handel
>   Mozart
>
> If all the Bach CDs fill up with pure Bach, but there is still room on the
> last one, then consider taking one from anywhere under Classical.
>
> The whole idea may not be practical, since it may not make sense to split up
> certain pieces, or change the order.  e.g. Vivaldi's Four Seasons would
> sound strange if they were out of order.  The main idea is just to burn
> .mp3's back to a CD, but fit almost twice as much on a single CD than the
> original uncompressed format.  So, I guess the idea is a "partially filled"
> bin packing problem.

Yes.  After looking at CFA Johnson's shell script for a while, I sat
down and wrote an AWK script.  It's not quite ready for prime time. 
It has the following characteristics:  given a list of files and
sizes, it reads through the list in sequence from the beginning.  The
output is a set of smaller lists, each one filled up not to exceed a
specified maximum size.   Each input item is put into the first
available output list in which it fits.

So the output lists are approximately in the same order as the input. 
Sample input and output available on request, or give me a sample of
your file lists and I will try running it through this program.

    carl
--
    carl lowenstein         marine physical lab     u.c. san diego
                                                 [EMAIL PROTECTED]

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-newbie

Reply via email to