Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.9%) to scientific vocabulary
Repository
music is a python package for making sounds and music
Basic Info
- Host: GitHub
- Owner: ttm
- License: mit
- Language: Python
- Default Branch: master
- Size: 292 KB
Statistics
- Stars: 57
- Watchers: 3
- Forks: 11
- Open Issues: 10
- Releases: 0
Metadata Files
README.md
Music
Music is a python package to generate and manipulate music and sounds. It's written using the MASS (Music and Audio in Sample Sequences) framework, a collection of psychophysical descriptions of musical elements in LPCM audio through equations and corresponding Python routines.
To have a further understanding of the routines you can read the article Musical elements in the discrete-time representation of sound.
If you use this package, please cite the forementioned article.
Core features
The precision of Music makes it the perfect choice for many scientific uses. At its core there are a few important features:
- Sample-based synth, meaning that the state is updated at each sample. For example, when we have a note with a vibrato, each sample is associated to a different frequency. By doing this the synthesized sound is the closest it can be to the mathematical model that describes it.
Musical structures with emphasis in symmetry and discourse.
play_audio utility to listen to generated sounds without saving files. Music can be used alone or with other packages, and it's ideal for audiovisualization of data. For example, it can be used with Percolation and Participation for harnessing open linked social data, or with audiovisual analytics vocabulary and ontology (AAVO).
How to install
To install music you can either install it directly with pip:
console
pip3 install music
or you can clone this repository and install it from there:
console
git clone https://github.com/ttm/music.git
pip3 install -e <path_to_repo>
This install method is especially useful when reloading the modified module in subsequent runs of music, and for greater control of customization, hacking and debugging.
Dependencies
Every dependency is installed by default by pip, but you can take a look at requirements.txt.
Testing
The packages required to run the test suite are available via the dev
extras defined in pyproject.toml. Install them with:
console
pip install -e '.[dev]'
You can then run the tests using pytest:
console
pytest
Type checking
Install the development dependencies and run mypy to perform static type
analysis:
console
pip install -e '.[dev]'
mypy music
Examples
Inside the examples folder you can find some scripts that use the main features of Music.
- chromatic_scale: writes twelve notes into a WAV file from a sequence of frequencies.
- penta_effects: writes a pentatonic scale repeated once clean, once with pitch, one with vibrato, one with Doppler, and one with FM, into a WAV stereo file.
- noisy: writes into a WAV file a sequence of different noises.
- thirty_notes and thirtynumpynotes generate a sequence of sounds by using a synth class (in this case the class
Being). - campanology and geometric_music both use
Beingas their synth, but this time with permutations. - isynth also uses a synth class, but of a different kind,
IteratorSynth, that iterates through arbitrary lists of variables. - singing_demo: demonstrates
music.singing.setup_engine()andmusic.singing.make_test_song()to render a short sung phrase. - binaural_beats: generates binaural beats using two pure tones with tremolo for relaxation or focus.
- The
music.singingmodule provides basic text-to-speech utilities. Runmusic.singing.setup_engine()once to clone the eCantorix engine before using these features.
Package structure
The modules are:
- core:
- synths for synthesization of notes (including vibratos, glissandos, etc.), noises and envelopes.
- filters for the application of filters such as ADSR envelopes, fades, IIR and FIR, reverb, loudness, and localization.
- io for reading, writing and playing audio, both mono and stereo.
- functions for normalization.
- structures for higher level musical structures such as permutations (and related to algebraic groups and change ringing peals), scales, chords, counterpoint, tunings, etc.
- legacy for musical pieces that are rendered with the Music package and might be used as material to make more music.
- tables for the generation of lookup tables for some basic waveform.
- utils for various functions regarding conversions, mix, etc.
- sequencer for scheduling notes into a timeline and exporting audio.
Roadmap
Music is stable but still very young. We didn't have the opportunity yet to make Music all we want it to be.
Here is one example of what we're aiming at:
```python import music
music.render_demos() # render some wav files in ./
music.legacy.experiments.cristal2(.2, 300) # wav of sonic structure in ./
soundwaves = music.legacy.songs.madamez(render=False) # return numpy array
sound_waves2 = music.core.io.open("demosong2.wav") # numpy array
music = music.remix(soundwaves, soundwaves2) music = music.horizontalstack(soundwaves[:44100*2], music[len(music)/2::2])
music.core.io.writewavmono(music_)
```
Coding conventions
The code follows PEP 8 conventions.
For a better understanding of each function, the math behind it and see examples of their use, you can read their docstring.
Further information
Music is primarily intended for artistic use, but was also designed to run psychophysics experiments and data sonification.
You can find an example in Versinus, an animated visualization method for evolving networks that uses Music to render the musical track that represents networks structures.
:::
Owner
- Name: rfabbri
- Login: ttm
- Kind: user
- Company: IFSC-USP, Juntadados, Nós Digitais, CDTL, ICMC/USP
- Website: ttm.github.io
- Repositories: 86
- Profile: https://github.com/ttm
GitHub Events
Total
- Issues event: 1
- Watch event: 5
- Issue comment event: 2
- Push event: 40
- Pull request review event: 3
- Pull request review comment event: 5
- Pull request event: 37
- Fork event: 1
- Create event: 18
Last Year
- Issues event: 1
- Watch event: 5
- Issue comment event: 2
- Push event: 40
- Pull request review event: 3
- Pull request review comment event: 5
- Pull request event: 37
- Fork event: 1
- Create event: 18
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Renato Fabbri | r****i@g****m | 38 |
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 15
- Total pull requests: 7
- Average time to close issues: over 1 year
- Average time to close pull requests: 3 months
- Total issue authors: 10
- Total pull request authors: 4
- Average comments per issue: 1.87
- Average comments per pull request: 0.14
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 0
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 1
Top Authors
Issue Authors
- ttm (6)
- dgervini (1)
- sophia-corvaia (1)
- codepiet (1)
- RomeoAvagyan (1)
- sucrecacao (1)
- elebur (1)
- marcellonepitone (1)
- malukus (1)
Pull Request Authors
- ttm (23)
- jacopodonati (7)
- ksylvan (2)
- dependabot[bot] (2)
- TranscriptionFactory (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 1,069 last-month
- Total dependent packages: 0
- Total dependent repositories: 15
- Total versions: 22
- Total maintainers: 1
pypi.org: music
Extreme-fidelity synthesis of musical elements, based on the MASS framework
- Homepage: https://github.com/ttm/music
- Documentation: https://music.readthedocs.io/
- License: MIT License Copyright (c) 2024 Renato Fabbri Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 1.0.0b5
published about 2 years ago
Rankings
Maintainers (1)
Dependencies
- colorama >= 0.4.6
- matplotlib >= 3.7.1
- numpy >= 1.26.4
- scipy >= 1.12.0
- symp >= 1.12
- termcolor >= 2.4.0
- colorama ==0.4.6
- matplotlib ==3.7.1
- numpy ==1.26.4
- percolation ==0.2.dev0
- scipy ==1.12.0
- setuptools ==69.0.2
- sympy ==1.12
- termcolor ==2.4.0