Lid Angle Sensor sound effect for Framework 12 laptop? (e.g. theremin or wooden door sound when closing laptop)

Idea

Do you remember the theremin mode video where someone made a funny found when closing/opening your lid based on the lid sensor macOS devices have?

Here it is:

Or the wooden door?

Now, here is their blog post and link to the source code in Objective C.

Now why not have the same for a Framework device?

I actually discovered the framework CLI can show this:

$ sudo framework_tool --sensors
Accelerometers:
  Lid Angle:   76 Deg
  Lid Sensor:  X=-0.03G Y=+0.99G, Z=-0.25G
  Base Sensor: X=-0.01G Y=+0.00G, Z=+0.96G
$ sudo framework_tool --sensors
Accelerometers:
  Lid Angle:   118 Deg
  Lid Sensor:  X=-0.03G Y=+0.89G, Z=+0.47G
  Base Sensor: X=-0.01G Y=+0.00G, Z=+0.96G

Tested on my Framework 12. I don’t know whether it works for other devices, too. (I guess for the desktop it does not haha. :wink:)

So that project should be possible for Framework, too, should not it?


Also posted in that GitHub repository.

1 Like

I would totally install this if possible for the FW13. I don’t really want to make it myself as I have other stuff going on, but I’m sure someone else is just itching for a weekend project.

1 Like

As you found, only the Laptop 12 has two accelerometers that can be used to calculate the lid angle.
See docs

You can build software to look at this data and do the sound you’re looking for.

2 Likes

Ah thanks so could have posted in framework-laptop-12 Framework Laptop 12 I guess,but yeah maybe still fits here better.