| 1 | #ifndef _Manipulation_h_ |
| 2 | #define _Manipulation_h_ |
| 3 | /* Manipulation.h |
| 4 | * |
| 5 | * Copyright (C) 1992-2005,2007,2011,2015,2016,2018,2022,2023 Paul Boersma |
| 6 | * |
| 7 | * This code is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or (at |
| 10 | * your option) any later version. |
| 11 | * |
| 12 | * This code is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 15 | * See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #include "Sound.h" |
| 22 | #include "PointProcess.h" |
| 23 | #include "PitchTier.h" |
| 24 | #include "DurationTier.h" |
| 25 | #include "LPC.h" |
| 26 | |
| 27 | /* The following have to be included for compatibility. */ |
| 28 | #include "IntensityTier.h" |
| 29 | #include "Intensity.h" |
| 30 | #include "FormantTier.h" |
| 31 | #include "Formant.h" |
| 32 | #include "Pitch.h" |
| 33 | #include "Image.h" |
| 34 | |
| 35 | #include "Manipulation_def.h" |
| 36 | |
| 37 | /* How to create an Manipulation. */ |
| 38 | |
| 39 | autoManipulation Manipulation_create (double tmin, double tmax); |
| 40 | void Manipulation_replaceOriginalSound (Manipulation me, Sound sound); |
| 41 | void Manipulation_replacePulses (Manipulation me, PointProcess pulses); |
| 42 | void Manipulation_replaceIntensityTier (Manipulation me, IntensityTier intensity); |
| 43 | void Manipulation_replacePitchTier (Manipulation me, PitchTier pitch); |
| 44 | void Manipulation_replaceDurationTier (Manipulation me, DurationTier duration); |
| 45 | |
| 46 | autoManipulation Sound_to_Manipulation (Sound me, double timeStep, double pitchFloor, double pitchCeiling); |
| 47 | autoManipulation Sound_Pitch_to_Manipulation (Sound sound, Pitch pitch); |
| 48 | autoManipulation Sound_PointProcess_to_Manipulation (Sound sound, PointProcess point); |
| 49 | autoManipulation Manipulation_AnyTier_to_Manipulation (Manipulation manip, AnyTier tier); |
| 50 | |
| 51 | /* Resynthesis. */ |
| 52 | |
| 53 | #define Manipulation_OVERLAPADD 1 |
| 54 | #define Manipulation_PULSES 2 |
| 55 | #define Manipulation_PULSES_HUM 3 |
| 56 | #define Manipulation_PITCH 4 |
| 57 | #define Manipulation_PITCH_HUM 5 |
| 58 | #define Manipulation_PULSES_PITCH 6 |
| 59 | #define Manipulation_PULSES_PITCH_HUM 7 |
| 60 | #define Manipulation_OVERLAPADD_NODUR 8 |
| 61 | #define Manipulation_PULSES_FORMANT 9 |
| 62 | #define Manipulation_PULSES_FORMANT_INTENSITY 10 |
| 63 | #define Manipulation_PULSES_LPC 11 |
| 64 | #define Manipulation_PULSES_LPC_INTENSITY 12 |
| 65 | #define Manipulation_PITCH_LPC 13 |
| 66 | #define Manipulation_PITCH_LPC_INTENSITY 14 |
| 67 | #define Manipulation_PITCH_LPC_INT_DUR 15 |
| 68 | autoSound Sound_Point_Point_to_Sound (Sound me, PointProcess source, PointProcess target, double maxT); |
| 69 | /*void Sound_Formant_Intensity_filter (Sound me, FormantTier formant, IntensityTier intensity);*/ |
| 70 | |
| 71 | autoSound Manipulation_to_Sound (Manipulation me, int method); |
| 72 | void Manipulation_playPart (Manipulation me, double tmin, double tmax, int method); // BUG: why no callback? |
| 73 | void Manipulation_play (Manipulation me, int method); |
| 74 | void Manipulation_writeToTextFileWithoutSound (Manipulation me, MelderFile file); |
| 75 | void Manipulation_writeToBinaryFileWithoutSound (Manipulation me, MelderFile file); |
| 76 | |
| 77 | /* The low-level synthesis routines. */ |
| 78 | |
| 79 | autoSound Sound_Point_Pitch_Duration_to_Sound (Sound me, PointProcess pulses, |
| 80 | PitchTier pitch, DurationTier duration, double maxT); |
| 81 | |
| 82 | /* End of file Manipulation.h */ |
| 83 | #endif |