01-21-2016, 03:43 AM
(01-20-2016, 10:52 PM)sciurius Wrote: I trust your code doesn't crash. Neither does mine .
Good to know ;-)
(01-20-2016, 10:52 PM)sciurius Wrote: But my objection is that using only a starting page may not be sufficiently deterministic under all circumstances.
Given the example in my posting, you would need to collect all song data and sort on page number to be sure.
Yes; that's what my code does. Do you envisage any problems with that?
(01-20-2016, 10:52 PM)sciurius Wrote: Also:
Quote:"5-" would mean page 5 and all subsequent pages until the next page not claimed by any other song
The usual interpretation (e.g., LaTeX): If you specify a range consisting of a hyphen (or any tie) but with one or two empty page numbers, the following will happen:
1. a range of the form -34 is taken to mean pages 1 to 34;
2. a range of the form 12- is taken to mean page 12 to last page;
3. a range of the form - (only hyphen) is taken to mean page 1 to last page.
Yes, but I would argue that the usual interpretation is less useful in this scenario than the meaning I am proposing. Otherwise you manually have to go through every single song and provide its last page.
Another approach might be to provide a simple Ruby / Python script which automatically calculates the last pages via the same algorithm and then outputs an updated version of the CSV file with those numbers included. Then the updated version would be fed into my PDFexploder / MSP / whatever else. But this two-phase approach is less convenient for the end user and I don't see any real advantage to it. Am I missing something?
(01-21-2016, 02:26 AM)sciurius Wrote: I'm going to carry the use of CSV metadata a step further.
First, I'm currently finishing a tool that reads iRealPro data and formats this into a nice PDF.
You mean a PDF containing a table of contents of all the songs? My PDFexploder does that, using LaTeX actually:
https://github.com/aspiers/PDFexploder/b....latex.erb
(01-21-2016, 02:26 AM)sciurius Wrote: iRealPro songs contain a limited amount of metadata like title, composer, style, key, and tempo.
If the iRealPro data contains an iRealPro playlist, I produce a multi-page PDF document and the corresponding metadata CSV. In other words: a Fakebook plus index in one go.
My code originally combined multiple fakebooks into a single giant PDF which started with a huge ToC, and then had all songs from all fakebooks sorted alphabetically (rather than just concatenating all fakebooks together). This was quite cool, but I realised that a huge PDF is unwieldly, and it's much nicer to have one song per PDF, because this works more smoothly regardless of what music reader you choose to use. Even in MSP it makes it easier to build set lists by cherry-picking songs.
(01-21-2016, 02:26 AM)sciurius Wrote: For reasons not relevant here, my tool can also produce PNGs instead of a PDF. This brings me to the feature request to extend the use of metadata CSV for other imports (in particular, batch inport) as well.
For example, I have a folder with ChordPros or PNGs, each containing one song. I can batch import this folder, but it would be very nice if I could place a metadata CSV in the folder (or specify on the import dialog) so that all imported songs can have some metadata filled in.
I even think that given how far Mike already implemented support for metadata CSVs this won't be hard to add.
Implementation hint: Add a "filename" or "pathname" element to the CSV to match a file with its metadata.
Yes, that would be awesome, and would also make it easy to bulk import PDFs generated by my PDFexploder.