• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
There are many songs in the PDF, how to create a Setlist?
#1
I would like to ask everyone, assuming there are 10 songs in the PDF I imported, can I specify some of the songs to create a Setlist? Instead of the entire PDF. Huh
Reply
#2
I wrote a simple Python script to produce a .CSV file that can be imported into MobileSheets with the PDF file to create separate pieces. It uses the very imperfect method of assuming that all piece titles are in a specific font and size. This is very 'rough and ready' and works for me by manually editing it to change the input PDF file and the title font as needed. This was only ever intended for my personal use and is very far from being a 'production ready' program.

The only dependency is py-pdf-parser, which can be installed using pip.

The .CSV file is output to the terminal by default, but can be redirected to a files using the ">" operator (E.g. "python3 splitpdfmusic.py > OUTPUT_FILE.csv".)

Code:
# Generate index for MobileSheets

from py_pdf_parser.loaders import load_file
from py_pdf_parser.visualise import visualise

document = load_file("FILE PATH HERE")
#print(document.fonts)  # Uncomment to display a list of fonts used in the document
headers = document.elements.filter_by_font("LDOJID+Verdana-Bold,9.8")  # Change font and size here
print("title;pages")
for h in headers:
    s = h.text().split('\n')[0]
    print(f'"{s}";{h.page_number}-{h.page_number}')


#visualise(document)  # Uncomment for debugging
Reply
#3
Note: You can't apply a csv file to a file that is already in mobilesheets i.e. it has to be present when a pdf is imported.
This means that you would have to remove the existing pdf from MS before reimporting it with the csv file (both files in same folder)

Suggest you copy the pdf first to a new name and experiment first with that (maintains  what you already have while experimenting)
Also, include a collection (or similar field) on every line in the csv; this will make it easy to use a filter to select all the songs so that they can be deleted prior to retrying with a corrected csv.
Just use 4 or 5 songs in your experiment so that you can establish what is required (easy to manually delete if needed)

Geoff
Samsung Galaxy Tab A6
Reply
#4
So it’s not that I didn’t find the right way, it’s really can’t do it?

It is recommended that you use the Bookmark in Songs to add it to the Setlist when updating the program.
Reply
#5
Make as  many copys of the song as you need. In your case 10. Open one copy bring up the overlay (tap Center) -> edit song-> file -> and adjust the page numbers. First song will be page 1-3 second song 4-6 and so on.rename every copy with the song title. The original file should be untouched. There are only the copys at the database.
Then you could put the songs in a setlist.

See also:
https://youtu.be/FOZ5CO00nRk
Samsung Galaxy Tab S7 FE Android 12
Samsung Note Pro 12.2 LineageOS 14.1
Huawei Media Pad M3 lite Android 7
Reply
#6
With ten pieces, that is a realistic solution. The PDF file I used the script for contains almost 700 pieces, so automation was really the only practical option.
Reply
#7
You could just set up a csv file with 10 entries.
Assuming you don't want a lot more songs in the pdf then copying is ok; not so goof if you want to add many songs (inless you are adding one or two at a time)

Scirius (?) has some tools for automatically creating a .csv file from a pdf - worth a check to see if of use

Geoff
Samsung Galaxy Tab A6
Reply
#8
Yes. If there are so many Pieces, then go for an import via csv.
Of course you also have to put some work into the csv file and define the page numbers and song names.
Alternatively, MSP can also split the songs based on bookmarks in the PDF files. but I think then you have less control over the metadata such as genre, collections or composers. 
I also looked at the Scirius tools some time ago but I have no idea how to use them. 
My computer skills are not good enough for that.
Samsung Galaxy Tab S7 FE Android 12
Samsung Note Pro 12.2 LineageOS 14.1
Huawei Media Pad M3 lite Android 7
Reply
#9
(09-26-2024, 03:30 PM)McAroni Wrote: Make as  many copys of the song as you need. In your case 10. Open one copy bring up the overlay (tap Center) -> edit song-> file -> and adjust the page numbers. First song will be page 1-3 second song 4-6 and so on.rename every copy with the song title. The original file should be untouched. There are only the copys at the database.
Then you could put the songs in a setlist.

See also:
https://youtu.be/FOZ5CO00nRk

Thank you very much for the tip, this is exactly what I needed.  Heart
Reply
#10
Another consideration is whether the big pdf is subject to change.
If it is a fixed book e.g. a bought published file then copying is fine.

However, if the file is subject to change (e.g. a song book created by a group) then changing the book is likely to muck up any annotations that you have made (unless all the new songs are added to the end of the file).


To avoid this, a better approach is probably to view the pdf on your pc and print off the few individual songs to a pdf file (use something like CutePDF or "Print to PDF"). These files can then be imported to the tablet and annotated as required (keep the big pdf on the tablet so that you can still browse it if necessary)

Geoff
Samsung Galaxy Tab A6
Reply
#11
In fact creating separate songs in MobileSheets is the way to go. There are several ways to do that. Importing via CSV file is just one method (my preferred method btw).

@Geoff: "changing the book is likely to muck up any annotations" is not fully correct. In case pages are inserted somewhere at the beginning of the PDF, you need to fix the pages of every song behind the insertion. Annotations are stored per song, relative to page and position relative to the song. If the pages of the song are corrected so that the right song is displayed the annotations should be correct.

Adding bookmarks to a setlist is not possible.
https://www.zubersoft.com/mobilesheets/f...=bookmarks
If PDF bookmarks are available they can be used to create a CSV file
https://www.zubersoft.com/mobilesheets/f...-8565.html
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#12
I think there's frequently some confusion going on (not necessarily in this thread but I don't want to look for examples right now) when former forscore users talk about bookmarks because of the different terminologies.

As I understand forscore's page bookmarks are like the "normal" bookmarks in MS (and PDFs). 
Forscore's item bookmarks are like songs/pieces in MS.

Never mind here, but I thought it's worth to mention now and again when bookmarks are discussed.
Reply




Users browsing this thread:
3 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.