maialib 1.9.3__cp311-cp311-musllinux_1_2_i686.whl → 1.9.4__cp311-cp311-musllinux_1_2_i686.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of maialib might be problematic. Click here for more details.

@@ -1411,4 +1411,4 @@ C: ClefSign # value = <ClefSign.C: 2>
1411
1411
  F: ClefSign # value = <ClefSign.F: 1>
1412
1412
  G: ClefSign # value = <ClefSign.G: 0>
1413
1413
  P: ClefSign # value = <ClefSign.P: 3>
1414
- __version__: str = '"1.9.3"'
1414
+ __version__: str = '"1.9.4"'
@@ -282,7 +282,8 @@ def plotScoreSetharesDissonance(score: mc.Score, plotType='line', lineShape='lin
282
282
 
283
283
 
284
284
  def plotChordDyadsSetharesDissonanceHeatmap(chord: mc.Chord, numPartialsPerNote: int = 6, useMinModel: bool = True, amplCallback: Optional[Callable[[
285
- List[float]], List[float]]] = None, dissonanceThreshold: float = 0.1, dissonanceDecimalPoint: int = 2) -> Tuple[plotly.graph_objs._figure.Figure, pd.DataFrame]:
285
+ List[float]], List[float]]] = None, dissonanceThreshold: float = 0.1, dissonanceDecimalPoint: int = 2, showValues: bool = False,
286
+ valuesDecimalPlaces: int = 2) -> Tuple[plotly.graph_objs._figure.Figure, pd.DataFrame]:
286
287
  """Plot chord dyads Sethares dissonance heatmap
287
288
 
288
289
  Args:
@@ -295,6 +296,8 @@ def plotChordDyadsSetharesDissonanceHeatmap(chord: mc.Chord, numPartialsPerNote:
295
296
  amplCallback: Custom user function callback to generate the amplitude of each spectrum partial
296
297
  dissonanceThreshold (float): Dissonance threshold to skip small dissonance values
297
298
  dissonanceDecimalPoint (int): Round chord dissonance value in the plot title
299
+ showValues (bool): If True, show numerical values inside heatmap cells
300
+ valuesDecimalPlaces (int): Number of decimal places to display in cell values
298
301
 
299
302
  Returns:
300
303
  A list: [Plotly Figure, The plot data as a Pandas Dataframe]
@@ -313,30 +316,61 @@ def plotChordDyadsSetharesDissonanceHeatmap(chord: mc.Chord, numPartialsPerNote:
313
316
  numPartialsPerNote=numPartialsPerNote, useMinModel=useMinModel, amplCallback=amplCallback)
314
317
  dfFiltered = df[df.dissonance > dissonanceThreshold]
315
318
 
316
- # Pivot the dataframe to create a matrix with baseFreq on X and targetFreq on Y
319
+ # Pivot para matriz (targetFreq como linhas, baseFreq como colunas)
317
320
  matrix_df = dfFiltered.pivot(
318
- index='targetFreq', columns='baseFreq', values='dissonance')
321
+ index='targetFreq', columns='baseFreq', values='dissonance'
322
+ )
319
323
 
320
- # Create a heatmap using Plotly
321
- fig = px.imshow(matrix_df,
322
- labels=dict(x="Base Frequency (Hz)",
323
- y="Target Frequency (Hz)", color="Dissonance"),
324
- color_continuous_scale='Inferno')
324
+ # Reordena linhas e colunas para consistência
325
+ matrix_df = matrix_df.reindex(
326
+ index=sorted(matrix_df.index),
327
+ columns=sorted(matrix_df.columns)
328
+ )
325
329
 
326
- # Extract unique frequencies for x and y ticks
327
- x_ticks = sorted(matrix_df.columns.unique()) # baseFreq
328
- y_ticks = sorted(matrix_df.index.unique()) # targetFreq
330
+ # Índices para o heatmap uniforme
331
+ x_ticks = list(range(len(matrix_df.columns)))
332
+ y_ticks = list(range(len(matrix_df.index)))
329
333
 
330
- roundedXTicksValues = [round(num, 0) for num in x_ticks]
331
- roundedYTicksValues = [round(num, 0) for num in y_ticks]
334
+ # Labels reais (frequências)
335
+ x_labels = [round(v, 0) for v in matrix_df.columns]
336
+ y_labels = [round(v, 0) for v in matrix_df.index]
332
337
 
333
- fig.update_xaxes(type='linear', tickvals=x_ticks,
334
- ticktext=roundedXTicksValues)
335
- fig.update_yaxes(type='linear', tickvals=y_ticks,
336
- ticktext=roundedYTicksValues, autorange=True)
338
+ # Formatação do texto (caso showValues=True)
339
+ if showValues:
340
+ text_format = f".{valuesDecimalPlaces}f"
341
+ else:
342
+ text_format = False
343
+
344
+ # Criar heatmap com quadrados iguais
345
+ fig = px.imshow(
346
+ matrix_df.values,
347
+ labels=dict(x="Base Frequency (Hz)",
348
+ y="Target Frequency (Hz)", color="Dissonance"),
349
+ color_continuous_scale="Inferno",
350
+ origin="lower", # força o eixo Y a começar por baixo
351
+ text_auto=text_format
352
+ )
337
353
 
354
+ # Ajusta ticks para mostrar frequências reais
355
+ fig.update_xaxes(
356
+ tickmode="array",
357
+ tickvals=x_ticks,
358
+ ticktext=x_labels
359
+ )
360
+ fig.update_yaxes(
361
+ tickmode="array",
362
+ tickvals=y_ticks,
363
+ ticktext=y_labels,
364
+ )
365
+
366
+ # Mantém os quadrados sempre iguais
367
+ fig.update_yaxes(scaleanchor="x", scaleratio=1)
368
+
369
+ # Título
338
370
  roundedDissonanceValue = round(df.dissonance.sum(), dissonanceDecimalPoint)
339
371
  fig.update_layout(
340
- title=f'<b>Chord Dyads Sethares Dissonance Heatmap</b><br><i>Chord Dissonance={str(roundedDissonanceValue)}</i>', title_x=0.5)
372
+ title=f'<b>Chord Dyads Sethares Dissonance Heatmap</b><br><i>Chord Dissonance={roundedDissonanceValue}</i>',
373
+ title_x=0.5
374
+ )
341
375
 
342
376
  return fig, dfFiltered
@@ -42,7 +42,7 @@ def plotScoreSetharesDissonance(score: mc.Score, plotType: str = 'line', lineSha
42
42
  >>> ml.plotScoreSetharesDissonance(myScore, numPoints=15)
43
43
  >>> ml.plotScoreSetharesDissonance(myScore, measureStart=10, measureEnd=20)
44
44
  '''
45
- def plotChordDyadsSetharesDissonanceHeatmap(chord: mc.Chord, numPartialsPerNote: int = 6, useMinModel: bool = True, amplCallback: Callable[[list[float]], list[float]] | None = None, dissonanceThreshold: float = 0.1, dissonanceDecimalPoint: int = 2) -> tuple[plotly.graph_objs._figure.Figure, pd.DataFrame]:
45
+ def plotChordDyadsSetharesDissonanceHeatmap(chord: mc.Chord, numPartialsPerNote: int = 6, useMinModel: bool = True, amplCallback: Callable[[list[float]], list[float]] | None = None, dissonanceThreshold: float = 0.1, dissonanceDecimalPoint: int = 2, showValues: bool = False, valuesDecimalPlaces: int = 2) -> tuple[plotly.graph_objs._figure.Figure, pd.DataFrame]:
46
46
  '''Plot chord dyads Sethares dissonance heatmap
47
47
 
48
48
  Args:
@@ -55,6 +55,8 @@ def plotChordDyadsSetharesDissonanceHeatmap(chord: mc.Chord, numPartialsPerNote:
55
55
  amplCallback: Custom user function callback to generate the amplitude of each spectrum partial
56
56
  dissonanceThreshold (float): Dissonance threshold to skip small dissonance values
57
57
  dissonanceDecimalPoint (int): Round chord dissonance value in the plot title
58
+ showValues (bool): If True, show numerical values inside heatmap cells
59
+ valuesDecimalPlaces (int): Number of decimal places to display in cell values
58
60
 
59
61
  Returns:
60
62
  A list: [Plotly Figure, The plot data as a Pandas Dataframe]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maialib
3
- Version: 1.9.3
3
+ Version: 1.9.4
4
4
  Summary: A C++/Python library to manipulate sheet music data
5
5
  Home-page: https://github.com/nyckmaia/maialib
6
6
  Author: Nycholas Maia
@@ -41,12 +41,13 @@ Dynamic: summary
41
41
 
42
42
  ![Maialib CI/CD](https://github.com/nyckmaia/maialib/actions/workflows/wheels.yml/badge.svg)
43
43
 
44
- This library is a multiplatform set of musical tools that enable musical score analisys and composition in a easy and fast way. <br>
45
- The project **core** was wrote in `C++17`, but it also has a `Python` wrapper that allows a greater number of people (ie musicians not trained in IT) to also have in their hands the same power and musical tools available in `maialib`.
44
+ This library is a multiplatform set of musical tools that enable musical score analysis and composition in an easy and fast way. <br>
45
+ The project **maiacore** was written in `C++17`, but it also has a `Python` wrapper that allows a greater number of people (i.e. musicians not trained in IT) to also have in their hands the same power and musical tools available in `maialib`.<br><br>
46
+ **IMPORTANT: The maialib Python package includes all maiacore classes and functions and some additional other pure python functions. This website covers the maiacore-only classes and functions documentation, which are also present inside the maialib python package.<br>We hope to add documentation of functions written in Python to this site in the future, so that we can have complete documentation of maialib.**
46
47
 
47
48
  ## Advantages
48
49
 
49
- - Easy to use to musicians and musical researchers
50
+ - Easy to use to by musicians and musical researchers
50
51
  - High computer perfomance and fast calculations
51
52
  - Read and write musical scores (MusicXML file format)
52
53
 
@@ -56,7 +57,7 @@ The project **core** was wrote in `C++17`, but it also has a `Python` wrapper th
56
57
  pip install maialib
57
58
  ```
58
59
 
59
- Or, if you have a older `maialib` version installed on your system, please get the latest version running: `pip install maialib --upgrade`
60
+ Or, if you have an older `maialib` version installed on your system, please get the latest version running: `pip install maialib --upgrade`
60
61
 
61
62
  ## Get Started
62
63
 
@@ -87,16 +88,23 @@ You can easily export your music files to these file formats above from score ed
87
88
  - Finale
88
89
  - Others
89
90
 
90
- Many `MusicXML` files are avaliable for free in the internet for download.
91
+ Many `MusicXML` files are avaliable for free in the Internet for download.
91
92
 
92
93
  ### 2) What can I do if I don't have a `*.xml` file of my target music?
93
94
 
94
- - First, make shure and look at different websites and online repositories trying to find the `*.xml` file
95
- - You can find on the internet the desired MIDI file and import it in a score editor (like MuseScore, Sibelius, Finale, etc.) and then export the `MusicXML` file from it
96
- - You can use scan the sheet music paper and get a PDF version of it, so:
97
- - You can use a OMR software to try to convert the PDF file into a `*.xml` file
98
- - You can pay for other people to type manually note-by-note the PDF into a musical software (link MuseScore, Sibelius, Finale, etc.)
99
- - You can type manually note-by-note the music paper into a musical software (link MuseScore, Sibelius, Finale, etc.)
95
+ - First, make sure, and look at different websites and online repositories trying to find the `*.xml` (or `*.musicxml` or `*.mxl`) file.
96
+ - After that, you can try these 4 options below:
97
+ - Find on the internet the desired MIDI file and import it in a score editor (like MuseScore, Sibelius, Finale, etc.) and then export the `MusicXML` file from it
98
+ - Scan the sheet music paper and get a PDF version of it, and after that, use a OMR software to try to convert the PDF file into a `*.xml` file:
99
+ - [MuseScore Import - Experimental](https://musescore.com/import)
100
+ - [ACE Studio PDF to MusicXML Converter](https://acestudio.ai/pdf-to-musicxml/)
101
+ - [Sibelius PhotoScore](https://www.avid.com/photoscore-and-notateme-lite)
102
+ - [ScanScore](https://scan-score.com/en/)
103
+ - [SmartScore 64 NE](https://www.musitek.com/)
104
+ - [Melogen AI](https://melogenai.com/)
105
+ - [PDFtoMusic](https://www.myriad-online.com/en/products/pdftomusic.htm)
106
+ - Pay for other people to type manually note-by-note the PDF into a musical software (link MuseScore, Sibelius, Finale, etc.)
107
+ - Type manually note-by-note the music paper into a musical software (link MuseScore, Sibelius, Finale, etc.)
100
108
 
101
109
  ## Documentation (in development)
102
110
 
@@ -109,7 +117,7 @@ This project have 2 documentation levels. One for each user type:
109
117
 
110
118
  You can explore `maialib` features looking at `python-tutorial` folder ([link here](https://github.com/nyckmaia/maialib/tree/main/python-tutorial)). <br>
111
119
  There you will learn how to use and mix `maialib` classes and functions to reach your musical goals
112
- If you are starting, please check these 3 basic `maialib` Python tutorials:
120
+ If you are starting out, please check these 3 basic `maialib` Python tutorials:
113
121
 
114
122
  - [Create Notes and Chords](https://github.com/nyckmaia/maialib/blob/main/python-tutorial/create_notes_chords.ipynb)
115
123
  - [Create a Score](https://github.com/nyckmaia/maialib/blob/main/python-tutorial/create_score.ipynb)
@@ -122,7 +130,7 @@ If you are starting, please check these 3 basic `maialib` Python tutorials:
122
130
  ## VS Code Users
123
131
 
124
132
  - You can write your Python scripts using `*.py` or `*.ipynb` file extensions.
125
- - If you decide to use `*.ipynb` extension, make shure to install `nbformat` Python package to enable visualize maialib graphs on VS Code editor.
133
+ - If you decide to use `*.ipynb` extension, make sure to install `nbformat` Python package to enable visualize maialib graphs on VS Code editor.
126
134
  To do that: `pip install nbformat --upgrade`
127
135
 
128
136
  ---
@@ -195,7 +203,7 @@ Nycholas Maia - nyckmaia@gmail.com
195
203
  ## Contributing
196
204
 
197
205
  - Fork this project
198
- - Make your custumizations and improvments
206
+ - Make your custumizations and improvements
199
207
  - Please, send me a pull request
200
208
 
201
209
  ## License
@@ -1,28 +1,28 @@
1
- maialib.libs/libgcc_s-f3fb5a36.so.1,sha256=SrjjCCuY7RHj-T9JLrY9XFMgCCpYD9Qmezr4uoJGVEQ,168321
2
- maialib.libs/libstdc++-d2a021ba.so.6.0.32,sha256=1zr_iwGwEBe95gyKdgiw7C4Y1RR9ijV40j66rk4elzg,3537349
3
- maialib-1.9.3.dist-info/WHEEL,sha256=6ltumPE74Em2X1OXYv5iIjaGYcDTCG-wPLy9Dk1DJEw,110
4
- maialib-1.9.3.dist-info/top_level.txt,sha256=sZWQaa-Up2ba00WpAxBhOLKM6qQYTpUKJMXgSE0Nc48,17
5
- maialib-1.9.3.dist-info/RECORD,,
6
- maialib-1.9.3.dist-info/METADATA,sha256=ZpFURN3SsymOdfGxulYmfC0vfXzktlYSQV17P0rg9uc,7326
7
- maialib-1.9.3.dist-info/licenses/LICENSE.txt,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
1
+ maialib-1.9.4.dist-info/RECORD,,
2
+ maialib-1.9.4.dist-info/METADATA,sha256=jjXyj5vzdpZ3R-ewGUGVVS87DFNWMK_sUr-piuLu3cc,8265
3
+ maialib-1.9.4.dist-info/top_level.txt,sha256=sZWQaa-Up2ba00WpAxBhOLKM6qQYTpUKJMXgSE0Nc48,17
4
+ maialib-1.9.4.dist-info/WHEEL,sha256=6ltumPE74Em2X1OXYv5iIjaGYcDTCG-wPLy9Dk1DJEw,110
5
+ maialib-1.9.4.dist-info/licenses/LICENSE.txt,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
8
6
  maialib/setup.py,sha256=1Cbv0DfEUNK1EQHb64-1B0rwbRrsTSnJBY8fVn8gtbU,2168
9
7
  maialib/__init__.py,sha256=qiIEL1ZDvpDK0bkGUdZRib3bG973EtKQDFYPFfvJKQA,122
10
- maialib/xml-scores-examples/Mahler_Symphony_8_Finale.mxl,sha256=F2-QBKNYjBv_sWT-z4LWi1rX84-P3msxtl-g6joA2FQ,229034
11
- maialib/xml-scores-examples/Beethoven_Symphony_5_mov_1.xml,sha256=iZ2uqqHWMkDtmQVKovT-H_-zZp1SixASi1R7L3TmuOI,4775525
12
- maialib/xml-scores-examples/Chopin_Fantasie_Impromptu.mxl,sha256=HkouQ_4bI6XDoGmzJITuU81CzQZE2lQjwl6WNlfZmJA,35727
13
8
  maialib/xml-scores-examples/Strauss_Also_Sprach_Zarathustra.mxl,sha256=nOQra05RHHDe_dXFs5WBJG2l9R1KQk64urV7lWYC2vw,18863
14
9
  maialib/xml-scores-examples/Bach_Cello_Suite_1.mxl,sha256=0XGNlcW8o0W7kkeG8j2V_M4eggdOnrxvvvCkpf6x_z4,29622
10
+ maialib/xml-scores-examples/Chopin_Fantasie_Impromptu.mxl,sha256=HkouQ_4bI6XDoGmzJITuU81CzQZE2lQjwl6WNlfZmJA,35727
11
+ maialib/xml-scores-examples/Mahler_Symphony_8_Finale.mxl,sha256=F2-QBKNYjBv_sWT-z4LWi1rX84-P3msxtl-g6joA2FQ,229034
15
12
  maialib/xml-scores-examples/Mozart_Requiem_Introitus.mxl,sha256=_wc4hMaPhtgocUoL94uVzfVN3TGb08z8Xa2BL4SHfgA,91112
13
+ maialib/xml-scores-examples/Beethoven_Symphony_5_mov_1.xml,sha256=iZ2uqqHWMkDtmQVKovT-H_-zZp1SixASi1R7L3TmuOI,4775525
16
14
  maialib/xml-scores-examples/Dvorak_Symphony_9_mov_4.mxl,sha256=s7FGUEmFmgcIdmkZ-bv4sOGGj5HYKc2nc760V79DMtM,261438
17
- maialib/maiacore/maiacore.pyi,sha256=_GCkvy9-47ImOn7GbAm-wr0N5AYKSDcHU9LVJaBfbyE,48416
15
+ maialib/maiacore/maiacore.pyi,sha256=nQkrQ-uQjpoYY275mnJGtqP42rLvGLasBFPtylYN3tM,48416
18
16
  maialib/maiacore/__init__.pyi,sha256=cJfflEKHJ6BPUTlDQt95xZmi2N3zwHJkHEXy27fBd5c,1282
19
- maialib/maiacore/maiacore.cpython-311-i386-linux-musl.so,sha256=X-6VzPIhIZt6UPxh-aHaHLNW7d57hcS-7T1d091jeqM,5676517
17
+ maialib/maiacore/maiacore.cpython-311-i386-linux-musl.so,sha256=F53oJHakTANoRL5RN1j9SW-9o4KArvBeYqMFeo4ON6I,5676517
20
18
  maialib/maiacore/__init__.py,sha256=IW7E0LuzAttsn0b37SEthCA0LKuzSgkepSpq8DWExYQ,77
19
+ maialib/maiapy/plots.py,sha256=sg6W2OjzZNl8vEVy91URn1nFhfrlRHzXoBkvd4hoZXo,23680
20
+ maialib/maiapy/sethares_dissonance.pyi,sha256=T9rHlpeIao3gEelFJGa8690Tsd1DPzGmToMF_YJ3cNg,3828
21
+ maialib/maiapy/sethares_dissonance.py,sha256=4PZEx_K5DLFOuDuq6ElKM0N97BjDT3XFX47lXeto-iU,13741
22
+ maialib/maiapy/other.pyi,sha256=jEmAc-MDc3iMA2-5hp41RLgNrfBQRMvq-sF2_pexhbo,2163
21
23
  maialib/maiapy/__init__.pyi,sha256=L8YtZYJMw_9TrdejcKs2c5xTbu5WMRwlHhKz6Qzulf8,77
22
24
  maialib/maiapy/other.py,sha256=4LjETHcpDpNRjSYIbMW_9CuRZTymuoAzog_L3CkYDA0,4345
23
- maialib/maiapy/__init__.py,sha256=L8YtZYJMw_9TrdejcKs2c5xTbu5WMRwlHhKz6Qzulf8,77
24
- maialib/maiapy/other.pyi,sha256=jEmAc-MDc3iMA2-5hp41RLgNrfBQRMvq-sF2_pexhbo,2163
25
25
  maialib/maiapy/plots.pyi,sha256=nRNUQ9h9kjJHTdbQt4eXv933MOx7TIztIg-inThglB4,3620
26
- maialib/maiapy/sethares_dissonance.pyi,sha256=O8D_cYRPCE1K5Zw54ckg3I5frULcBGgs_di_bTOpuBU,3609
27
- maialib/maiapy/plots.py,sha256=sg6W2OjzZNl8vEVy91URn1nFhfrlRHzXoBkvd4hoZXo,23680
28
- maialib/maiapy/sethares_dissonance.py,sha256=M1g9IchSEXREPxez5wsSX14Y1yyuAxXbdmXJNLrO00s,12969
26
+ maialib/maiapy/__init__.py,sha256=L8YtZYJMw_9TrdejcKs2c5xTbu5WMRwlHhKz6Qzulf8,77
27
+ maialib.libs/libgcc_s-f3fb5a36.so.1,sha256=SrjjCCuY7RHj-T9JLrY9XFMgCCpYD9Qmezr4uoJGVEQ,168321
28
+ maialib.libs/libstdc++-d2a021ba.so.6.0.32,sha256=1zr_iwGwEBe95gyKdgiw7C4Y1RR9ijV40j66rk4elzg,3537349