Page 1 of 1

Pure Data Audio Processor

Posted: Sun Jun 23, 2024 9:25 pm
by dpoznan
Has anyone used the Pure Data audio processing tool and inserted it into the openMHA audio stream?

I want to identify and modify phonemes in the audio stream and use openMHA and its plugins.
Pure Data does not exist as a plugin so it would be necessary to route the oudio to PD and then back
into the openMHA data stream.

How would one do that? Currently, I am running on a Mac, but will want to move to PHL.

Thanks,

Dan Poznanovic

Re: Pure Data Audio Processor

Posted: Tue Jun 25, 2024 10:49 am
by uno9taitaeJ3
The easiest way to achieve this would be to run two openMHA instances and one pd instance and to chain them all using Jack. You have to alter the Jack name of one of the openMHA instances with e.g. io.name=MHA2 and its default TCP port with e.g. port=33336.

Re: Pure Data Audio Processor

Posted: Wed Jun 26, 2024 8:36 pm
by dpoznan
I have two instances of openMHA running.

I have jack set via
jack_connect MHA:in_1 system:capture_1
jack_connect MHA:in_2 system:capture_2
jack_connect MHA:out_1 system:playback_1
jack_connect MHA:out_2 system:playback_2
jack_connect MHA2:in_1 system:capture_1
jack_connect MHA2:in_2 system:capture_2
jack_connect MHA2:out_1 system:playback_1
jack_connect MHA2:out_2 system:playback_2


In python I have one instance using
mha_Device.set_val('io.name','MHA2')

and the other using
mha_Device.set_val('io.name','MHA')

How do I connect the PD into jack and the openMHA instances?


Dan..

Re: Pure Data Audio Processor

Posted: Wed Jun 26, 2024 10:07 pm
by dpoznan
I think this is the way to connect.... I am working on a test python code


jack_connect MHA:in_1 system:capture_1
jack_connect MHA:in_2 system:capture_2

jack_connect MHA:out_1 pure_data:input_1
jack_connect MHA:out_2 pure_data:input_2

jack_connect pure_data:output_1 MHA2:in_1
jack_connect pure_data:output_2 MHA2:in_2

jack_connect MHA2:out_1 system:playback_1
jack_connect MHA2:out_2 system:playback_2

I'll update with test results..

Dan..

Re: Pure Data Audio Processor

Posted: Wed Jun 26, 2024 10:53 pm
by dpoznan
It works. mic-->MHA-->PD---->MHA2--->spkr

in MHA
mha_Device.set_val('io.name','MHA')
mha_Device.set_val('io.con_in ',' [system:capture_1 system:capture_1]')
mha_Device.set_val('io.con_out ',' [pure_data:input_1 pure_data:input_2]')

in MHA2
mha_Device.set_val('io.name','MHA2')
mha_Device.set_val('io.con_in ',' [pure_data:output_1 pure_data:output_2]')
mha_Device.set_val('io.con_out ',' [system:playback_1 system:playback_2]')