Skip to content

Commit

Permalink
Shrink the roller knob and the voice panel further
Browse files Browse the repository at this point in the history
The roller knob is the most used control, so it's the
best place to look for extra size. I tried to preserve its
look and feel as much as possible while narrowing
the control down. I think it's good, but maybe some
extra tuning in the future would make it better.
  • Loading branch information
YuriSizov committed Oct 30, 2024
1 parent 1252575 commit ede9c43
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 30 deletions.
6 changes: 3 additions & 3 deletions gui/components/knobs/RollerKnob.gdshader
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ void fragment() {
wheel_uv.y += pow(abs(uv.x), wheel_warp_power) * wheel_warp_factor + wheel_height;

// Create the top side of the wheel.
float wheel_top_mask = clamp(2.0 * uv.y, 0.0, 1.0);
wheel_top_mask = smoothstep(wheel_depth, wheel_depth + 0.16, wheel_top_mask);
float wheel_top_mask = band(uv + wheel_depth + wheel_height, 1, notches_band - 1.0, wheel_depth_sharpness);
float wheel_bottom_mask = band_oneside(wheel_uv + 0.04, 1, notches_band, notches_band_sharpness);
float wheel_bottom_limits = smoothstep(wheel_depth_sharpness.x, wheel_depth_sharpness.y, 1.0 - abs(wheel_uv.x) * 2.0);
wheel_bottom_mask = clamp(wheel_bottom_limits * wheel_bottom_mask, 0.0, 1.0);
float wheel_mask = min(wheel_top_mask, wheel_bottom_mask);
float wheel_mask = min(wheel_top_mask, wheel_bottom_mask) * wheel_back_mask;
wheel_mask = clamp(wheel_mask, 0.0, 1.0);

// Add the top part of the wheel to the output color.
vec3 wheel_top_color = mix(wheel_color, vec3(1.0), 0.15);
Expand Down
24 changes: 12 additions & 12 deletions gui/components/knobs/RollerKnob.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,34 @@ shader_parameter/base_color = Color(0.149114, 0.149114, 0.149114, 1)
shader_parameter/markings_frequency = 46.0
shader_parameter/markings_spread = 0.8
shader_parameter/markings_offset = 0.0
shader_parameter/markings_band = 23.266
shader_parameter/markings_band_offset = -0.102
shader_parameter/markings_main_band = 2.678
shader_parameter/markings_main_band_offset = 0.00500005
shader_parameter/markings_band = 11.266
shader_parameter/markings_band_offset = -0.031
shader_parameter/markings_main_band = 2.677
shader_parameter/markings_main_band_offset = 0.0580001
shader_parameter/markings_band_sharpness = Vector2(0.01, 0.035)
shader_parameter/markings_color = Color(0.843184, 0.843184, 0.843184, 1)
shader_parameter/markings_main_color = Color(0.923899, 0.653429, 0.516652, 1)
shader_parameter/notches_frequency = 3.211
shader_parameter/notches_scale = 0.281
shader_parameter/notches_shine = 0.348
shader_parameter/notches_brightness = 1.867
shader_parameter/notches_band = 3.225
shader_parameter/notches_band = 1.84
shader_parameter/notches_band_sharpness = Vector2(0.03, 0.045)
shader_parameter/notches_limits_sharpness = Vector2(0.06, 0.26)
shader_parameter/notches_shadow_sharpness = Vector2(0.01, 0.14)
shader_parameter/notches_color = Color(0.596801, 0.60802, 0.650343, 1)
shader_parameter/wheel_height = 0.0
shader_parameter/wheel_depth = 0.0
shader_parameter/wheel_depth_sharpness = Vector2(0.08, 0.33)
shader_parameter/wheel_height = 1.9e-07
shader_parameter/wheel_depth = 0.045
shader_parameter/wheel_depth_sharpness = Vector2(-0.21, 0.54)
shader_parameter/wheel_limits_sharpness = Vector2(0.06, 0.07)
shader_parameter/wheel_warp_power = 2.0
shader_parameter/wheel_warp_factor = 0.3
shader_parameter/wheel_color = Color(0.0182191, 0.0194593, 0.0278257, 1)

[node name="RollerKnob" type="PanelContainer"]
material = SubResource("ShaderMaterial_8a7lm")
offset_right = 180.0
offset_bottom = 78.0
offset_right = 130.0
offset_bottom = 58.0
theme_type_variation = &"RollerKnob"
script = ExtResource("1_0fm8q")

Expand All @@ -80,7 +80,7 @@ vertical_alignment = 1

[node name="ValueBox" type="VBoxContainer" parent="Layout"]
layout_mode = 2
theme_override_constants/separation = 0
theme_override_constants/separation = 2

[node name="Value" type="Control" parent="Layout/ValueBox"]
unique_name_in_owner = true
Expand Down Expand Up @@ -114,6 +114,6 @@ grow_vertical = 2
[node name="Roller" type="Control" parent="Layout/ValueBox"]
unique_name_in_owner = true
material = SubResource("ShaderMaterial_ure2p")
custom_minimum_size = Vector2(90, 34)
custom_minimum_size = Vector2(90, 24)
layout_mode = 2
size_flags_horizontal = 4
6 changes: 6 additions & 0 deletions gui/panels/SettingsPanel.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,17 @@ layout_mode = 2
key_text = "glasan_octave_down"
description_text = "Change the piano roll octave to be lower"

[node name="Spacer2" type="Control" parent="Content/Layout/ShortcutsSection"]
layout_mode = 2

[node name="Label" type="Label" parent="Content/Layout/ShortcutsSection"]
layout_mode = 2
theme_type_variation = &"ShortcutLabel"
text = "Change the current note and play it:"

[node name="Spacer3" type="Control" parent="Content/Layout/ShortcutsSection"]
layout_mode = 2

[node name="MarginContainer" type="MarginContainer" parent="Content/Layout/ShortcutsSection"]
layout_mode = 2
size_flags_horizontal = 4
Expand Down
2 changes: 1 addition & 1 deletion gui/panels/VoicePanel.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[sub_resource type="ShaderMaterial" id="ShaderMaterial_18dkq"]
resource_local_to_scene = true
shader = ExtResource("2_d4vur")
shader_parameter/size = Vector2(768, 1024)
shader_parameter/size = Vector2(800, 1024)
shader_parameter/light_intensity = 0.0
shader_parameter/light_smoothness = 0.003
shader_parameter/light_inverted = 0
Expand Down
30 changes: 18 additions & 12 deletions gui/theme/project_theme.tres
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ content_margin_bottom = 12.0
bg_color = Color(0.161078, 0.19102, 0.216014, 1)

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5jo2q"]
content_margin_left = 10.0
content_margin_top = 8.0
content_margin_right = 10.0
content_margin_bottom = 8.0
content_margin_left = 8.0
content_margin_top = 6.0
content_margin_right = 8.0
content_margin_bottom = 6.0
bg_color = Color(0.13965, 0.112365, 0.114531, 1)

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rc1oq"]
Expand Down Expand Up @@ -338,10 +338,10 @@ bg_color = Color(0.125626, 0.127832, 0.143547, 1)
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_xn5gi"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wwe1w"]
content_margin_left = 16.0
content_margin_top = 22.0
content_margin_right = 16.0
content_margin_bottom = 22.0
content_margin_left = 20.0
content_margin_top = 16.0
content_margin_right = 20.0
content_margin_bottom = 16.0
bg_color = Color(0.159848, 0.178305, 0.159854, 1)

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_v1lpm"]
Expand Down Expand Up @@ -459,10 +459,10 @@ MenuPanelButton/base_type = &"Button"
MenuPanelHighlight/base_type = &"PanelContainer"
MenuPanelHighlight/styles/panel = SubResource("StyleBoxFlat_frq7n")
OperatorDeck/base_type = &"MarginContainer"
OperatorDeck/constants/margin_bottom = 16
OperatorDeck/constants/margin_left = 16
OperatorDeck/constants/margin_right = 16
OperatorDeck/constants/margin_top = 16
OperatorDeck/constants/margin_bottom = 14
OperatorDeck/constants/margin_left = 14
OperatorDeck/constants/margin_right = 14
OperatorDeck/constants/margin_top = 14
OperatorIndicator/base_type = &"HBoxContainer"
OperatorIndicator/colors/font_active_color = Color(0.910244, 0.403015, 0.264407, 1)
OperatorIndicator/colors/font_inactive_color = Color(0.265174, 0.143202, 0.136196, 1)
Expand Down Expand Up @@ -500,8 +500,14 @@ RollerKnob/font_sizes/value_size = 11
RollerKnob/styles/panel = SubResource("StyleBoxFlat_5jo2q")
ShortcutLabel/base_type = &"Label"
ShortcutLabel/colors/font_color = Color(0.703915, 0.742978, 0.757542, 1)
ShortcutLabel/colors/font_shadow_color = Color(0, 0, 0, 0.231373)
ShortcutLabel/constants/shadow_offset_x = 2
ShortcutLabel/constants/shadow_offset_y = 2
ShortcutLabelAccented/base_type = &"Label"
ShortcutLabelAccented/colors/font_color = Color(0.929412, 0.831373, 0.470588, 1)
ShortcutLabelAccented/colors/font_shadow_color = Color(0, 0, 0, 0.231373)
ShortcutLabelAccented/constants/shadow_offset_x = 2
ShortcutLabelAccented/constants/shadow_offset_y = 2
TabContainer/colors/font_hovered_color = Color(0.847059, 0.847059, 0.847059, 1)
TabContainer/colors/font_selected_color = Color(0.95, 0.95, 0.95, 1)
TabContainer/colors/font_unselected_color = Color(0.846616, 0.846616, 0.846616, 1)
Expand Down
3 changes: 1 addition & 2 deletions gui/voices/operators/OPLOperatorDeck.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ theme_type_variation = &"VLayoutContainer"
[node name="WaveShapeFlipper" parent="Layout" instance=ExtResource("2_iavvd")]
unique_name_in_owner = true
layout_mode = 2
short_form = false

[node name="EnvelopeBox" type="PanelContainer" parent="Layout"]
layout_mode = 2
Expand Down Expand Up @@ -109,7 +108,7 @@ theme_override_constants/separation = 0
[node name="Label" type="MarginContainer" parent="Layout/EnvelopeBox/Layout/EnvelopeBox"]
layout_mode = 2
size_flags_vertical = 0
theme_override_constants/margin_top = 8
theme_override_constants/margin_top = 11

[node name="Label" type="Label" parent="Layout/EnvelopeBox/Layout/EnvelopeBox/Label"]
layout_mode = 2
Expand Down

0 comments on commit ede9c43

Please sign in to comment.