james-trayford / strauss

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

samplefunc = self.samples[params['note']] KeyError: 'F6' #15

Open johnp39 opened 8 months ago

johnp39 commented 8 months ago

Hi! When running your PlanetaryOrbits python program I have encountered the following problem play generator.py", line 672, in play samplefunc = self.samples[params['note']] KeyError: 'F6'

This occurs within PyCharm or terminal.

Would you please have a look at this please, for me.

Thank you.

John

james-trayford commented 8 months ago

Hi @johnp39 - I think this may be coming about because of where you are running the notebook example - this error usually comes up due to not finding the samples to read in. The line:

sampler = Sampler("../data/samples/solar_system")

in the notebook is a relative path, so running outside the example directory will not find the samples.

Looking a bit more, there may be other aspects of this example that is broken, due to changes in the sample read routine. I am looking to patch that here: https://github.com/james-trayford/strauss/pull/16 .

once the above changes are merged, I'll let you know and this example should run as expected in the latest main branch version, thanks for bringing it to my attention!