Skip to content

Instantly share code, notes, and snippets.

@residuum
Last active November 16, 2018 20:02
Show Gist options
  • Save residuum/5339a4df54dda2329c72200f9cabd639 to your computer and use it in GitHub Desktop.
Save residuum/5339a4df54dda2329c72200f9cabd639 to your computer and use it in GitHub Desktop.
Life Soundtrack Development Notes

Life Soundtrack

Idea

  • Android sound app that changes over time

Technology

Apps with the same technology

Current State

In the Github repository, there is folder "pd" that contains the Pd patches. For running, you must open patch.pd and controller.pd in one instance of Pd, and then set a BPM rate via controller.pd and click the bang on the bottom right to load the samples and initialize the RNG. If [time] object cannot be instantiated, no problem, but the random numbers will be in the same sequence every time.

Step detector liftet from https://github.com/SecUSo/privacy-friendly-pedometer/blob/master/app/src/main/java/org/secuso/privacyfriendlyactivitytracker/services/AccelerometerStepDetectorService.java

  • Duration between steps are used to calculate BPM, clamped between 60 and 200 BPM (Weighted average of last 10 steps)
  • 5 different layers (bass drum, pseudo-tom with frequency changed by sine LFO, 2 synths, loop/break player)
  • every 4 beats, a parameter is changed (e.g. bass drum pattern, bass drum sound, sample fo loop player)
  • every 8 beats, a layer is switched on or off, at least two are always playing
  • State is saved to database and restored on restart
  • Basic sound app functions:
    • Pauses on phone call and restarts after
    • Keeps running in the background, when minimized
    • Notification icon, when sound is generated

Puredata

The logic for Puredata is in the Github repository in the folder "pd". Load "patch.pd" and "controller.pd" in an instance of Pd (https://puredata.info ), set BPM in controller.pd and click on the bang (button) on the right side to load samples and initialize the RNG. If you get an error that [time] cannot be initialized, then the RNG will output the same sequence on every start.

Simple to implement ideas

  • Higher order Markov chains for generating synth melodies (currently only 1st order)
  • More layers / synth implementations / samples / transition matrices
  • Better sounds
  • Animation reacting to sound on app interface, similar to https://ix.residuum.org/pd/denno.html (Low priority)
  • Use not only equal probabilities

Phone parameters to use

Other ideas

  • Let users record samples for looper / break
  • Analyse user recording in microphone for filling transition matrices (quite simple in Pd https://twitter.com/ResiduumMuc/status/811683435886612480 )
  • Change the app over time: Pd patches are able to modify themselves, so over time a patch can add/remove objects. Not easy, but doable (dynamic patching).
  • Not only the current state should be reflected in the app, but also history (Last year you were in the USA, your friend in Canada, even if everything else is the same between you two you get different sounds / probabilities).
  • History should not only be possible enhancement, but also degredation, maybe after some the app just outputs distorted noise, and then the user will have to remove and reinstall the app to start over, but history is lost.
  • Different set of rhythms / samples / Markov chains as groups ("tracks"), combined with the different parameters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment