From 14ded0bbe6338094c9420c6d604a2a0dc9ecd769 Mon Sep 17 00:00:00 2001 From: Peter Slattery Date: Fri, 9 Apr 2021 22:15:59 -0400 Subject: [PATCH] live editing --- .../ambient_patterns/fishy_0.foldanim | 2 +- .../ambient_patterns/rainbow_0.foldanim | 10 +++++++--- src/app/editor/interface.h | 2 +- src/app/patterns/blumen_patterns.h | 4 ++-- src/app/ss_blumen_lumen/blumen_lumen.h | 1 + .../ss_blumen_lumen/blumen_lumen_settings.h | 20 ++++++++++--------- 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app_run_tree/data/blumen_animations/ambient_patterns/fishy_0.foldanim b/app_run_tree/data/blumen_animations/ambient_patterns/fishy_0.foldanim index 7119bbc..562f43d 100644 --- a/app_run_tree/data/blumen_animations/ambient_patterns/fishy_0.foldanim +++ b/app_run_tree/data/blumen_animations/ambient_patterns/fishy_0.foldanim @@ -43,6 +43,6 @@ blocks:{ max: 3600; }; layer_index: 0; - animation_name: "Pattern_Rotary"; + animation_name: "Pattern_VerticalLines"; }; }; diff --git a/app_run_tree/data/blumen_animations/ambient_patterns/rainbow_0.foldanim b/app_run_tree/data/blumen_animations/ambient_patterns/rainbow_0.foldanim index ab6f4e3..ee12af4 100644 --- a/app_run_tree/data/blumen_animations/ambient_patterns/rainbow_0.foldanim +++ b/app_run_tree/data/blumen_animations/ambient_patterns/rainbow_0.foldanim @@ -1,10 +1,10 @@ lumenarium_animation_file; animation_name: "rainbow"; -layers_count: 2; +layers_count: 3; blocks_count: 1; playable_range:{ min: 0; - max: 360; + max: 3600; }; layers:{ layer:{ @@ -15,12 +15,16 @@ layers:{ name: "Color"; blend: "Add"; }; + layer:{ + name: "[New Layer]"; + blend: "Add"; + }; }; blocks:{ block:{ frame_range:{ min: 0; - max: 360; + max: 3600; }; layer_index: 1; animation_name: "Pattern_Rainbow"; diff --git a/src/app/editor/interface.h b/src/app/editor/interface.h index 6a0e228..244e85d 100644 --- a/src/app/editor/interface.h +++ b/src/app/editor/interface.h @@ -517,7 +517,7 @@ ui_GetRetainedState(ui_interface* Interface, ui_widget_id Id) { // NOTE(PS): If we are accessing a retained state, it shouldn't // have been accessed longer ago than the last frame - Assert(Interface->RetainedState[i].FramesSinceAccess <= 2); + //Assert(Interface->RetainedState[i].FramesSinceAccess <= 2); Interface->RetainedState[i].FramesSinceAccess = 0; Result = Interface->RetainedState + i; break; diff --git a/src/app/patterns/blumen_patterns.h b/src/app/patterns/blumen_patterns.h index 534d78e..3023506 100644 --- a/src/app/patterns/blumen_patterns.h +++ b/src/app/patterns/blumen_patterns.h @@ -414,7 +414,7 @@ Pattern_VerticalLines(led_buffer* Leds, led_buffer_range Range, assembly Assembl r32 LightSpeedMin = 1; r32 LightSpeedMax = 5; - s32 LightTailLength = 10; + s32 LightTailLength = 60; for (u32 StripIndex = 0; StripIndex < Assembly.StripCount; StripIndex++) { v2_strip Strip = Assembly.Strips[StripIndex]; @@ -503,7 +503,7 @@ Pattern_Rotary(led_buffer* Leds, led_buffer_range Range, assembly Assembly, r32 blumen_lumen_state* BLState = (blumen_lumen_state*)UserData; Time = Time * BLState->PatternSpeed; - Pattern_RotaryOptions(Leds, Range, Assembly, Time, Transient, UserData, 2, BlackV4, WhiteV4); + Pattern_RotaryOptions(Leds, Range, Assembly, Time, Transient, UserData, .25f, BlackV4, WhiteV4); } internal void diff --git a/src/app/ss_blumen_lumen/blumen_lumen.h b/src/app/ss_blumen_lumen/blumen_lumen.h index 3d2bec5..db52256 100644 --- a/src/app/ss_blumen_lumen/blumen_lumen.h +++ b/src/app/ss_blumen_lumen/blumen_lumen.h @@ -257,6 +257,7 @@ BlumenLumen_GetCurrentHue(blumen_lumen_state* BLState, assembly Assembly) switch (BLState->PatternMode) { + case BlumenPattern_NoControl: case BlumenPattern_Standard: { Result = BLState->StandardPatternHues; diff --git a/src/app/ss_blumen_lumen/blumen_lumen_settings.h b/src/app/ss_blumen_lumen/blumen_lumen_settings.h index b33a224..24c0348 100644 --- a/src/app/ss_blumen_lumen/blumen_lumen_settings.h +++ b/src/app/ss_blumen_lumen/blumen_lumen_settings.h @@ -16,7 +16,7 @@ gs_const_string Flower2AssemblyPath = ConstString("data/ss_blumen_three.fold"); // The path to the phrase map CSV. Can be an absolute path, or relative // to the app_run_tree folder -gs_const_string PhraseMapCSVPath = ConstString("data/flower_codes.tsv"); +gs_const_string PhraseMapCSVPath = ConstString("C:/projects/flowers-sound/flower_codes.tsv"); char PhraseMapCSVSeparator = '\t'; // Search Strings for which folders to find ambient animation files and @@ -36,21 +36,23 @@ gs_const_string VoicePatternFolder = ConstString("data/blumen_animations/audio_r // NOTE: There is no need to modify the MotorOpenTimesCount variable - // it is a compile time constant that gets calculated automatically global time_range MotorOpenTimes[] = { - { 12, 45, 17, 45 }, // 12:45pm to 5:45pm - { 19, 00, 23, 00 }, // 7:00pm to 11:00pm + { 8, 00, 12, 00 }, + { 12, 30, 13, 00 }, + { 18, 00, 22, 00 }, // 7:00pm to 11:00pm }; global u32 MotorOpenTimesCount = CArrayLength(MotorOpenTimes); // do not edit // The times of day when the leds should be on // Search for @TimeFormat to find documentation global time_range LedOnTimes[] = { - { 00, 00, 23, 59 }, // literally always + { 17, 00, 23, 59 }, + { 00, 00, 06, 30 }, }; global u32 LedOnTimesCount = CArrayLength(LedOnTimes); // do not edit // How long it takes to fade from the default pattern to the // voice activated pattern -r32 VoiceCommandFadeDuration = 0.0f; // in seconds +r32 VoiceCommandFadeDuration = 0.5f; // in seconds // How long the voice activated pattern will remain active // without additional voice commands, before fading back to @@ -88,14 +90,14 @@ r64 TurnUpperLedsOffAfterMotorCloseCommandDelay = 120.0; // in seconds // NOTE: this is an 8bit signed integer so its range is // -128 to 127, not that we should need either of those extremes for // this, but just a note that you can't just put anything in here. -s8 MinHighTemperature = 0; +s8 MinHighTemperature = 26; // The percent brightness we set leds to during high temperatures. // A value in the range 0:1 inclusive // This is multiplied by each pixels R, G, & B channels before being // sent. So if it is set to .1f, then the maximum brightness value sent // to any channel of any pixel will be 25 (255 * .1 = 25). -r32 HighTemperatureBrightnessPercent = 1.0f; +r32 HighTemperatureBrightnessPercent = 0.7f; // The percent brightness we set leds to when no other conditions apply // A value in the range 0:1 inclusive. @@ -116,9 +118,9 @@ r32 GlobalAnimSpeed = 1.0f; r32 GlobalAnimTransitionSpeed = 0.0f; // how long it takes to fade from the old voice hue to the new one -r32 PhraseHueFadeInDuration = 2.0f; // seconds +r32 PhraseHueFadeInDuration = 0.01f; // seconds -r64 PhrasePriorityMessageGroupingTime = 0.0f; +r64 PhrasePriorityMessageGroupingTime = 0.1f; // How often should Lumenarium send its status to the python server? //