https://github.com/aluriak/syne
Synesthesia for coders
https://github.com/aluriak/syne
python synesthesia
Last synced: 9 months ago
JSON representation
Synesthesia for coders
- Host: GitHub
- URL: https://github.com/aluriak/syne
- Owner: Aluriak
- Created: 2018-07-09T15:31:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-04-01T19:57:09.000Z (about 4 years ago)
- Last Synced: 2025-02-06T11:39:14.583Z (over 1 year ago)
- Topics: python, synesthesia
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkd
Awesome Lists containing this project
README
# Syne
Bring concepts of synesthesia in development.
This package is totally not complete, stable, mature nor definitive.
## soundpoints
```python
from syne import soundpoint
def func():
soundpoint()
soundpoint(duration=.5)
soundpoint()
func()
func()
```
Will play two times the three sounds associated to function func, with a longer middle sound.
The sounds are chosen following a note scale, and based on the stacktrace,
meaning that each calls in function `a` will sound differently between them
and will be the same for second call.
You can change the scale with the options:
```python
from syne import soundpoint
soundpoint.setopt(scale='C2 major')
```
See [examples](examples/soundpoint.py) for more.
### soundpoints as an extension of synepoints
In fact, soundpoints are implemented following the standard interface of Synepoint metaclass,
allowing one to define its own way to work on breakpoints.
So, do you have a programmable smell dispenser ? Robot masseur ? Arduino wired to your radiator ?
Or maybe your desktop is in an acceleration simulator ?
Use synepoints to make them work with syne and use them for debugging !
## Watch your collections (non-implemented)
With syne, you can take a look at your collections
with colors instead of values. General rules :
- same objects get the same color
- close objects get close colors
```python
from syne import syne
syne([1, 2, 3, 4])
syne(['abcd', 'abcd', 'abcde', 'ABCD'])
```
## Listen to your collections (non-implemented)
A mix of soundpoints and collection coloration.
## Coloring of sources to detect defects (non-implemented)
A parenthesis is missing ? A syntax error is raised ?
Invoke syne on your source file, and get the syntax errors highlighted :
python -m syne check-source myfile.py
# Requirements
- [musthe](https://github.com/gciruelos/musthe), for music theory (see soundpoint)
- [PyAudio](http://people.csail.mit.edu/hubert/pyaudio/), access to audio
- [numpy]() to implement some computation operations
To install these, `make install_deps`.
Other requirements:
- [pytest](https://pytest.org) for testing
Future requirements, to investigate:
- [midi](https://github.com/vishnubob/python-midi)
- [music21](http://web.mit.edu/music21/), for music theory (alternative to midi and musthe ?)
- [pyglet](https://bitbucket.org/pyglet/pyglet/wiki/Home), for colored view of collections
# FAQ
## Why *syne* ?
*Syne* is an apocope of [synesthesia](https://en.wikipedia.org/wiki/Synesthesia),
the ability to use a sense to feel another.
And its short, else no one would use it.
## Inspiration sources
- The J language, as described [here](https://prog21.dadgum.com/28.html).
- the expression «a signal, it's musical»
- [the new matplotlib colormap justification](https://www.youtube.com/watch?v=xAoljeRJ3lU)
- [the story of the sound-based dial server debugging]()