Просмотр исходного кода

fixed bug that breaks dual mono file handling by recycling the original input file instead of using the previous output file

Jonathan Higgins 7 месяцев назад
Родитель
Сommit
02394eabfb
4 измененных файлов с 110 добавлено и 39 удалено
  1. 47 1
      scenes/Nodes/nodes.tscn
  2. 11 8
      scenes/main/control.gd
  3. 1 1
      scenes/main/control.tscn
  4. 51 29
      scenes/menu/menu.tscn

+ 47 - 1
scenes/Nodes/nodes.tscn

@@ -312,7 +312,7 @@ slot/1/right_color = Color(1, 1, 1, 1)
 slot/1/right_icon = null
 slot/1/draw_stylebox = true
 metadata/command = "clip_clip_2"
-metadata/stereo_input = false
+metadata/stereo_input = true
 
 [node name="Control" type="Control" parent="clip_clip_2"]
 layout_mode = 2
@@ -677,6 +677,51 @@ min_value = 2.0
 max_value = 64.0
 value = 2.0
 
+[node name="quirk_quirk_1" type="GraphNode" parent="."]
+layout_mode = 0
+offset_left = 47.0
+offset_top = 1673.0
+offset_right = 353.0
+offset_bottom = 1779.0
+tooltip_text = "Distortion by raising sample values to a power"
+title = "Distort: Power Factor"
+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
+metadata/command = "quirk_quirk_1"
+metadata/stereo_input = false
+
+[node name="Control" type="Control" parent="quirk_quirk_1"]
+layout_mode = 2
+
+[node name="VBoxContainer" parent="quirk_quirk_1" instance=ExtResource("3_b6nw4")]
+layout_mode = 2
+tooltip_text = "Power to raise all samples by <1 exaggerates signal contour; >1 smooths signal contour"
+
+[node name="Label" parent="quirk_quirk_1/VBoxContainer" index="0"]
+text = "Power Factor"
+
+[node name="HSlider" parent="quirk_quirk_1/VBoxContainer/HSplitContainer" index="0"]
+min_value = 0.01
+step = 0.01
+value = 0.7
+exp_edit = true
+
 [node name="extend_drunk_1" type="GraphNode" parent="."]
 layout_mode = 0
 offset_left = 463.0
@@ -2964,6 +3009,7 @@ wrap_mode = 1
 [editable path="distort_multiply/VBoxContainer"]
 [editable path="distort_interpolate/VBoxContainer"]
 [editable path="distort_replace/VBoxContainer"]
+[editable path="quirk_quirk_1/VBoxContainer"]
 [editable path="extend_drunk_1/VBoxContainer"]
 [editable path="extend_drunk_1/VBoxContainer2"]
 [editable path="extend_drunk_1/VBoxContainer3"]

+ 11 - 8
scenes/main/control.gd

@@ -27,6 +27,9 @@ var process_successful #tracks if the last run process was successful
 func _ready() -> void:
 	Nodes.hide()
 	$mainmenu.hide()
+	$"mainmenu/select_effect/Time Domain".show()
+	$"mainmenu/select_effect/Time Domain/Distort".show()
+	$"mainmenu/select_effect/Frequency Domain/Convert".show()
 	$NoLocationPopup.hide()
 	$Console.hide()
 	$NoInputPopup.hide()
@@ -611,9 +614,9 @@ func run_thread_with_branches():
 		elif input_files.size() == 1:
 			current_infile = input_files[0]
 
-		# If no input, use the original input file
-		else:
-			current_infile = Global.infile
+		## If no input, use the original input file
+		#else:
+			#current_infile = Global.infile
 
 		# Build the command for the current node's audio processing
 		var slider_data = _get_slider_values_ordered(node)
@@ -645,11 +648,11 @@ func run_thread_with_branches():
 					#audio file is stereo and needs to be split for pvoc processing
 					var pvoc_stereo_files = []
 					##Split stereo to c1/c2
-					run_command(cdpprogs_location + "/housekeep chans 2 " + "\"%s\"" % Global.infile)
+					run_command(cdpprogs_location + "/housekeep chans 2 " + "\"%s\"" % current_infile)
 			
 					# Process left and right seperately
 					for channel in ["c1", "c2"]:
-						var dual_mono_file = Global.infile.get_basename() + "_%s.wav" % channel
+						var dual_mono_file = current_infile.get_basename() + "_%s.wav" % channel
 						
 						var makeprocess = make_process(node, process_count, dual_mono_file, slider_data)
 						# run the command
@@ -712,7 +715,7 @@ func run_thread_with_branches():
 
 					process_count += 1
 					
-
+					
 				#interleave left and right
 				var output_file = Global.outfile.get_basename() + str(process_count) + "_interleaved.wav"
 				run_command(cdpprogs_location + "/submix interleave" + " \"%s\"" % pvoc_stereo_files[0] + " \"%s\"" % pvoc_stereo_files[1] + " \"%s\"" % output_file)
@@ -740,12 +743,12 @@ func run_thread_with_branches():
 
 					else: #audio file is stereo and process is mono, split stereo, process and recombine
 						##Split stereo to c1/c2
-						run_command(cdpprogs_location + "/housekeep chans 2 " + "\"%s\"" % Global.infile)
+						run_command(cdpprogs_location + "/housekeep chans 2 " + "\"%s\"" % current_infile)
 				
 						# Process left and right seperately
 						var dual_mono_output = []
 						for channel in ["c1", "c2"]:
-							var dual_mono_file = Global.infile.get_basename() + "_%s.wav" % channel
+							var dual_mono_file = current_infile.get_basename() + "_%s.wav" % channel
 							
 							var makeprocess = make_process(node, process_count, dual_mono_file, slider_data)
 							# run the command

+ 1 - 1
scenes/main/control.tscn

@@ -31,7 +31,6 @@ access = 2
 use_native_dialog = true
 
 [node name="mainmenu" parent="." instance=ExtResource("3_dtf4o")]
-visible = false
 layout_mode = 1
 offset_top = 35.0
 
@@ -40,6 +39,7 @@ auto_translate_mode = 1
 title = "Wrong File Type"
 initial_position = 2
 size = Vector2i(450, 500)
+visible = false
 transient = true
 exclusive = true
 unresizable = true

+ 51 - 29
scenes/menu/menu.tscn

@@ -21,16 +21,14 @@ offset_right = 300.0
 offset_bottom = 226.0
 grow_horizontal = 2
 grow_vertical = 2
-current_tab = 1
+current_tab = 0
 
 [node name="Time Domain" type="TabContainer" parent="select_effect"]
-visible = false
 layout_mode = 2
-current_tab = 4
+current_tab = 0
 metadata/_tab_index = 0
 
 [node name="Distort" type="VBoxContainer" parent="select_effect/Time Domain"]
-visible = false
 layout_mode = 2
 metadata/_tab_index = 0
 
@@ -158,6 +156,28 @@ text = "+"
 layout_mode = 2
 theme_override_constants/margin_bottom = 3
 
+[node name="HSplitContainer6" type="HSplitContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
+custom_minimum_size = Vector2(565, 0)
+layout_mode = 2
+split_offset = 505
+dragging_enabled = false
+
+[node name="RichTextLabel" type="RichTextLabel" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer6"]
+layout_mode = 2
+bbcode_enabled = true
+text = "[b]Interpolate[/b]
+Time-stretch by repeating and interpolating wavecycles"
+fit_content = true
+scroll_active = false
+
+[node name="distort_interpolate" type="Button" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer6" groups=["make_node_buttons"]]
+layout_mode = 2
+text = "+"
+
+[node name="MarginContainer6" type="MarginContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
+layout_mode = 2
+theme_override_constants/margin_bottom = 3
+
 [node name="HSplitContainer5" type="HSplitContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
 custom_minimum_size = Vector2(565, 0)
 layout_mode = 2
@@ -180,87 +200,87 @@ text = "+"
 layout_mode = 2
 theme_override_constants/margin_bottom = 3
 
-[node name="HSplitContainer6" type="HSplitContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
+[node name="HSplitContainer11" type="HSplitContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
 custom_minimum_size = Vector2(565, 0)
 layout_mode = 2
 split_offset = 505
 dragging_enabled = false
 
-[node name="RichTextLabel" type="RichTextLabel" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer6"]
+[node name="RichTextLabel" type="RichTextLabel" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer11"]
 layout_mode = 2
 bbcode_enabled = true
-text = "[b]Interpolate[/b]
-Time-stretch by repeating and interpolating between wavecycles"
+text = "[b]Power Factor[/b]
+Distortion by raising sample values to a power"
 fit_content = true
 scroll_active = false
 
-[node name="distort_interpolate" type="Button" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer6" groups=["make_node_buttons"]]
+[node name="quirk_quirk_1" type="Button" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer11" groups=["make_node_buttons"]]
 layout_mode = 2
 text = "+"
 
-[node name="MarginContainer6" type="MarginContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
+[node name="MarginContainer10" type="MarginContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
 layout_mode = 2
 theme_override_constants/margin_bottom = 3
 
-[node name="HSplitContainer7" type="HSplitContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
+[node name="HSplitContainer10" type="HSplitContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
 custom_minimum_size = Vector2(565, 0)
 layout_mode = 2
 split_offset = 505
 dragging_enabled = false
 
-[node name="RichTextLabel" type="RichTextLabel" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer7"]
+[node name="RichTextLabel" type="RichTextLabel" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer10"]
 layout_mode = 2
 bbcode_enabled = true
-text = "[b]Square[/b]
-Convert wavecycles to square waves"
+text = "[b]Replace[/b]
+The strongest wavecycle in a group replaces the others"
 fit_content = true
 scroll_active = false
 
-[node name="distort_reform_2" type="Button" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer7" groups=["make_node_buttons"]]
+[node name="distort_replace" type="Button" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer10" groups=["make_node_buttons"]]
 layout_mode = 2
 text = "+"
 
-[node name="MarginContainer7" type="MarginContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
+[node name="MarginContainer9" type="MarginContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
 layout_mode = 2
 theme_override_constants/margin_bottom = 3
 
-[node name="HSplitContainer8" type="HSplitContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
+[node name="HSplitContainer7" type="HSplitContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
 custom_minimum_size = Vector2(565, 0)
 layout_mode = 2
 split_offset = 505
 dragging_enabled = false
 
-[node name="RichTextLabel" type="RichTextLabel" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer8"]
+[node name="RichTextLabel" type="RichTextLabel" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer7"]
 layout_mode = 2
 bbcode_enabled = true
-text = "[b]Triangle[/b]
-Convert wavecycles to triangle waves"
+text = "[b]Square[/b]
+Convert wavecycles to square waves"
 fit_content = true
 scroll_active = false
 
-[node name="distort_reform_4" type="Button" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer8" groups=["make_node_buttons"]]
+[node name="distort_reform_2" type="Button" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer7" groups=["make_node_buttons"]]
 layout_mode = 2
 text = "+"
 
-[node name="MarginContainer9" type="MarginContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
+[node name="MarginContainer7" type="MarginContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
 layout_mode = 2
 theme_override_constants/margin_bottom = 3
 
-[node name="HSplitContainer10" type="HSplitContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
+[node name="HSplitContainer8" type="HSplitContainer" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer"]
 custom_minimum_size = Vector2(565, 0)
 layout_mode = 2
 split_offset = 505
 dragging_enabled = false
 
-[node name="RichTextLabel" type="RichTextLabel" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer10"]
+[node name="RichTextLabel" type="RichTextLabel" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer8"]
 layout_mode = 2
 bbcode_enabled = true
-text = "[b]Replace[/b]
-The strongest wavecycle in a group replaces the others"
+text = "[b]Triangle[/b]
+Convert wavecycles to triangle waves"
 fit_content = true
 scroll_active = false
 
-[node name="distort_replace" type="Button" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer10" groups=["make_node_buttons"]]
+[node name="distort_reform_4" type="Button" parent="select_effect/Time Domain/Distort/MarginContainer/ScrollContainer/VBoxContainer/HSplitContainer8" groups=["make_node_buttons"]]
 layout_mode = 2
 text = "+"
 
@@ -623,6 +643,7 @@ layout_mode = 2
 theme_override_constants/margin_bottom = 3
 
 [node name="Misc" type="VBoxContainer" parent="select_effect/Time Domain"]
+visible = false
 layout_mode = 2
 metadata/_tab_index = 4
 
@@ -751,12 +772,12 @@ layout_mode = 2
 theme_override_constants/margin_bottom = 3
 
 [node name="Frequency Domain" type="TabContainer" parent="select_effect"]
+visible = false
 layout_mode = 2
-current_tab = 1
+current_tab = 0
 metadata/_tab_index = 1
 
 [node name="Convert" type="VBoxContainer" parent="select_effect/Frequency Domain"]
-visible = false
 layout_mode = 2
 metadata/_tab_index = 0
 
@@ -826,6 +847,7 @@ layout_mode = 2
 text = "+"
 
 [node name="Process" type="VBoxContainer" parent="select_effect/Frequency Domain"]
+visible = false
 layout_mode = 2
 metadata/_tab_index = 1