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

Adjust ui for new dataSource property and audio based sparkle #125

Closed
TheRealKasumi opened this issue Jan 22, 2023 · 0 comments · Fixed by #133
Closed

Adjust ui for new dataSource property and audio based sparkle #125

TheRealKasumi opened this issue Jan 22, 2023 · 0 comments · Fixed by #133
Assignees
Labels
enhancement New feature or request frontend Issues related to the web-app
Milestone

Comments

@TheRealKasumi
Copy link
Owner

With #122 the audio based sparkle animation will be implemented. To keep the code clean, some small adjustment to the LED api were done. Now there is a new dataSource field in the LED configuration. It will take the role of the custom field for selecting the motion axis. For this a new enum was introduced. It can contain any data source now, instead of only MPU6050 based value.

enum class DataSource : uint8_t
{
	DS_NONE = 0,					           // No data source, animator is providing the data itself
	DS_RANDOM = 1,					   // Random data is used for the animation
	DS_ACC_X_RAW = 2,				   // Raw x acceleration is used for the animation
	DS_ACC_Y_RAW = 3,				   // Raw y acceleration is used for the animation
	DS_ACC_Z_RAW = 4,				   // Raw z acceleration is used for the animation
	DS_GY_X_RAW = 5,				           // Raw x rotation is used for the animation
	DS_GY_Y_RAW = 6,				           // Raw y rotation is used for the animation
	DS_GY_Z_RAW = 7,				           // Raw z rotation is used for the animation
	DS_ACC_X_G = 8,					   // Acceleration on x axis in g is used for the animation
	DS_ACC_Y_G = 9,					   // Acceleration on y axis in g is used for the animation
	DS_ACC_Z_G = 10,				           // Acceleration on z axis in g is used for the animation
	DS_GY_X_DEG = 11,				   // Rotation around the x axis in deg/s is used for the animation
	DS_GY_Y_DEG = 12,				   // Rotation around the y axis in deg/s is used for the animation
	DS_GY_Z_DEG = 13,				   // Rotation around the z axis in deg/s is used for the animation
	DS_PITCH = 14,					   // Pitch angle of the unit is used for the animation
	DS_ROLL = 15,					   // Roll angle of the unit is used for the animation
	DS_YAW = 16,					           // Yaw angle of the unit is used for the animation
	DS_ROLL_COMPENSATED_ACC_X_G = 17,  // Roll angle compensated acceleration on x axis in g is used for the animation
	DS_PITCH_COMPENSATED_ACC_Y_G = 18, // Pitch angle compensated acceleration on y axis in g is used for the animation
	DS_AUDIO_FREQUENCY_TRIGGER = 19,     // Frequency triggers of the audio unit are used for the animation
	DS_AUDIO_FREQUENCY_VALUE = 20,	   // Frequency value of the audio unit are used for the animation
	DS_AUDIO_VOLUME_PEAK = 21		   // Volume peak of the audio unit are used for the animation
};

For now we keep the separation beween "normal" and "motion" animations. This will be done in #123 . However to select the axis for motion based effects, the dataSource should now be used. The old custom field can be removed.

For the sparkle animator there should be a new dropdown to switch between data source DS_RANDOM and DS_AUDIO_FREQUENCY_TRIGGER. Also a bit mask for selecting the frequency bands should be implemented.

Example: 0B10000000 -> only band 1; 0B01000000 -> only band 2; 0B11000000 -> band 1 and band 2 ect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Issues related to the web-app
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants