Browse Source

added new node (append silence) and added a tips and tricks for it, fixed bug where help buttons didnt work in load files

Jonathan Higgins 7 months ago
parent
commit
8715a7e86f

+ 0 - 1
config_handler.gd

@@ -14,7 +14,6 @@ func _ready():
 	ensure_setting("interface_settings", "disable_pvoc_warning", false)
 	ensure_setting("interface_settings", "auto_close_console", false)
 	ensure_setting("interface_settings", "console_on_top", true)
-	ensure_setting("interface_settings", "use_search", false)
 	ensure_setting("audio_settings", "device", "Default")
 
 	# Only save if we added anything new

+ 200 - 0
examples/resonant_filters.thd

@@ -0,0 +1,200 @@
+{
+	"connections": [
+		{
+			"from_node_id": 3,
+			"from_port": 0,
+			"to_node_id": 4,
+			"to_port": 0
+		},
+		{
+			"from_node_id": 4,
+			"from_port": 0,
+			"to_node_id": 5,
+			"to_port": 0
+		},
+		{
+			"from_node_id": 2,
+			"from_port": 0,
+			"to_node_id": 3,
+			"to_port": 0
+		},
+		{
+			"from_node_id": 1,
+			"from_port": 0,
+			"to_node_id": 2,
+			"to_port": 0
+		}
+	],
+	"nodes": [
+		{
+			"command": "inputfile",
+			"id": 1,
+			"name": "inputfile",
+			"notes": {
+
+			},
+			"offset": {
+				"x": 20.0,
+				"y": 80.0
+			},
+			"slider_values": {
+				"AudioPlayer/FileDialog/@VBoxContainer@1675/@MarginContainer@1715/Tree/@Popup@1701/@VBoxContainer@1702/@HSlider@1710": {
+					"editable": true,
+					"meta": {
+
+					},
+					"value": 0.0
+				}
+			}
+		},
+		{
+			"command": "modify_brassage_5",
+			"id": 2,
+			"name": "modify_brassage_5",
+			"notes": {
+
+			},
+			"offset": {
+				"x": 519.111083984375,
+				"y": 80.0
+			},
+			"slider_values": {
+				"VBoxContainer/HSplitContainer/HSlider": {
+					"editable": true,
+					"meta": {
+						"brk": true
+					},
+					"value": 0.23
+				}
+			}
+		},
+		{
+			"command": "silend_silend_1",
+			"id": 3,
+			"name": "silend_silend_1",
+			"notes": {
+
+			},
+			"offset": {
+				"x": 890.666687011719,
+				"y": 80.0
+			},
+			"slider_values": {
+				"VBoxContainer/HSplitContainer/HSlider": {
+					"editable": true,
+					"meta": {
+
+					},
+					"value": 30.28
+				}
+			}
+		},
+		{
+			"command": "filter_bank_6",
+			"id": 4,
+			"name": "filter_bank_6",
+			"notes": {
+
+			},
+			"offset": {
+				"x": 1256.66674804688,
+				"y": 80.0
+			},
+			"slider_values": {
+				"VBoxContainer/HSplitContainer/HSlider": {
+					"editable": true,
+					"meta": {
+						"brk": true
+					},
+					"value": 5353.44
+				},
+				"VBoxContainer2/HSplitContainer/HSlider": {
+					"editable": true,
+					"meta": {
+
+					},
+					"value": 1.5
+				},
+				"VBoxContainer3/HSplitContainer/HSlider": {
+					"editable": true,
+					"meta": {
+
+					},
+					"value": 110.0
+				},
+				"VBoxContainer4/HSplitContainer/HSlider": {
+					"editable": true,
+					"meta": {
+
+					},
+					"value": 12000.0
+				},
+				"VBoxContainer5/HSplitContainer/HSlider": {
+					"editable": true,
+					"meta": {
+
+					},
+					"value": 7.0
+				},
+				"VBoxContainer6/HSplitContainer/HSlider": {
+					"editable": true,
+					"meta": {
+						"flag": "-s"
+					},
+					"value": 0.0
+				}
+			}
+		},
+		{
+			"command": "outputfile",
+			"id": 5,
+			"name": "outputfile",
+			"notes": {
+
+			},
+			"offset": {
+				"x": 1624.88879394531,
+				"y": 80.0
+			},
+			"slider_values": {
+				"AudioPlayer/FileDialog/@VBoxContainer@1784/@MarginContainer@1824/Tree/@Popup@1810/@VBoxContainer@1811/@HSlider@1819": {
+					"editable": true,
+					"meta": {
+
+					},
+					"value": 0.0
+				}
+			}
+		},
+		{
+			"command": "notes",
+			"id": 6,
+			"name": "notes2",
+			"notes": {
+				"CodeEdit": "Resonant filters and other processes that add durational elements onto a sound (such as PVOC: Blur) can often get their tails cut off during the process. Using Append Silence we can add some silence onto our sound before processing by the filter to allow some room for the tail to decay. "
+			},
+			"offset": {
+				"x": 994.444458007813,
+				"y": 534.444458007813
+			},
+			"slider_values": {
+
+			}
+		},
+		{
+			"command": "notes",
+			"id": 7,
+			"name": "notes",
+			"notes": {
+				"CodeEdit": "Applying a low density granular process before a resonant filter can help the sound ping and activate the filter making it rhythmic and percussive rather than a constant drone."
+			},
+			"offset": {
+				"x": 494.444458007813,
+				"y": 524.444458007813
+			},
+			"slider_values": {
+
+			}
+		}
+	]
+}

+ 53 - 0
scenes/Nodes/nodes.tscn

@@ -2908,6 +2908,58 @@ step = 0.01
 value = -12.0
 metadata/brk = true
 
+[node name="silend_silend_1" type="GraphNode" parent="."]
+layout_mode = 0
+offset_left = 1700.0
+offset_top = 1548.0
+offset_right = 2006.0
+offset_bottom = 1654.0
+tooltip_text = "Adds silence to the end of the sound"
+title = "Append Silence"
+slot/0/left_enabled = true
+slot/0/left_type = 0
+slot/0/left_color = Color(1, 1, 1, 0.564706)
+slot/0/left_icon = null
+slot/0/right_enabled = true
+slot/0/right_type = 0
+slot/0/right_color = Color(1, 1, 1, 0.564706)
+slot/0/right_icon = null
+slot/0/draw_stylebox = true
+slot/1/left_enabled = false
+slot/1/left_type = 0
+slot/1/left_color = Color(1, 1, 1, 1)
+slot/1/left_icon = null
+slot/1/right_enabled = false
+slot/1/right_type = 0
+slot/1/right_color = Color(1, 1, 1, 1)
+slot/1/right_icon = null
+slot/1/draw_stylebox = true
+script = ExtResource("3_uv17x")
+metadata/command = "silend_silend_1"
+metadata/stereo_input = true
+
+[node name="Control" type="Control" parent="silend_silend_1"]
+layout_mode = 2
+
+[node name="VBoxContainer" parent="silend_silend_1" instance=ExtResource("3_b6nw4")]
+layout_mode = 2
+tooltip_text = "The amount of silence to add in seconds"
+
+[node name="Label" parent="silend_silend_1/VBoxContainer" index="0"]
+text = "Length of Silence"
+
+[node name="HSlider" parent="silend_silend_1/VBoxContainer/HSplitContainer" index="0"]
+min_value = 0.01
+max_value = 60.0
+step = 0.01
+
+[node name="PopupMenu" parent="silend_silend_1/VBoxContainer/HSplitContainer/HSlider" index="0"]
+auto_translate_mode = 1
+size = Vector2i(208, 100)
+
+[node name="BreakFileMaker" parent="silend_silend_1/VBoxContainer" index="3"]
+auto_translate_mode = 1
+
 [node name="pvoc_anal_1" type="GraphNode" parent="."]
 layout_mode = 0
 offset_left = 2213.0
@@ -3636,6 +3688,7 @@ wrap_mode = 1
 [editable path="modify_stack/VBoxContainer5"]
 [editable path="modify_stack/VBoxContainer6"]
 [editable path="modify_speed_2/VBoxContainer"]
+[editable path="silend_silend_1/VBoxContainer"]
 [editable path="focus_accu/VBoxContainer2"]
 [editable path="focus_accu/VBoxContainer"]
 [editable path="blur_blur/VBoxContainer"]

+ 27 - 45
scenes/main/control.gd

@@ -159,7 +159,6 @@ func check_user_preferences():
 	$MenuBar/SettingsButton.set_item_checked(1, interface_settings.disable_pvoc_warning)
 	$MenuBar/SettingsButton.set_item_checked(2, interface_settings.auto_close_console)
 	$MenuBar/SettingsButton.set_item_checked(3, interface_settings.console_on_top)
-	$MenuBar/SettingsButton.set_item_checked(4, interface_settings.use_search)
 	$Console.always_on_top = interface_settings.console_on_top
 	if audio_devices.has(audio_settings.device):
 		AudioServer.set_output_device(audio_settings.device)
@@ -1400,15 +1399,8 @@ func _on_settings_button_index_pressed(index: int) -> void:
 				ConfigHandler.save_interface_settings("console_on_top", false)
 				$Console.always_on_top = false
 		4:
-			if interface_settings.use_search == false:
-				$MenuBar/SettingsButton.set_item_checked(index, true)
-				ConfigHandler.save_interface_settings("use_search", true)
-			else:
-				$MenuBar/SettingsButton.set_item_checked(index, false)
-				ConfigHandler.save_interface_settings("use_search", false)
-		5:
 			$AudioSettings.popup()
-		6:
+		5:
 			if $Console.is_visible():
 				$Console.hide()
 				await get_tree().process_frame  # Wait a frame to allow hide to complete
@@ -1556,6 +1548,7 @@ func load_graph_edit(path: String):
 		new_node.position_offset = Vector2(node_data["offset"]["x"], node_data["offset"]["y"])
 		new_node.set_meta("command", command_name)
 		graph_edit.add_child(new_node)
+		new_node.connect("open_help", Callable(self, "show_help_for_node"))
 		_register_node_movement()  # Track node movement changes
 
 		id_to_node[node_data["id"]] = new_node
@@ -1850,10 +1843,18 @@ func _on_help_button_index_pressed(index: int) -> void:
 				currentfile = "none" #reset current file to none for save tracking so user cant save over help file
 				load_graph_edit("res://examples/wetdry.thd")
 		9:
-			pass
+			if changesmade == true:
+				savestate = "helpfile"
+				helpfile = "res://examples/resonant_filters.thd"
+				$SaveChangesPopup.show()
+			else:
+				currentfile = "none" #reset current file to none for save tracking so user cant save over help file
+				load_graph_edit("res://examples/resonant_filters.thd")
 		10:
-			OS.shell_open("https://www.composersdesktop.com/docs/html/ccdpndex.htm")
+			pass
 		11:
+			OS.shell_open("https://www.composersdesktop.com/docs/html/ccdpndex.htm")
+		12:
 			OS.shell_open("https://github.com/j-p-higgins/SoundThread/issues")
 
 func _recycle_outfile():
@@ -1919,42 +1920,23 @@ func _on_rich_text_label_meta_clicked(meta: Variant) -> void:
 
 
 func _on_graph_edit_popup_request(at_position: Vector2) -> void:
-	var interface_settings = ConfigHandler.load_interface_settings()
-	
+
 	effect_position = graph_edit.get_local_mouse_position()
+
+	#get the mouse position in screen coordinates
+	var mouse_screen_pos = DisplayServer.mouse_get_position()  
+	#get the window position in screen coordinates
+	var window_screen_pos = get_window().position
+	#get the window size relative to its scaling for retina displays
+	var window_size = get_window().size * DisplayServer.screen_get_scale()
+
+	#calculate the xy position of the mouse clamped to the size of the window and menu so it doesn't go off the screen
+	var clamped_x = clamp(mouse_screen_pos.x, window_screen_pos.x, window_screen_pos.x + window_size.x - $SearchMenu.size.x)
+	var clamped_y = clamp(mouse_screen_pos.y, window_screen_pos.y, window_screen_pos.y + window_size.y - (420 * DisplayServer.screen_get_scale()))
 	
-	if interface_settings.use_search == false:
-		#get the mouse position in screen coordinates
-		var mouse_screen_pos = DisplayServer.mouse_get_position()  
-		#get the window position in screen coordinates
-		var window_screen_pos = get_window().position
-		#get the window size relative to its scaling for retina displays
-		var window_size = get_window().size * DisplayServer.screen_get_scale()
-		#get the size of the popup menu
-		var popup_size = $mainmenu.size
-
-		#calculate the xy position of the mouse clamped to the size of the window and menu so it doesn't go off the screen
-		var clamped_x = clamp(mouse_screen_pos.x, window_screen_pos.x, window_screen_pos.x + window_size.x - popup_size.x)
-		var clamped_y = clamp(mouse_screen_pos.y, window_screen_pos.y, window_screen_pos.y + window_size.y - popup_size.y)
-		
-		#position and show the menu
-		$mainmenu.position = Vector2(clamped_x, clamped_y)
-		$mainmenu.popup()
-	else:
-		#get the mouse position in screen coordinates
-		var mouse_screen_pos = DisplayServer.mouse_get_position()  
-		#get the window position in screen coordinates
-		var window_screen_pos = get_window().position
-		#get the window size relative to its scaling for retina displays
-		var window_size = get_window().size * DisplayServer.screen_get_scale()
-
-		#calculate the xy position of the mouse clamped to the size of the window and menu so it doesn't go off the screen
-		var clamped_x = clamp(mouse_screen_pos.x, window_screen_pos.x, window_screen_pos.x + window_size.x - $SearchMenu.size.x)
-		var clamped_y = clamp(mouse_screen_pos.y, window_screen_pos.y, window_screen_pos.y + window_size.y - (420 * DisplayServer.screen_get_scale()))
-		
-		#position and show the menu
-		$SearchMenu.position = Vector2(clamped_x, clamped_y)
-		$SearchMenu.popup()
+	#position and show the menu
+	$SearchMenu.position = Vector2(clamped_x, clamped_y)
+	$SearchMenu.popup()
 
 func _on_audio_settings_close_requested() -> void:
 	$AudioSettings.hide()

+ 16 - 16
scenes/main/control.tscn

@@ -243,7 +243,7 @@ item_3/id = 1
 
 [node name="SettingsButton" type="PopupMenu" parent="MenuBar"]
 title = "Settings"
-item_count = 7
+item_count = 6
 item_0/text = "Change CDP Folder Location"
 item_0/id = 0
 item_1/text = "Disable PVOC Multi Input Warning"
@@ -255,18 +255,15 @@ item_2/id = 2
 item_3/text = "Console Always on Top"
 item_3/checkable = 1
 item_3/id = 5
-item_4/text = "Use Search Menu (Experimental)"
-item_4/checkable = 1
-item_4/id = 6
-item_5/text = "Audio Settings"
-item_5/id = 4
-item_6/text = "Open the Console"
-item_6/id = 3
+item_4/text = "Audio Settings"
+item_4/id = 4
+item_5/text = "Open the Console"
+item_5/id = 3
 
 [node name="HelpButton" type="PopupMenu" parent="MenuBar"]
 auto_translate_mode = 1
 title = "Help"
-item_count = 12
+item_count = 13
 item_0/text = "Tutorials"
 item_0/id = 0
 item_0/separator = true
@@ -287,13 +284,15 @@ item_7/id = 7
 item_7/separator = true
 item_8/text = "Wet/Dry Mix"
 item_8/id = 8
-item_9/text = "Other Help"
-item_9/id = 9
-item_9/separator = true
-item_10/text = "CDP Documentation"
-item_10/id = 10
-item_11/text = "Report a Bug"
-item_11/id = 11
+item_9/text = "Resonant Filters"
+item_9/id = 12
+item_10/text = "Other Help"
+item_10/id = 9
+item_10/separator = true
+item_11/text = "CDP Documentation"
+item_11/id = 10
+item_12/text = "Report a Bug"
+item_12/id = 11
 
 [node name="About" type="PopupMenu" parent="MenuBar"]
 item_count = 1
@@ -360,6 +359,7 @@ offset_bottom = 45.0
 
 [node name="SearchBar" type="LineEdit" parent="SearchMenu/VBoxContainer"]
 layout_mode = 2
+placeholder_text = "Type to search"
 
 [node name="ScrollContainer" type="ScrollContainer" parent="SearchMenu/VBoxContainer"]
 custom_minimum_size = Vector2(0, 10)

+ 25 - 0
scenes/main/process_help.json

@@ -1347,6 +1347,31 @@
 	"short_description": "Speeds up or slows down a sound changing pitch",
 	"description": "Plays the sound faster or slower to adjust its speed and pitch. -12 semitones is half speed; +12 semitones is double speed. \n"
   },
+ "silend_silend_1": {
+	"category": "time",
+	"subcategory": "misc",
+	"stereo": true,
+	"title": "Append Silence",
+	"parameters": {
+	  "param1": {
+		"paramname": "Length of Silence",
+		"paramdescription": "The length of silence to add to the end of the sound in seconds",
+		"automatable": false,
+		"time": false,
+		"min": false,
+		"max": false,
+		"flag": "",
+		"minrange": "",
+		"maxrange": "",
+		"step": "",
+		"value": "",
+		"exponential": false,
+		"uitype": "hslider"
+	  }
+	},
+	"short_description": "Adds silence to the end of a sound",
+	"description": "Adds silence at the end of the sound, very useful  before processes which add long tails such as resonant filters and bluring. Can also be used with scramble processes to add silences into the scramble. \n"
+  },
   "modify_speed_5": {
 	"category": "time",
 	"subcategory": "misc",