# Infinite-bash
## A 3D browser-based manifestation of our Worries Bash participatory installation available online at https://worries.io/bash

### Use a virtual stick smack a 3D rendered pinata-like sculpture on screen. A hit triggers the playback of worries the artists have been collecting from the public since the 2016 election. Coming full circle, Infinite Worries Bash is a means of reflecting, listening, and releasing anxieties as we navigate the 2020 election cycle. People are also invited to record their own worries by visiting the website on a personal device and using the “record a worry” link at the bottom right. Note: At night the sensor requires light to detect movement. Light from a smartphone or a flashlight will do the trick.

### The touchless version is on exhibit as part of Boston Cyberart's Catastrophe Cake exhibition, Oct 24th–Nov 29, 2020
https://www.bostoncyberarts.org/catastrophe-cake

## Notes

To run locally, I'm using the below command with some quick and dirty SSL certificates I generated.

http-server -S -key cert.pem

For touchless installation (webcam as motion sensor) pass in ?touchless=true but also make sure you are running https so the camera can be allowed to work: http-server -S -key cert.pem

worries manifest is generated by
ls *.mp3 > worriesmanifest.csv


MP3s are normalized and silences trimmed using dBpoweramp and these settings, available in the sound folder
-dspeffect1="Volume Normalize=-mode={qt}peak{qt} -desiredb={qt}0{qt} -maxamp={qt}8{qt} -adapt_wnd={qt}6000{qt} -fixed={qt}0{qt}" -dspeffect2="Trim Silence=-dbsilence={qt}-40{qt} -threshold={qt}50{qt}"



Sounds are converted from mp3 to flac using sox.

I'm basing it off Google's doc on sox
https://cloud.google.com/speech-to-text/docs/troubleshooting

```
sox audio.mp3 --channels=1 --bits=16 audio.flac
```
and the sox batching tutorial: https://madskjeldgaard.dk/posts/sox-tutorial-batch-processing/

I don't know how to pass in two arguments here sadly, so i'll just convert to one channel and not do the bits 16. I can't even set beats in sox with an individual file as I get an error that bits or b are not commands?

```
for file in *.mp3; do sox "$file" "$file.flac" channels 1; done
```

Speech to text for one file
```
gcloud ml speech recognize /Users/misha/Projects/pinata/infinite-bash/snd/02-13-2017_00-06_msg3.mp3.flac --language-code=en-U
```

```
for k in *.flac; do gcloud ml speech recognize "$k" --language-code en-US >> output.json; done
```

```
for k in *.flac; do gcloud ml speech recognize "$k" --language-code en-US >> output.json; done
```


transcribe.sh
```
sudo chmod 755 transcribe.sh
```

need to modify transcribe.sh to have the proper file names, a la

```
{"filename": {
  "results": [
    {
      "alternatives": [
        {
          "confidence": 0.93193746,
          "transcript": "I guess my biggest worry is just if I'm raising my daughter correctly who's 3 years old cuz I'm a single father and I do the best I can my other worry is that all my friends accept my new girlfriend"
        }
      ]
    }
  ]
},
"filename2": {
  "results": [
    {
      "alternatives": [
        {
          "confidence": 0.93193746,
          "transcript": "I guess my biggest worry is just if I'm raising my daughter correctly who's 3 years old cuz I'm a single father and I do the best I can my other worry is that all my friends accept my new girlfriend"
        }
      ]
    }
  ]
}
}
```

The transcription had to be manually fixed transcription.fixed.json
This file was generated by the troubled transcode.sh transcript
Then errors were found, such as empty objects like:
 "05-01-2018_01-47_msg157.mp3.flac":
,
Notice nothing between the : and , so manually adding empty objects using https://jsonformatter.org/json-parser

Also, the file had a missing trailing closing }, which I had to manually add

We had to batch process these a few times after the dBpoweramp (which we used to cut off some silence from front and back). The second batch process was with Wavosaur to batch pitch shift the worries with pitchproof VST plugin to achieve some decent voice obfuscation. The settings are in the backup folder name: shiftedworries5-minus-2-Wet83-Detune 85
Wavosaur failed to batch convert to mp3 due to the lack of Lame encoder on my comp. Searching around it looks like Wavosaur's lame installation instructions have been deleted form their site and users are complaining on their forum that it doesnt' work. So looking for other ways:

We then batched them again using Audacity to convert the resulting files to mp3 using export multiple as shown here: https://www.youtube.com/watch?v=VePW0fYfUso&ab_channel=FilipDelac
