Browse Source

started implementing multi input pvoc files

Jonathan Higgins 4 months ago
parent
commit
72bc9e035a
2 changed files with 63 additions and 2 deletions
  1. 60 0
      scenes/main/process_help.json
  2. 3 2
      scenes/main/scripts/run_thread.gd

+ 60 - 0
scenes/main/process_help.json

@@ -3952,6 +3952,66 @@
 	"subcategory": "convert",
 	"subcategory": "convert",
 	"title": "Resynthesise"
 	"title": "Resynthesise"
   },
   },
+  "formants_vocode": {
+	"category": "pvoc",
+	"description": "This process takes the spectral envelope of the second inlet and imposes it over the sound in the first inlet. This allows you to create a blend of the two sounds where the timbre of the first inlet will take on the shape and emphasis of the second.",
+	"inputtype": "[1, 1]",
+	"outputtype": "[1]",
+	"parameters": {
+	  "param1": {
+		"paramname": "Formant Bands",
+		"paramdescription": "The number of frequency bands to identify and impose on the sound",
+		"automatable": false,
+		"outputduration": false,
+		"time": false,
+		"min": false,
+		"max": false,
+		"flag": "-p",
+		"minrange": 1.0,
+		"maxrange": 12.0,
+		"step": 1.0,
+		"value": 8.0,
+		"exponential": false,
+		"uitype": "hslider"
+	  },
+	  "param2": {
+		"paramname": "High Pass Cutoff",
+		"paramdescription": "Removes all frequencies below this point (in Hz)",
+		"automatable": false,
+		"outputduration": false,
+		"time": false,
+		"min": true,
+		"max": false,
+		"flag": "-l",
+		"minrange": 5.0,
+		"maxrange": 20000.0,
+		"step": 0.01,
+		"value": 5.0,
+		"exponential": true,
+		"uitype": "hslider"
+	  },
+	  "param3": {
+		"paramname": "Low Pass Cutoff",
+		"paramdescription": "Removes all frequencies above this point (in Hz)",
+		"automatable": false,
+		"outputduration": false,
+		"time": false,
+		"min": false,
+		"max": true,
+		"flag": "-h",
+		"minrange": 5.0,
+		"maxrange": 20000.0,
+		"step": 0.01,
+		"value": 20000.0,
+		"exponential": true,
+		"uitype": "hslider"
+	  }
+	},
+	"short_description": "Impose the formants of one sound onto another",
+	"stereo": false,
+	"subcategory": "formants",
+	"title": "Formant Vocode"
+  },
   "strange_glis_2": {
   "strange_glis_2": {
 	"category": "pvoc",
 	"category": "pvoc",
 	"description": "Extracts the spectral contour of the sound retaining any spectral articulation, such as patterns of speech, but replaces the signal by rising (positive values for Glissando Rate) or falling (negative values for Glissando Rate) inharmonic glissandos.",
 	"description": "Extracts the spectral contour of the sound retaining any spectral articulation, such as patterns of speech, but replaces the signal by rising (positive values for Glissando Rate) or falling (negative values for Glissando Rate) inharmonic glissandos.",

+ 3 - 2
scenes/main/scripts/run_thread.gd

@@ -219,6 +219,7 @@ func run_thread_with_branches():
 				current_infiles[inlet_idx] = files[0] #only one file, do not merge add to dictionary
 				current_infiles[inlet_idx] = files[0] #only one file, do not merge add to dictionary
 		
 		
 		#if the dictionary has more than one entry there is more than one inlet and files need to be matched
 		#if the dictionary has more than one entry there is more than one inlet and files need to be matched
+		#however this should only be done to nodes with audio files rather than pvoc nodes
 		if current_infiles.size() > 1 and node.get_slot_type_left(0) == 0:
 		if current_infiles.size() > 1 and node.get_slot_type_left(0) == 0:
 			#check all files in dictionary have the same sample rate and channel count and fix if not
 			#check all files in dictionary have the same sample rate and channel count and fix if not
 			var all_files = current_infiles.values()
 			var all_files = current_infiles.values()
@@ -322,7 +323,7 @@ func run_thread_with_branches():
 						
 						
 					output_files[node_name] = pvoc_stereo_files
 					output_files[node_name] = pvoc_stereo_files
 				else:
 				else:
-					var input_stereo = await is_stereo(current_infile)
+					var input_stereo = await is_stereo(current_infiles.values()[0])
 					if input_stereo == true: 
 					if input_stereo == true: 
 						#audio file is stereo and needs to be split for pvoc processing
 						#audio file is stereo and needs to be split for pvoc processing
 						var pvoc_stereo_files = []
 						var pvoc_stereo_files = []
@@ -357,7 +358,7 @@ func run_thread_with_branches():
 						output_files[node_name] = pvoc_stereo_files
 						output_files[node_name] = pvoc_stereo_files
 					else: 
 					else: 
 						#input file is mono run through process
 						#input file is mono run through process
-						var makeprocess = await make_process(node, process_count, current_infile, slider_data)
+						var makeprocess = await make_process(node, process_count, current_infiles.values(), slider_data)
 						# run the command
 						# run the command
 						await run_command(makeprocess[0], makeprocess[3])
 						await run_command(makeprocess[0], makeprocess[3])
 						await get_tree().process_frame
 						await get_tree().process_frame