qmuvi package

Submodules

qmuvi.data_manager module

This module is used to manage data generated within the qmuvi package.

class qmuvi.data_manager.DataManager(data_dir, default_name='data')[source]

Bases: object

Used to manage saving and loading within a target data directory.

create_folder(folder_name)[source]

Create a new folder with the given name in the data directory (appends to data_dir).

Parameters:

folder_name (str) – The name of the folder to create.

Return type:

None

delete_folder(folder_name)[source]

Delete the folder with the given name in the data directory.

Parameters:

folder_name (str) – The name of the folder to delete.

Return type:

None

folder_exists(folder_name)[source]

Return True if a folder with the given name exists in the data directory, False otherwise.

Parameters:

folder_name (str) – The name of the folder to check for.

Return type:

bool

Returns:

True if a folder with the given name exists in the data directory, False otherwise.

get_default_file_pathname()[source]

Return the default file pathname (with no extension) for the data directory.

Return type:

str

Returns:

The default file pathname (with no extension) for the data directory.

get_path(filename)[source]

Return the full path to the given filename in the data directory.

Parameters:

filename (str) – The name of the file to get the path to.

Return type:

str

Returns:

The full path to the given filename in the data directory.

glob(subpathname, *, recursive=Ellipsis)[source]

Return a list of subpaths of data_dir matching a pathname pattern.

Uses the glob.glob method. The pattern may contain simple shell-style wildcards.

Parameters:
  • subpathname (AnyStr) – The pathname pattern to match.

  • recursive (bool) – If True, the pattern “**” will match any files and zero or more directories and subdirectories.

Return type:

list[str]

Returns:

A list of subpaths of data_dir matching a pathname pattern.

load_data(filename=None)[source]

Load and return the data from the plain text file with the given filename in the data directory.

Parameters:

filename (str) – The name of the file to load the data from.

Return type:

Any

load_json(filename=None)[source]

Load and return the data from the JSON file with the given filename in the data directory.

Parameters:

filename (str) – The name of the file to load the data from.

Return type:

Any

Returns:

The data loaded from the JSON file.

remove_files(filename)[source]

Remove all files with the given name in the data directory.

Parameters:

filename (str) – The name of the files to remove.

Return type:

None

save_data(data, filename=None)[source]

Save the given data as a plain text file with the given filename in the data directory.

Parameters:
  • data (Any) – The data to save.

  • filename (str) – The name of the file to save the data to. If None, the default name is used.

Return type:

None

save_json(data, filename=None)[source]

Save the given data as a JSON file with the given filename in the data directory.

Parameters:
  • data (Any) – The data to save.

  • filename (str) – The name of the file to save the data to. If None, the default name is used.

Return type:

None

qmuvi.data_manager.extract_natural_number_from_string_end(s, zero_if_none=False)[source]

Extract the last number of 1 or more digits from the end of the given string.

Parameters:
  • s (str) – The string to extract the number from.

  • zero_if_none – If True, return 0 if no number is found at the end of the string, otherwise return None. Default: False.

  • optional – If True, return 0 if no number is found at the end of the string, otherwise return None. Default: False.

Return type:

int

Returns:

The last number of 1 or more digits from the end of the given string, or 0 if no number is found and zero_if_none is True.

qmuvi.data_manager.get_unique_pathname(base_name, location)[source]

Get a unique pathname in the working directory based on the base_name.

If a file with the name already exists in the working directory, a number is appended to the end of the name. E.g. If the folder “test” already exists, the number “1” is appended to get “test-1”. If “test-1” already exists, the number is incremented to get “test-2” and so on.

Parameters:
  • base_name (str) – The base name for the new pathname.

  • location (str) – The directory location to create the new pathname in.

Return type:

str

Returns:

The name of the new pathname.

qmuvi.musical_processing module

qmuvi.musical_processing.convert_files_mid_to_wav_timidity_threading(pathnames, options_string, timidity_convert_method, timeout=8)[source]

Convert a list of MIDI files to WAV format using TiMidity++ in a threaded manner.

Given a list of file paths to MIDI files, an options string for TiMidity++, a function to perform the conversion, and a timeout, this function will convert each file to WAV format using TiMidity++ in a separate thread. Each thread runs the conversion function with the given options string and the input file path. If a timeout is specified and the conversion function takes longer than the timeout to complete, the function will raise an exception.

Parameters:
  • pathnames (List[str]) – A list of file paths to MIDI files that will be converted to WAV format.

  • options_string (str) – An options string to be passed to the TiMidity++ conversion function.

  • timidity_convert_method (Callable[[str, str, Dict[int, CompletedProcess], Dict[int, Any], int], None]) – The function to be used to perform the TiMidity++ conversion.

  • timeout (float) – The number of seconds to wait for each thread to complete before raising a timeout exception. Default is 8.

Return type:

List[str]

Returns:

A list of file paths to the converted WAV files.

Raises:

Exception – If a timeout occurs while converting a MIDI file to WAV format.

qmuvi.musical_processing.convert_midi_to_wav_timidity(output_manager, timeout=8, log_to_file=False)[source]

Convert a MIDI file to a WAV file using the Timidity++ library.

This function takes the path to generated MIDI files and uses the Timidity++ library to convert the files to a single WAV file.

Parameters:
  • output_manager (DataManager) – A data manager object for finding the MIDI files and handling the output file.

  • timeout (int) – The number of seconds to wait for each thread to complete before raising a timeout exception. Default is 8.

  • log_to_file (bool) – Whether to log the output of the Timidity process to a file.

Return type:

None

Returns:

This function does not return anything, but writes the output WAV file to disk.

qmuvi.musical_processing.generate_midi_from_data(output_manager, instruments=[[81, 82, 83, 84, 85, 86, 87, 88]], note_map=<function note_map_c_major_arpeggio>, rhythm=None)[source]

Use the qmuvi generated data files to create a song as a midi file (.mid).

Parameters:
  • output_manager (DataManager) – The DataManager object for the output folder.

  • instruments (List[List[int]]) – The collections of instruments for each pure state in the mixed state (up to 8 collections). Computational basis state phase determines which instrument from the collection is used.

  • note_map (Callable[[int], int]) – Converts state number to a note number where 60 is middle C.

  • rhythm (Optional[List[Tuple[int, int]]]) – A list of tuples for the length and rest times of each sound in units of ticks (480 ticks is 1 second). If None, then each sound length and rest time will be set to (note_sound, rest_time) = (240, 0).

Return type:

List[str]

Returns:

A list of file paths to the generated MIDI files.

qmuvi.musical_processing.get_sound_data_from_density_matrix(density_matrix, default_pure_state_global_phasors, eps=1e-08)[source]

Extract a list of sound data from a density matrix by eigendecomposing it into a mixture of pure states.

Parameters:
  • density_matrix (ndarray) – A density matrix in the form of a numpy array.

  • default_pure_state_global_phasors (Mapping[int, complex]) – A dictionary of default global phasors for each pure state in the density matrix. Used to keep the global phase consistent during eigendecompositions of different density matrices.

  • eps (float) – A small probability threshold. Used to filter out pure states and some basis states with negligible probability.

Return type:

List[Tuple[float, Dict[int, Tuple[float, float]], List[float], List[float]]]

Returns:

A list of sound data for pure states (under the condition pure_state_prob > eps) in the form of tuples, each tuple containing: ( pure_state_prob, pure_state_info: A Dict with key: basis_state_number, and value: (basis_state_prob, basis_state_angle), # where (basis_state_prob > eps) all_basis_state_probs, all_basis_state_angles ).

qmuvi.musical_processing.mix_wav_files(file_paths, output_manager)[source]

Mix multiple WAV files into a single file.

This function takes a list of file paths for WAV files and a data manager object for handling the output file, and mixes the audio content of the input files into a single file. The resulting file is saved to the output file path returned by the data manager.

Parameters:
  • file_paths (List[str]) – A list of file paths for the WAV files to be mixed.

  • output_manager (DataManager) – A data manager object for handling the output file.

Return type:

None

Returns:

This function does not return a value. The resulting mixed audio file is saved to disk.

qmuvi.musical_processing.note_map_c_major(n)[source]

Map n to a note in the C major scale. It starts at middle C.

Parameters:

n (int) – The integer to be mapped to a note.

Return type:

int

Returns:

The note mapped to from n.

qmuvi.musical_processing.note_map_c_major_arpeggio(n)[source]

Map n to a note in the C major arpeggio. It starts at middle C.

Parameters:

n (int) – The integer to be mapped to a note.

Return type:

int

Returns:

The note mapped to from n.

qmuvi.musical_processing.note_map_chromatic_middle_c(n)[source]

Map n to a note in the chromatic scale. It starts at middle C.

Parameters:

n (int) – The integer to be mapped to a note.

Return type:

int

Returns:

The note mapped to from n. Returns n + 60.

qmuvi.musical_processing.note_map_f_minor(n)[source]

Map n to a note in the F minor scale. It starts at middle C.

Parameters:

n (int) – The integer to be mapped to a note.

Return type:

int

Returns:

The note mapped to from n.

qmuvi.quantum_simulation module

qmuvi.quantum_simulation.get_simple_noise_model(gate_error_rate_1q=0.0, gate_error_rate_cnot=0.0)[source]

Generates a simple noise model with depolarising errors on single qubit gates and CNOT gates.

Parameters:
  • gate_error_rate_1q (float) – The depolarising error to be applied to single qubit gates.

  • gate_error_rate_cnot (float) – The depolarising error to be applied to CNOT gates.

Return type:

NoiseModel

Returns:

The noise model to be applied to the simulation.

qmuvi.quantum_simulation.sample_circuit_barriers(quantum_circuit, noise_model=None)[source]

Saves the state of the quantum circuit at each barrier in the simulation as a density matrix.

Parameters:
  • quantum_circuit (QuantumCircuit) – The quantum circuit to be simulated.

  • noise_model (NoiseModel) – The noise model to be applied to the simulation.

Return type:

List[ndarray]

Returns:

density_matrices: A list of the sampled density matrices as 2d complex numpy arrays.

qmuvi.video_generation module

qmuvi.video_generation.blend_colours(colour1, colour2, alpha)[source]

Blends two colours together using the specified alpha value as a weighted average.

The blended colour will have the minimum number of channels of the two input colours. For example, blending an RGB colour with an RGBA colour will result in an RGB colour.

Parameters:
  • colour1 (Iterable[Union[int, float]]) – The first colour to be blended.

  • colour2 (Iterable[Union[int, float]]) – The second colour to be blended.

  • alpha (float) – A value ranging from 0.0 (fully colour1) to 1.0 (fully colour2) that specifies the weight of the second colour in the blend. If the alpha value is outside the [0, 1] range, it will be clamped to this range.

Return type:

Iterable[Union[int, float]]

Returns:

The blended colour with the lesser number of channels of the two input colours.

qmuvi.video_generation.convert_colour_to_float(colour)[source]

Converts a colour to the float range [0, 1] used by matplotlib.

Parameters:

colour (Iterable[Union[int, float]]) – The colour to convert. This can be an iterable of ints or floats.

Return type:

Iterable[Union[int, float]]

Returns:

The converted colour, represented as an iterable of floats.

qmuvi.video_generation.convert_colour_to_uint8(colour)[source]

Converts a colour to the uint8 format used by matplotlib.

Parameters:

colour (Iterable[Union[int, float]]) – The colour to convert. This can be an iterable of ints or floats.

Return type:

Iterable[Union[int, float]]

Returns:

The converted colour, represented as an iterable of uint8s.

qmuvi.video_generation.convert_fig_pixels_to_inches(pixels)[source]

Converts a size in pixels to inches based on the dpi setting in matplotlib.

This function takes a float representing a size in pixels and returns a float representing the equivalent size in inches, based on the current dpi (dots per inch) setting for matplotlib figures.

Parameters:

pixels (float) – The size in pixels to be converted to inches.

Return type:

float

Returns:

The equivalent size in inches.

qmuvi.video_generation.ease_in(start_values, end_values, t)[source]

Interpolates between two values using an ease-in curve.

This function takes two iterables of start and end values and a float representing a time t in the range [0, 1], and performs interpolation between the two values using an ease-in curve based on the value of t. The ease-in curve starts slowly and speeds up as it approaches the end value. The result of the interpolation is an iterable of floats that is the same length as the input iterables.

Parameters:
  • start_values (Iterable[float]) – The start values for the interpolation. An iterable of floats.

  • end_values (Iterable[float]) – The end values for the interpolation. An iterable of floats.

  • t (float) – A float in the range [0, 1] that represents the time between the start and end values. If t=0, the result will be equal to the start values, if t=1, the result will be equal to the end values. If t is outside the range [0, 1], it will be clamped.

Return type:

List[float]

Returns:

A list of floats representing the result of the interpolation using an ease-in curve between the start and end values. The resulting list will have the same length as the input iterables.

qmuvi.video_generation.ease_out(start_values, end_values, t)[source]

Interpolates between two values using an ease-out curve.

This function takes two iterables of start and end values and a float representing a time t in the range [0, 1], and performs interpolation between the two values using an ease-out curve based on the value of t. The ease-out curve starts quickly and slows down as it approaches the end value. The result of the interpolation is an iterable of floats that is the same length as the input iterables.

Parameters:
  • start_values (Iterable[float]) – The start values for the interpolation. An iterable of floats.

  • end_values (Iterable[float]) – The end values for the interpolation. An iterable of floats.

  • t (float) – A float in the range [0, 1] that represents the time between the start and end values. If t=0, the result will be equal to the start values, if t=1, the result will be equal to the end values. If t is outside the range [0, 1], it will be clamped.

Return type:

List[float]

Returns:

A list of floats representing the result of the interpolation using an ease-out curve between the start and end values. The resulting list will have the same length as the input iterables.

qmuvi.video_generation.filter_blend_colours(image, colour, alpha)[source]

Applies alpha blending to each pixel in an image using a specified colour and alpha value.

This function takes an image represented as a 2D array of colours, and applies alpha blending to each individual pixel in the bitmap. The blending is done using a specified colour and alpha value, with the resulting colour being a weighted average of the original pixel colour and the specified colour. The blended colour will have the minimum number of channels of the two input colours. For example, blending an RGB colour with an RGBA colour will result in an RGB colour.

Parameters:
  • image (Iterable[Iterable[Iterable[Union[int, float]]]]) – The image to be blended.

  • colour (Iterable[Union[int, float]]) – The colour to blend with the image.

  • alpha (float) – A value ranging from 0.0 (fully pixel colour) to 1.0 (fully colour) that specifies the weight of the colour in the blend. If the alpha value is outside the [0, 1] range, it will be clamped to this range.

Return type:

Iterable[Iterable[Iterable[Union[int, float]]]]

Returns:

The filtered image, represented as a 2D array of colours.

qmuvi.video_generation.filter_colour_multiply(image, colour)[source]

Multiplies each pixel in an image with a specified colour.

This function takes an image represented as a 2D array of colours and multiplies each individual pixel in the bitmap with a specified colour. The resulting colour is obtained by multiplying the values of each colour channel of the original pixel with the corresponding values in the specified colour. The blended pixel colours will have the lesser number of channels of the two input colours. For example, blending an RGB colour with an RGBA colour will result in an RGB colour.

Parameters:
  • image (Iterable[Iterable[Iterable[Union[int, float]]]]) – The image to be filtered.

  • colour (Iterable[Union[int, float]]) – The colour to multiply with the image.

Return type:

Iterable[Iterable[Iterable[Union[int, float]]]]

Returns:

The filtered image, represented as a 2D Iterable of colours. The blended pixel colours will have the lesser number of channels of the two input colours.

qmuvi.video_generation.generate_video_from_data(quantum_circuit, output_manager, rhythm, invert_colours=False, fps=24, vpr=0.3333333333333333, smooth_transitions=True, show_measured_probabilities_only=False)[source]

Uses generated qMuVi data and wav file to generate a video (.mp4).

Parameters:
  • quantum_circuit (QuantumCircuit) – The qiskit QuantumCircuit.

  • output_manager (DataManager) – The data manager to use for saving the video and all of its pieces.

  • rhythm (Optional[List[Tuple[int, int]]]) – A list of tuples for the length and rest times of each sound in units of ticks (480 ticks is 1 second). If None, then each sound length and rest time will be set to (note_sound, rest_time) = (240, 0)

  • invert_colours (bool) – Whether to render the video in dark mode.

  • fps (int) – The frames per second of the output video.

  • vpr (Union[float, Callable[[int], float], None]) – Vertical proportion ratio. The propotion of vertical space that the circuit will occupy. Can be a float or a function that maps qubit_count (int) to float.

  • smooth_transitions (bool) – Whether to animate the plots by interpolating between qMuVi data samples. Significantly increases render time.

  • show_measured_probabilities_only (bool) – Whether to only plot the basis state probabilities.

Return type:

None

qmuvi.video_generation.invert_cmap(cmap)[source]

Inverts the colors of a Matplotlib colormap.

This function takes a Matplotlib colormap object and returns a new colormap with the colors inverted. The inverted colormap is created by subtracting the red, green, and blue components of each color from 1.0.

Parameters:

cmap (Colormap) – The colormap to invert.

Return type:

ListedColormap

Returns:

The inverted colormap as a matplotlib.colors.ListedColormap object.

qmuvi.video_generation.lerp(start_values, end_values, t)[source]

Interpolates between two iterable sequences of values using linear interpolation.

This function takes two iterables of start and end values and a float representing a time t in the range [0, 1], and performs linear interpolation between the two values based on the value of t. The result of the linear interpolation is an iterable of floats that is the same length as the input iterables.

Parameters:
  • start_values (Iterable[float]) – The start values for the linear interpolation. An iterable of floats.

  • end_values (Iterable[float]) – The end values for the linear interpolation. An iterable of floats.

  • t (float) – A float in the range [0, 1] that represents the time between the start and end values. If t=0, the result will be equal to the start values, if t=1, the result will be equal to the end values. If t is outside the range [0, 1], it will be clamped.

Return type:

List[float]

Returns:

A list of floats representing the result of the linear interpolation between the start and end values. The resulting list will have the same length as the input iterables.

qmuvi.video_generation.reverse_cmap(cmap)[source]

Reverses the order of a Matplotlib colormap.

This function takes a Matplotlib colormap object and returns a new colormap with the order of the colors reversed.

Parameters:

cmap (Colormap) – The colormap to reverse.

Return type:

ListedColormap

Returns:

The reversed colormap as a matplotlib.colors.ListedColormap object.

Module contents

qmuvi.generate_qmuvi(quantum_circuit, qmuvi_name, noise_model=None, rhythm=None, instruments=[[81, 82, 83, 84, 85, 86, 87, 88]], note_map=<function note_map_c_major_arpeggio>, invert_colours=False, fps=24, vpr=0.3333333333333333, smooth_transitions=True, log_to_file=False, show_measured_probabilities_only=False, output_dir=None)[source]

Samples the quantum circuit at every barrier and uses the state properties to create a music video (.mp4).

Parameters:
  • quantum_circuit (QuantumCircuit) – The qiskit QuantumCircuit.

  • name – The name of the qMuVi.

  • noise_model (Optional[NoiseModel]) – To sample quantum states, qMuVi uses the qiskit AerSimulator to simulate the circuits. A NoiseModel can be passed to the simulator to include noise in the computations, which is translated to the generated output in qMuVi. If None, then no noise will be used in the simulations.

  • rhythm (Optional[List[Tuple[int, int]]]) – A is a list of tuples in the form (sound_time, rest_time), one for each qmuvi sampled state in the circuit. The sound_time is how long the sound will play for and the rest_time is the wait time afterwards before playing the next sound. Times are in units of ticks where 480 ticks is 1 second. If None then each sound will be assigned (240, 0).

  • instruments (Union[List[List[int]], List[int]]) – The collections of instruments for each pure state in the mixed state (up to 8 collections) (defaults to ‘synth_lead’). Computational basis state phase determines which instrument from the collection is used.

  • note_map (Callable[[int], int]) – A callable object that maps state numbers to note numbers. The note map is used to convert the basis state numbers to the note number in the MIDI. A note number of 60 is middle C.

  • invert_colours (bool) – Whether to render the video in dark mode.

  • fps (int) – The frames per second of the output video.

  • vpr (Union[float, Callable[[int], float], None]) – Propotion of vertical space that the circuit will occupy. Can be a float or a function that maps qubit_count (int) to float.

  • smooth_transitions (bool) – Whether to smoothly animate between histogram frames. Significantly increased render time.

  • log_to_file (bool) – Whether to output the timidity synth midi conversion log files.

  • show_measured_probabilities_only (bool) – Whether to only show the total basis state measurement probability distribution in the video.

  • output_dir (str) – The output directory. If None, creates and uses a unique output folder in the working directory.

Return type:

None

Returns:

This function does not return a value. The resulting output files are saved in a folder in the current working directory.

qmuvi.generate_qmuvi_data(quantum_circuit, output_manager, noise_model=None)[source]

Samples the quantum circuit at every barrier and generates data from the state properties.

Parameters:
  • quantum_circuit (QuantumCircuit) – The qiskit QuantumCircuit.

  • output_manager (DataManager) – The DataManager object for the output folder.

  • noise_model (NoiseModel) – A qiskit NoiseModel. If None then no noise will be used in the simulations.

Return type:

Tuple[List[List[Tuple[float, Mapping[int, Tuple[float, float]], List[float], List[float]]]], List[float], List[List[float]]]

Returns:

sounds_list

a list of lists of sound data where the first index is the sample_number and the second is the pure state index in the eigendecomposition in descending order with respect to the pure_state_prob (eigenvalue). Only pure states with pure_state_prob > eps are kept. The sound data is a tuple of form: ( pure_state_prob: float, pure_state_info: Dict[int basis_state_number, Tuple[float basis_state_prob, float basis_state_angle]], # where (basis_state_prob > eps) all_basis_state_probs: List[float basis_state_prob], all_basis_state_angles: List[float basis_state_angle] ).

fidelity_list

A list of the fidelity of each of the sampled quantum states.

meas_prob_samples

A list of lists of the measurement probabilities where the first index is the sample_number and the second is the basis_state number.

qmuvi.generate_qmuvi_music(quantum_circuit, qmuvi_name, noise_model=None, rhythm=None, instruments=[[81, 82, 83, 84, 85, 86, 87, 88]], note_map=<function note_map_c_major_arpeggio>, log_to_file=False)[source]

Samples the quantum circuit at every barrier and uses the state properties to create a song (.wav).

Parameters:
  • quantum_circuit (QuantumCircuit) – The qiskit QuantumCircuit.

  • qmuvi_name (str) – The name of the qMuVi.

  • noise_model (NoiseModel) – A qiskit NoiseModel. If None then no noise will be used in the simulations.

  • rhythm (Optional[List[Tuple[int, int]]]) – A list of tuples for the sound and rest times of each played sound in units of ticks (480 ticks is 1 second). If None, then for each sample, (sound_time, rest_time) = (240, 0)

  • instruments (List[List[int]]) – The collections of instruments for each pure state in the mixed state (up to 8 collections) (defaults to ‘synth_lead’). Computational basis state phase determines which instrument from the collection is used.

  • note_map (Callable[[int], int]) – Converts state number to a note number where 60 is middle C.

  • log_to_file (bool) – Whether to output the timidity synth midi conversion log files.

qmuvi.generate_qmuvi_video(quantum_circuit, output_manager, rhythm=None, noise_model=None, note_map=<function note_map_c_major_arpeggio>, invert_colours=False, fps=60, vpr=0.3333333333333333, smooth_transitions=True, phase_marker=True, show_measured_probabilities_only=False)[source]

Samples the quantum circuit at every barrier and uses the state properties to create a silent video (.mp4). No music is generated using this method.

Parameters:
  • quantum_circuit (QuantumCircuit) – The qiskit QuantumCircuit.

  • output_manager (DataManager) – The data manager to use for saving the video and all of its pieces.

  • rhythm (Optional[List[Tuple[int, int]]]) – A list of tuples for the length and rest times of each sound in units of ticks (480 ticks is 1 second). If None, then each sound length and rest time will be set to (note_sound, rest_time) = (240, 0).

  • noise_model (NoiseModel) – qiskit NoiseModel. If None then no noise will be used in the simulations.

  • note_map (Callable[[int], int]) – Converts state number to a note number where 60 is middle C.

  • invert_colours (bool) – Whether to render the video in dark mode.

  • fps (int) – The frames per second of the output video.

  • vpr (Union[float, Callable[[int], float], None]) – Propotion of vertical space that the circuit will occupy. Can be a float or a function that maps qubit_count (int) to float.

  • smooth_transitions (bool) – Whether to smoothly animate between histogram frames. Significantly increased render time.

  • phase_marker (bool) – Whether to draw lines on the phase wheel indicating phases of the primary pure state.

qmuvi.get_instrument_collection(collection_name)[source]

Returns a list of instruments as ints defined by the General MIDI standard.

Instrument collections:

‘piano’: list(range(1,9)), ‘tuned_perc’: list(range(9,17)), ‘organ’: list(range(17,25)), ‘guitar’: list(range(25,33)), ‘bass’: list(range(33,41)), ‘strings’: list(range(41,49)), ‘ensemble’: list(range(49,57)), ‘brass’: list(range(57,65)), ‘reed’: list(range(65,73)), ‘pipe’: list(range(73,81)), ‘synth_lead’: list(range(81,89)), ‘synth_pad’: list(range(89,97)), ‘synth_effects’: list(range(97,105)), ‘ethnic’: list(range(105,113)), ‘percussive’: list(range(113,121)), ‘sound_effects’: list(range(121,128)), ‘windband’: [74,69,72,67,57,58,71,59]

Parameters:

collection_name (str) – The name of the instrument collection.

Return type:

List[int]

Returns:

A list of instruments from the given instrument collection name.