4.1. rpscripts package¶
4.1.1. Subpackages¶
- 4.1.1.1. rpscripts.lib package
- 4.1.1.1.1. Submodules
- 4.1.1.1.2. rpscripts.lib.base module
CustomException
EventLocation
GeneralSubparser
RPData
aux_find_next_measure_number()
aux_sum_if_none()
clean_filename()
convert_texture_data_from_json()
convert_texture_data_to_json()
convert_to_equal_durations()
dump_json_data()
file_rename()
find_nearest_smaller()
fraction_to_string()
get_diff_lcm()
get_fractions_denominator_lcm()
get_number_combinations_pairs()
load_json_file()
make_fraction()
make_general_graph()
parse_fraction()
parse_pow()
save_dict_into_csv_file()
- 4.1.1.1.3. rpscripts.lib.partition module
- 4.1.1.1.4. Module contents
4.1.2. Submodules¶
4.1.3. rpscripts.annotator module¶
This module provides annotation features. It adds data such as partition into the XML score data and saves as a MXL file.
- class rpscripts.annotator.Subparser(subparser: ArgumentParser)[source]¶
Bases:
GeneralSubparser
Implements argparser.
4.1.4. rpscripts.calculator module¶
This module provides classes and functions to calculate the rhythmic partitions from a given digital score.
- class rpscripts.calculator.MusicalEvent(**kwargs)[source]¶
Bases:
object
Auxiliary musical event class.
This class has only the needed attributes of Music21’s Note, Rest and Chord classes.
- class rpscripts.calculator.Parsema(**kwargs)[source]¶
Bases:
object
Auxiliary Parsema class.
Parsema is the set of adjacent equal partitions. See Gentil-Nunes 2009 for further information.
- class rpscripts.calculator.ParsemaeSegment(**kwargs)[source]¶
Bases:
object
Parsema segment class.
- class rpscripts.calculator.PartSoundingMap(**kwargs)[source]¶
Bases:
object
Sounding Map class of a musical part.
- get_single_event_by_location(global_offset: Fraction) SingleEvent [source]¶
Return a SingleEvent object from its location.
- class rpscripts.calculator.ScoreSoundingMap(**kwargs)[source]¶
Bases:
object
Sounding Map class of a musical score. Individual parts are sounding maps.
- add_part_sounding_map(m21_part: Part) None [source]¶
Creates a PartSoundingMap from a given Music21 Part and add it to sounding_maps and attacks attributes.
- add_score_sounding_maps(m21_score: Score) None [source]¶
Create PartSoundingMap objects from each part of a given Music21 Score.
This method also get measure offsets and explodes voices into parts.
- class rpscripts.calculator.SingleEvent(**kwargs)[source]¶
Bases:
object
Auxiliary single event. It’s more simple than Music21’s note and rest objects and has useful attributes such ass number of pitches and sounding.
- class rpscripts.calculator.Subparser(subparser: ArgumentParser)[source]¶
Bases:
GeneralSubparser
Implements argparser.
- rpscripts.calculator.aux_join_music_events(events: dict) dict [source]¶
Join MusicalEvent
This methods join adjacent tied objects as well as adjacent rests.
- rpscripts.calculator.aux_make_events_from_part(m21_part: Part) dict [source]¶
Return a dictionary with Musical Events and their locations from a given Music21 part object.
- rpscripts.calculator.auxiliary_get_duration(m21_obj) Fraction [source]¶
Return the duration of the given Music21 object as a Fraction object.
- rpscripts.calculator.make_music_events_from_part(m21_part: Part) dict [source]¶
Return a dictionary with location and Musical Events from a given Music21 part object. Adjacent rests and tied notes are joined.
- rpscripts.calculator.make_offset_map(m21part: Part) dict [source]¶
Create map with measure number and global offset value.
4.1.5. rpscripts.cli module¶
This module provides the command line interface.
4.1.6. rpscripts.config module¶
This module contains RP Scripts’ global variables.
These variables are used in multiple modules.
4.1.7. rpscripts.converter module¶
This module converts calculator’s JSON output into CSV file with or without intermediary equally-sized events.
- class rpscripts.converter.Subparser(subparser: ArgumentParser)[source]¶
Bases:
GeneralSubparser
Implements argparser.
4.1.8. rpscripts.info module¶
This shows information about data.
- class rpscripts.info.Subparser(subparser: ArgumentParser)[source]¶
Bases:
GeneralSubparser
Implements argparser.
4.1.9. rpscripts.labeler module¶
This module parses TXT label file and adds this information into the JSON file.
- class rpscripts.labeler.Edge(label=None, index=None, global_offset=None)[source]¶
Bases:
object
This class represents the point where a excerpt or section starts.
- class rpscripts.labeler.Subparser(subparser: ArgumentParser)[source]¶
Bases:
GeneralSubparser
Implements argparser.
4.1.10. rpscripts.plotter module¶
- class rpscripts.plotter.AbstractIndexogramPlotter(rpdata: RPData, image_format='svg', close_bubbles=False, show_labels=False)[source]¶
Bases:
AbstractTimePlotter
Abstract indexogram plotter class.
This class extends AbstractTimePlotter and has dispersion and inverted agglomeration data as attributes to help indexograms plotting.
- class rpscripts.plotter.AbstractPartitiogramPlotter(rpdata: RPData, image_format='svg', with_labels=True, **kwargs)[source]¶
Bases:
AbstractPlotter
Abstract partitiogram plotter class.
This class extends AbstractPlotter and has agglomeration, dispersion and quantity attributes to help Partitiogram scatter plotting.
- class rpscripts.plotter.AbstractPlotter(rpdata: RPData, image_format='svg')[source]¶
Bases:
object
Main abstract plotter class.
This class has useful attributes and methods to handle RPData objects.
- class rpscripts.plotter.AbstractTimePlotter(rpdata: RPData, image_format='svg', show_labels=False)[source]¶
Bases:
AbstractPlotter
Abstract time plotter class.
This class extends AbstractPlotter and handles X-axis to show measure numbers and offsets.
- class rpscripts.plotter.BubblePartitiogramPlotter(rpdata: RPData, image_format='svg', with_labels=True, bubble_size=2000, **kwargs)[source]¶
Bases:
AbstractPartitiogramPlotter
- class rpscripts.plotter.CombinedIndexogramPlotter(rpdata: RPData, image_format='svg', close_bubbles=False, show_labels=False)[source]¶
Bases:
AbstractIndexogramPlotter
- class rpscripts.plotter.ComparativePartitiogramMaker(rpdata: RPData, image_format='svg', with_labels=True)[source]¶
Bases:
AbstractPartitiogramPlotter
- class rpscripts.plotter.ComparativePartitiogramPlotter(rpdata: RPData, column_1, column_2, image_format='svg', with_labels=True, **kwargs)[source]¶
Bases:
AbstractPartitiogramPlotter
- class rpscripts.plotter.SimpleIndexogramPlotter(rpdata: RPData, image_format='svg', close_bubbles=False, show_labels=False)[source]¶
Bases:
AbstractIndexogramPlotter
- class rpscripts.plotter.SimplePartitiogramPlotter(rpdata: RPData, image_format='svg', with_labels=True, **kwargs)[source]¶
Bases:
AbstractPartitiogramPlotter
- class rpscripts.plotter.StairsIndexogramPlotter(rpdata: RPData, image_format='svg', close_bubbles=False, show_labels=False)[source]¶
Bases:
AbstractIndexogramPlotter
- class rpscripts.plotter.StemIndexogramPlotter(rpdata: RPData, image_format='svg', close_bubbles=False, show_labels=False)[source]¶
Bases:
AbstractIndexogramPlotter
- class rpscripts.plotter.StepIndexogramPlotter(rpdata: RPData, image_format='svg', close_bubbles=False, show_labels=False)[source]¶
Bases:
AbstractIndexogramPlotter
- class rpscripts.plotter.Subparser(subparser: ArgumentParser)[source]¶
Bases:
GeneralSubparser
Implements argparser.
4.1.11. rpscripts.stats module¶
This module provides a few statistical data about the given filename.
- class rpscripts.stats.Subparser(subparser: ArgumentParser)[source]¶
Bases:
GeneralSubparser
Implements argparser.
4.1.12. rpscripts.trimmer module¶
This module cuts off a given calc’s JSON output file by given start and end measure numbers and return a new JSON file.
- class rpscripts.trimmer.Subparser(subparser: ArgumentParser)[source]¶
Bases:
GeneralSubparser
Implements argparser.
4.1.13. rpscripts.utils module¶
This module contains helpful tools for the rhythmic partitioning task.
- class rpscripts.utils.Subparser(subparser: ArgumentParser)[source]¶
Bases:
GeneralSubparser
Implements argparser.
4.1.14. Module contents¶
Provide main modules and classes.