Name | music JSON |
Version |
1.0.0b5
JSON |
| download |
home_page | None |
Summary | Extreme-fidelity synthesis of musical elements, based on the MASS framework |
upload_time | 2024-06-10 14:30:41 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.0 |
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. |
keywords |
acoustics
am
art
audio
campanology
change ringing
filter
fm
hrtf
lut
mass
multimedia
music
noise
pcm
permutation
physics
psychophysics
signal processing
sing
sound
spatialization
speech
synth
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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)](https://github.com/ttm/mass/) 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](https://github.com/ttm/mass/raw/master/doc/article.pdf).
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.
* **Speech and singing interfaces** available to synthesize voices.
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](https://github.com/ttm/percolation) and [Participation](https://github.com/ttm/participation) for harnessing open linked social data, or with [audiovisual analytics vocabulary and ontology (AAVO)](https://github.com/ttm/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](https://github.com/ttm/music/blob/master/requirements.txt).
To use the singing interface you'll also nead eSpeak, SoX, and abcMIDI, while MIDI.pm and FFT.pm are needed by eCantorix to synthesize singing sequences.
#### Linux
On Ubuntu everything can be installed with:
```console
sudo apt install espeak sox abcmidi
sudo cpan install MIDI
sudo cpan install Math::FFT
```
<!-- TODO: add instructions for other distros -->
#### macOS
On macOS you can first install [Homebrew](https://brew.sh/), and then:
```console
brew install espeak sox abcmidi perl
cpan install MIDI
cpan install Math::FFT
```
<!-- TODO: add instructions for Windows -->
## Examples
Inside [the examples folder](https://github.com/ttm/music/tree/master/examples) you can find some scripts that use the main features of Music.
## 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 and writing WAV files, 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.
* **singing** for singing with eCantorix. While it's not properly documented, and it might need some tweaks, it's working. Speech is currently achieved through espeak in the most obvious way, using os.system as in:
* [Penalva](https://github.com/ttm/penalva/blob/master/penalva.py)
* [Lunhani](https://github.com/ttm/lunhani/blob/master/lunhani.py)
* [Soares](https://github.com/ttm/soares/blob/master/soares.py)
* **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.
## 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 ./
sound_waves = music.legacy.songs.madame_z(render=False) # return numpy array
sound_waves2 = music.core.io.open("demosong2.wav") # numpy array
music = music.remix(sound_waves, soundwaves2)
music_ = music.horizontal_stack(sound_waves[:44100*2], music[len(music)/2::2])
music.core.io.write_wav_mono(music_)
```
## Coding conventions
The code follows [PEP 8 conventions](https://peps.python.org/pep-0008/).
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](https://github.com/ttm/versinus), an animated visualization method for evolving networks that uses Music to render the musical track that represents networks structures.
:::
Raw data
{
"_id": null,
"home_page": null,
"name": "music",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.0",
"maintainer_email": null,
"keywords": "acoustics, AM, art, audio, campanology, change ringing, filter, FM, HRTF, LUT, MASS, multimedia, music, noise, PCM, permutation, physics, psychophysics, signal processing, sing, sound, spatialization, speech, synth",
"author": null,
"author_email": "Renato Fabbri <renato.fabbri@gmail.com>, Jacopo Donati <jacopo.donati@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/5d/6c/1ec7f2fbf29160a1f91c144762be1f93d2b7b8cbbb429144521714707a34/music-1.0.0b5.tar.gz",
"platform": null,
"description": "# Music\n\nMusic is a python package to generate and manipulate music and sounds. It's written using the [MASS (Music and Audio in Sample Sequences)](https://github.com/ttm/mass/) framework, a collection of psychophysical descriptions of musical elements in LPCM audio through equations and corresponding Python routines.\n\nTo have a further understanding of the routines you can read the article\n[Musical elements in the discrete-time representation of sound](https://github.com/ttm/mass/raw/master/doc/article.pdf).\n\nIf you use this package, please cite the forementioned article.\n\n## Core features\n\nThe precision of Music makes it the perfect choice for many scientific uses. At its core there are a few important features:\n\n* **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.\n* **Musical structures** with emphasis in symmetry and discourse.\n* **Speech and singing interfaces** available to synthesize voices.\n\nMusic can be used alone or with other packages, and it's ideal for audiovisualization of data. For example, it can be used with [Percolation](https://github.com/ttm/percolation) and [Participation](https://github.com/ttm/participation) for harnessing open linked social data, or with [audiovisual analytics vocabulary and ontology (AAVO)](https://github.com/ttm/aavo).\n\n## How to install\n\nTo install music you can either install it directly with `pip`:\n\n```console\npip3 install music\n```\n\nor you can clone this repository and install it from there:\n\n```console\ngit clone https://github.com/ttm/music.git\npip3 install -e <path_to_repo>\n```\n\nThis install method is especially useful when reloading the modified module in subsequent runs of music, and for greater control of customization, hacking and debugging.\n\n### Dependencies\n\nEvery dependency is installed by default by `pip`, but you can take a look at [requirements.txt](https://github.com/ttm/music/blob/master/requirements.txt).\n\nTo use the singing interface you'll also nead eSpeak, SoX, and abcMIDI, while MIDI.pm and FFT.pm are needed by eCantorix to synthesize singing sequences.\n\n#### Linux\n\nOn Ubuntu everything can be installed with:\n\n```console\nsudo apt install espeak sox abcmidi\nsudo cpan install MIDI\nsudo cpan install Math::FFT\n```\n\n<!-- TODO: add instructions for other distros -->\n\n#### macOS\n\nOn macOS you can first install [Homebrew](https://brew.sh/), and then:\n\n```console\nbrew install espeak sox abcmidi perl\ncpan install MIDI\ncpan install Math::FFT\n```\n\n<!-- TODO: add instructions for Windows -->\n\n## Examples\n\nInside [the examples folder](https://github.com/ttm/music/tree/master/examples) you can find some scripts that use the main features of Music.\n\n## Package structure\n\nThe modules are:\n\n* **core**:\n * **synths** for synthesization of notes (including vibratos, glissandos, etc.), noises and envelopes.\n * **filters** for the application of filters such as ADSR envelopes, fades, IIR and FIR, reverb, loudness, and localization.\n * **io** for reading and writing WAV files, both mono and stereo.\n * **functions** for normalization.\n* **structures** for higher level musical structures such as permutations (and related to algebraic groups and change ringing peals), scales, chords, counterpoint, tunings, etc.\n* **singing** for singing with eCantorix. While it's not properly documented, and it might need some tweaks, it's working. Speech is currently achieved through espeak in the most obvious way, using os.system as in:\n * [Penalva](https://github.com/ttm/penalva/blob/master/penalva.py)\n * [Lunhani](https://github.com/ttm/lunhani/blob/master/lunhani.py)\n * [Soares](https://github.com/ttm/soares/blob/master/soares.py)\n* **legacy** for musical pieces that are rendered with the Music package and might be used as material to make more music.\n* **tables** for the generation of lookup tables for some basic waveform.\n* **utils** for various functions regarding conversions, mix, etc.\n\n## Roadmap\n\nMusic is stable but still very young. We didn't have the opportunity yet to make Music all we want it to be.\n\nHere is one example of what we're aiming at:\n\n```python\nimport music\n\nmusic.render_demos() # render some wav files in ./\n\nmusic.legacy.experiments.cristal2(.2, 300) # wav of sonic structure in ./\n\nsound_waves = music.legacy.songs.madame_z(render=False) # return numpy array\n\nsound_waves2 = music.core.io.open(\"demosong2.wav\") # numpy array\n\nmusic = music.remix(sound_waves, soundwaves2)\nmusic_ = music.horizontal_stack(sound_waves[:44100*2], music[len(music)/2::2])\n\nmusic.core.io.write_wav_mono(music_)\n\n```\n\n## Coding conventions\n\nThe code follows [PEP 8 conventions](https://peps.python.org/pep-0008/).\n\nFor a better understanding of each function, the math behind it and see examples of their use, you can read their docstring.\n\n## Further information\n\nMusic is primarily intended for artistic use, but was also designed to run psychophysics experiments and data sonification.\n\nYou can find an example in [Versinus](https://github.com/ttm/versinus), an animated visualization method for evolving networks that uses Music to render the musical track that represents networks structures.\n\n:::\n",
"bugtrack_url": null,
"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.",
"summary": "Extreme-fidelity synthesis of musical elements, based on the MASS framework",
"version": "1.0.0b5",
"project_urls": {
"Homepage": "https://github.com/ttm/music",
"Issues": "https://github.com/ttm/music/issues"
},
"split_keywords": [
"acoustics",
" am",
" art",
" audio",
" campanology",
" change ringing",
" filter",
" fm",
" hrtf",
" lut",
" mass",
" multimedia",
" music",
" noise",
" pcm",
" permutation",
" physics",
" psychophysics",
" signal processing",
" sing",
" sound",
" spatialization",
" speech",
" synth"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2db95215479b532b5e4a30f07b64d74f4b8c54b6ea227826d2abbd2a667f6155",
"md5": "eae0f341728218092bee06e6dccdaed5",
"sha256": "5f8f814d942b2f3350d8797a977bf3802d5fcd5fb409796d721c526138cc2d32"
},
"downloads": -1,
"filename": "music-1.0.0b5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "eae0f341728218092bee06e6dccdaed5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.0",
"size": 61228,
"upload_time": "2024-06-10T14:30:39",
"upload_time_iso_8601": "2024-06-10T14:30:39.389110Z",
"url": "https://files.pythonhosted.org/packages/2d/b9/5215479b532b5e4a30f07b64d74f4b8c54b6ea227826d2abbd2a667f6155/music-1.0.0b5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5d6c1ec7f2fbf29160a1f91c144762be1f93d2b7b8cbbb429144521714707a34",
"md5": "255013d831ba14b920817b55be776453",
"sha256": "68c4d4651dbf743901653f3e58abd738fe64cbc7cacaf683f67521d7752a68f4"
},
"downloads": -1,
"filename": "music-1.0.0b5.tar.gz",
"has_sig": false,
"md5_digest": "255013d831ba14b920817b55be776453",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.0",
"size": 51158,
"upload_time": "2024-06-10T14:30:41",
"upload_time_iso_8601": "2024-06-10T14:30:41.737307Z",
"url": "https://files.pythonhosted.org/packages/5d/6c/1ec7f2fbf29160a1f91c144762be1f93d2b7b8cbbb429144521714707a34/music-1.0.0b5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-10 14:30:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ttm",
"github_project": "music",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "music"
}