Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Device Motion module #1217

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

nkymut
Copy link

@nkymut nkymut commented Nov 21, 2024

This change adds 'motion' package, which introduces smartphone's acceleration, gravity, rotation, and orientation signals for dynamic pattern creation in Strudel.

example:

enableMotion() //enable DeviceMotion 

let tempo = 200

$_: accX.segment(16).gain().log()

$:n("[0 1 3 1 5 4]/4")
  .scale("Bb:lydian")
  .sometimesBy(0.5,sub(note(12)))
  .lpf(gravityY.range(20,1000))
  .lpq(gravityZ.range(1,30))
  .lpenv(gravityX.range(2,2))
  .gain(oriX.range(0.2,0.8))
  .room(oriZ.range(0,0.5))
  .attack(oriY.range(0,0.3))
  .delay(rotG.range(0,1))
  .decay(rotA.range(0,1))
  .attack(rotB.range(0,0.1))
  .sound("sawtooth").cpm(tempo)

as discussed in
https://discord.com/channels/779427371270275082/1308356687538683958/1308731644097728514

Tested only on the iPhone 13 Pro; testing on Android devices is still required.

Introduces smart-phone device's acceleration, gravity, rotation, and orientation signals for dynamic pattern creation in Strudel.
@nkymut nkymut changed the title Add Device Motion package Add Device Motion module Nov 21, 2024
@felixroos
Copy link
Collaborator

sorry for not looking at this for so long.. thank you for the PR ! the code looks good, tho it seems the PR is now mixed with #1223 ?
i can test this on android as well..
it might also be useful to have a little guide in the docs so people can discover this feature

@nkymut
Copy link
Author

nkymut commented Dec 17, 2024

Oops, I didn’t realise I had mixed this up with other updates I was testing.
I’ll try to roll back the commits where I published the PR and am also looking into the guide for the module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants