james-trayford / strauss

Sonification Tools and Resources for Analysis Using Sound Synthesis
Apache License 2.0
33 stars 4 forks source link

notebook examples. #27

Open GabrieleBattaglia opened 2 months ago

GabrieleBattaglia commented 2 months ago

Hi. In the docs I read: "Here, we explain some of the example sonfications included in the examples/ directory of the Strauss repo. These are all in Python Notebook (.ipynb) format." I guess this tool could be particularly useful to the blind people. Well, I'm blind and I can't use Notebook due to its lack of accessibility. I wonder just why you choose this format to give examples, or, at least, why this format only??? I couldn't play these examples and I have not so many other stuff to study on. So my request is to give a copy of examples also in a very simple and nice .py format, please. Thanks.

james-trayford commented 2 months ago

Hi, @GabrieleBattaglia Thanks for your interest in strauss. We're aware of the accessibility limitations of python notebooks, so we do indeed now provide all the examples in accompanying .py files, here: https://github.com/james-trayford/strauss/tree/main/examples. The documentation should reflect that, so needs to be updated, thanks for bringing it to our attention!

These examples are not interactive in the same way, but it should be easier to parse the code. This uses the sounddevice library that connects directly to your sound device so you can code and play sonifications from the command-line.

We've had mixed feedback about the accessibility of notebooks, but know the screen reader experience can be poor. Notebooks allow us to provide more interactive examples and use the media playback capabilities that can help us reduce barriers to entry for less technical users, but of course are inaccessible in other aspects. Ultimately we hope notebooks are made an accessible format, though it's not clear when this will happen. If you're interested there are some collaborations thinking about this, see e.g. https://github.com/iota-school/notebooks-for-all

james-trayford commented 2 months ago

The 1D data series sonification may be a good place to start: https://github.com/james-trayford/strauss/blob/main/examples/SonifyingData1D.py

Keen to hear about your experience and any more questions/issues you have as a blind user, so please let us know!

GabrieleBattaglia commented 2 months ago

Trying the .py examples I have this traceback. Could you please help me to understand what's wrong? Traceback (most recent call last):
File "E:\git\Others\strauss\examples\SonifyingData1D.py", line 64, in
generator = Synthesizer()
^^^^^^^^^^^^^
File "C:\Users\Utente\AppData\Local\Programs\Python\Python311\Lib\site-packages\strauss\generator.py", line 381, in init
self.preset = getattr(presets, self.gtype).load_preset()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Utente\AppData\Local\Programs\Python\Python311\Lib\site-packages\strauss\presets\synth__init.py", line 25, in load_preset
return read_yaml(filename)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Utente\AppData\Local\Programs\Python\Python311\Lib\site-packages\strauss\presets\synth\
init__.py", line 7, in read_yaml
with open(filename, 'r') as fdata:
^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/default.yml'

e:\git\Others\strauss\examples>

I'm under Win11, Python 3.11

james-trayford commented 2 months ago

Hi @GabrieleBattaglia - it looks like there are some windows-specific problems that are causing the error. I think we've isolated the issue so thanks for sending that through, and I'll let you know when that's fixed

GabrieleBattaglia commented 2 months ago

Thank you.

james-trayford commented 1 month ago

Hi @GabrieleBattaglia, this should hopefully work for you in the latest strauss v0.2.0 - You can update with pip pip install strauss -U and/or update the repository with git pull origin main- please let us know if you have any issues - we are not native windows users but have tested that the examples are working in a local windows setup.