<jupyter_start><jupyter_text>Discovering the Poireau project Execute each cell by selecting it ang pressing ctrl + enter or shift + enter.The main model is the Song. The Song model can create songs by exploring a folder that contains songs (a song is a folder that contains a musicxml file).Songs will be looked in the path specified in poireau/common/settings.py in the variable SONGS_FOLDER (feel free to change this ). If you have a Dropbox synchronized with the files in it, please don't reference its path directly because it may do unwanted modifications, but copy it and reference the path of your local copy.<jupyter_code># Current language will be used for a few names, so we set it to French here.
from __future__ import unicode_literals
from django.utils import translation
translation.activate("fr")
path = None  # Put a absolute path here (or relative to the project root) that contains the songs or leave empty for the test songs
Song.discover_songs_changes(path)<jupyter_output><empty_output><jupyter_text>You can check that songs were succesfully created<jupyter_code>Song.objects.all()<jupyter_output><empty_output><jupyter_text>And that song parts were also created<jupyter_code>song = Song.objects.first()
print(song)
print(song.parts.all())<jupyter_output><empty_output><jupyter_text>A song can export itself in pdf and midi format<jupyter_code>song.export()<jupyter_output><empty_output><jupyter_text>A song can be modified and then exported. Modifications are not saved.<jupyter_code>song.keep_one_part(song.xml_parts[0])
song.export()<jupyter_output><empty_output><jupyter_text>First notes can easily be extracted from a song.<jupyter_code>for song in Song.objects.all():
    print(song.name)
    print(", ".join(song.display_first_notes()))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07469342251950947, 'fraction_numerical': 0.0005574136008918618, 'mean_word_length': 6.386831275720165, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '591795', 'license': 'MIT', 'n_tokens_mistral': 541, 'n_tokens_neox': 523, 'n_words': 198, 'path': 'Poireau Notebook.ipynb', 'repo_name': 'grouloup/poireau', 'size': '1794'}