void Manipulation_replaceOriginalSound (Manipulation me, Sound sound) { try { my sound = Sound_convertToMono (sound); Vector_subtractMean (my sound.get()); my lpc = autoLPC(); } catch (MelderError) { Melder_throw (me, U": original Sound not replaced with ", sound, U"."); } }
PointEditor PointEditor_create (const wchar_t *title, PointProcess point, Sound sound) { try { autoPointEditor me = Thing_new (PointEditor); if (sound) { my monoSound = Sound_convertToMono (sound); } my structTimeSoundEditor :: f_init (title, point, my monoSound, false); return me.transfer(); } catch (MelderError) { Melder_throw ("PointProcess window not created."); } }
autoPointEditor PointEditor_create (const char32 *title, PointProcess point, Sound sound) { try { autoPointEditor me = Thing_new (PointEditor); if (sound) { my monoSound = Sound_convertToMono (sound); } TimeSoundEditor_init (me.get(), title, point, my monoSound.get(), false); return me; } catch (MelderError) { Melder_throw (U"PointProcess window not created."); } }
autoManipulation Sound_PointProcess_to_Manipulation (Sound sound, PointProcess point) { try { autoManipulation me = Manipulation_create (sound -> xmin, sound -> xmax); my sound = Sound_convertToMono (sound); Vector_subtractMean (my sound.get()); my pulses = Data_copy (point); my pitch = PointProcess_to_PitchTier (point, MAX_T); return me; } catch (MelderError) { Melder_throw (sound, U" & ", point, U": not converted to Manipulation."); } }
autoManipulation Sound_to_Manipulation (Sound me, double timeStep, double minimumPitch, double maximumPitch) { try { autoManipulation thee = Manipulation_create (my xmin, my xmax); thy sound = Sound_convertToMono (me); Vector_subtractMean (thy sound.get()); autoPitch pitch = Sound_to_Pitch (thy sound.get(), timeStep, minimumPitch, maximumPitch); thy pulses = Sound_Pitch_to_PointProcess_cc (thy sound.get(), pitch.get()); thy pitch = Pitch_to_PitchTier (pitch.get()); /* (DurationTier has been done at creation time) */ return thee; } catch (MelderError) { Melder_throw (me, U": not converted to Manipulation."); } }