[med-svn] [Git][med-team/praat][upstream] New upstream version 6.2.07
Rafael Laboissière (@rafael)
gitlab at salsa.debian.org
Wed Feb 2 09:08:15 GMT 2022
Rafael Laboissière pushed to branch upstream at Debian Med / praat
Commits:
159a1b01 by Rafael Laboissière at 2022-02-02T03:45:25-03:00
New upstream version 6.2.07
- - - - -
15 changed files:
- dwtools/AnalyticSound.cpp
- dwtools/AnalyticSound.h
- dwtools/Makefile
- + dwtools/Sound_and_TextGrid_extensions.cpp
- + dwtools/Sound_and_TextGrid_extensions.h
- dwtools/Sound_extensions.cpp
- dwtools/Sound_extensions.h
- dwtools/praat_David_init.cpp
- dwtools/praat_MultiSampledSpectrogram.cpp
- fon/TextGridEditor.cpp
- fon/manual_tutorials.cpp
- melder/melder_textencoding.cpp
- sys/praat_version.h
- + test/fon/examples/あ あ.wav
- test/fon/soundFiles.praat
Changes:
=====================================
dwtools/AnalyticSound.cpp
=====================================
@@ -1,6 +1,6 @@
/* AnalyticSound.cpp
*
- * Copyright (C) 2021 David Weenink
+ * Copyright (C) 2021-2022 David Weenink
*
* This code is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -46,6 +46,17 @@ autoAnalyticSound Sound_to_AnalyticSound (Sound me) {
}
}
+autoSound AnalyticSound_to_Sound (AnalyticSound me) {
+ try {
+ auto thee = Sound_create (my ny, my xmin, my xmax, my nx, my dx, my x1);
+ thy z.row (1) <<= my z.row (1);
+ thy z.row (2) <<= my z.row (2);
+ return thee;
+ } catch (MelderError) {
+ Melder_throw (me, U": could not create AnalyticSound.");
+ }
+}
+
autoIntensity AnalyticSound_to_Intensity (AnalyticSound me) {
try {
autoIntensity thee = Intensity_create (my xmin, my xmax, my nx, my dx, my x1);
=====================================
dwtools/AnalyticSound.h
=====================================
@@ -2,7 +2,7 @@
#define _AnalyticSound_h_
/* AnalyticSound.h
*
- * Copyright (C) 2021 David Weenink
+ * Copyright (C) 2021-2022 David Weenink
*
* This code is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,6 +29,8 @@ autoAnalyticSound AnalyticSound_create (double xmin, double xmax, integer nx, do
autoAnalyticSound Sound_to_AnalyticSound (Sound me);
+autoSound AnalyticSound_to_Sound (AnalyticSound me);
+
autoIntensity AnalyticSound_to_Intensity (AnalyticSound me);
#endif /* _AnalyticSound_h_ */
=====================================
dwtools/Makefile
=====================================
@@ -1,6 +1,6 @@
# Makefile of the library "dwtools"
# David Weenink and Paul Boersma
-# 10 June 2021
+# 27 January 2022
include ../makefile.defs
@@ -44,7 +44,8 @@ OBJECTS = ActivationList.o AffineTransform.o AnalyticSound.o \
Resonator.o Roots_to_Spectrum.o \
Sound_and_MultiSampledSpectrogram.o Sound_and_MixingMatrix.o \
Sound_and_Spectrum_dft.o \
- Sound_and_Spectrogram_extensions.o Sound_and_PCA.o Sound_extensions.o \
+ Sound_and_Spectrogram_extensions.o Sound_and_PCA.o \
+ Sound_and_TextGrid_extensions.o Sound_extensions.o \
Sound_to_MFCC.o Sounds_to_DTW.o \
Sound_to_Pitch2.o Sound_to_SPINET.o SPINET.o SPINET_to_Pitch.o \
Spectrogram_extensions.o Spectrum_extensions.o Spectrum_and_MultiSampledSpectrogram.o \
=====================================
dwtools/Sound_and_TextGrid_extensions.cpp
=====================================
@@ -0,0 +1,135 @@
+/* Sound_and_TextGrid_extensions.cpp
+ *
+ * Copyright (C) 1993-2022 David Weenink
+ *
+ * This code is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This code is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this work. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Intensity_extensions.h"
+#include "Sound_and_TextGrid_extensions.h"
+#include "Sound_and_Spectrum.h"
+#include "Sound_to_Intensity.h"
+
+autoIntervalTier Sound_to_IntervalTier_highMidLowIntervals (Sound me, double min, double max) {
+ try {
+ autoIntervalTier thee = IntervalTier_create (my xmin, my xmax);
+ double startTime = my xmin, endTime = my xmax;
+ bool firstInterval = true;
+ VEC z (my z[1]);
+ int level = ( z [1] > max ? 1 : z [1] < min ? -1 : 0 );
+ for (integer isamp = 2; isamp <= z.size; isamp ++) {
+ const int leveli = ( z [isamp] > max ? 1 : z [isamp] < min ? -1 : 0 );
+ if (leveli == level)
+ continue;
+ // new interval
+ endTime = my x1 + (isamp - 1 - 0.5) * my dx; // midpoint
+ conststring32 label = ( level == 1 ? U"High" : level == -1 ? U"Low" : U"Mid" );
+ if (firstInterval) {
+ TextInterval interval = thy intervals .at[1];
+ interval -> xmax = endTime;
+ autostring32 firstLabel = Melder_dup (label);
+ interval -> text = firstLabel. move();
+ firstInterval = false;
+ } else {
+ autoTextInterval interval = TextInterval_create (startTime, endTime, label);
+ thy intervals. addItem_move (interval.move());
+ }
+ startTime = endTime;
+ level = leveli;
+ }
+ conststring32 last_label = ( level == 1 ? U"High" : level == -1 ? U"Low" : U"Mid" );
+ autoTextInterval interval = TextInterval_create (startTime, my xmax, last_label);
+ thy intervals. addItem_move (interval.move());
+ return thee;
+ } catch (MelderError) {
+ Melder_throw (me, U": no IntervalTier with High/Mid/Low intervals created.");
+ }
+}
+
+autoTextGrid Sound_to_TextGrid_highMidLowIntervals (Sound me, double min, double max) {
+ try {
+ autoTextGrid thee = TextGrid_createWithoutTiers (my xmin, my xmax);
+ autoIntervalTier intervals = Sound_to_IntervalTier_highMidLowIntervals (me, min, max);
+ thy tiers -> addItem_move (intervals.move());
+ return thee;
+ } catch (MelderError) {
+ Melder_throw (me, U": no TextGrid with High/Mid/Low intervals created.");
+ }
+}
+
+autoSound Sound_IntervalTier_cutPartsMatchingLabel (Sound me, IntervalTier thee, conststring32 match) {
+ try {
+ /*
+ Count samples of the trimmed sound
+ */
+ integer ixmin, ixmax, numberOfSamples = 0, previous_ixmax = 0;
+ double xmin = my xmin; // start time of output sound is start time of input sound
+ for (integer iint = 1; iint <= thy intervals.size; iint ++) {
+ TextInterval interval = thy intervals.at [iint];
+ if (! Melder_equ (interval -> text.get(), match)) {
+ numberOfSamples += Sampled_getWindowSamples (me, interval -> xmin, interval -> xmax, & ixmin, & ixmax);
+ /*
+ If two contiguous intervals have to be copied then the last sample of previous interval
+ and first sample of current interval might sometimes be equal
+ */
+ if (ixmin == previous_ixmax)
+ -- numberOfSamples;
+ previous_ixmax = ixmax;
+ } else { // matches label
+ if (iint == 1) // Start time of output sound is end time of first interval
+ xmin = interval -> xmax;
+ }
+ }
+ /*
+ Now copy the parts. The output sound starts at xmin
+ */
+ autoSound him = Sound_create (my ny, xmin, xmin + numberOfSamples * my dx, numberOfSamples, my dx, xmin + 0.5 * my dx);
+ numberOfSamples = 0;
+ previous_ixmax = 0;
+ for (integer iint = 1; iint <= thy intervals.size; iint ++) {
+ const TextInterval interval = thy intervals.at [iint];
+ if (! Melder_equ (interval -> text.get(), match)) {
+ Sampled_getWindowSamples (me, interval -> xmin, interval -> xmax, & ixmin, & ixmax);
+ if (ixmin == previous_ixmax)
+ ixmin ++;
+ previous_ixmax = ixmax;
+ integer numberOfSamplesToCopy = ixmax - ixmin + 1;
+ his z.part (1, my ny, numberOfSamples + 1, numberOfSamples + numberOfSamplesToCopy) <<= my z.part (1, my ny, ixmin, ixmax);
+ numberOfSamples += numberOfSamplesToCopy;
+ }
+ }
+ Melder_assert (numberOfSamples == his nx);
+ return him;
+ } catch (MelderError) {
+ Melder_throw (me, U": intervals not trimmed.");
+ }
+}
+
+autoTextGrid Sound_to_TextGrid_detectSilences (Sound me, double minPitch, double timeStep,
+ double silenceThreshold, double minSilenceDuration, double minSoundingDuration,
+ conststring32 silentLabel, conststring32 soundingLabel)
+{
+ try {
+ const bool subtractMeanPressure = true;
+ autoSound filtered = Sound_filter_passHannBand (me, 80.0, 8000.0, 80.0);
+ autoIntensity thee = Sound_to_Intensity (filtered.get(), minPitch, timeStep, subtractMeanPressure);
+ autoTextGrid him = Intensity_to_TextGrid_detectSilences (thee.get(), silenceThreshold, minSilenceDuration, minSoundingDuration, silentLabel, soundingLabel);
+ return him;
+ } catch (MelderError) {
+ Melder_throw (me, U": no TextGrid with silences created.");
+ }
+}
+
+
+/* End of file Sound_and_TextGrid_extensions.cpp */
=====================================
dwtools/Sound_and_TextGrid_extensions.h
=====================================
@@ -0,0 +1,36 @@
+#ifndef _Sound_and_TextGrid_extensions_h_
+#define _Sound_and_TextGrid_extensions_h_
+/* Sound_and_TextGrid_extensions.h
+ *
+ * Copyright (C) 1993-2022 David Weenink
+ *
+ * This code is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This code is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this work. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Sound.h"
+#include "TextGrid.h"
+
+autoIntervalTier Sound_to_IntervalTier_highMidLowIntervals (Sound me, double min, double max);
+autoTextGrid Sound_to_TextGrid_highMidLowIntervals (Sound me, double min, double max);
+
+autoTextGrid Sound_to_TextGrid_detectSilences (Sound me, double minPitch, double timeStep,
+ double silenceThreshold, double minSilenceDuration, double minSoundingDuration,
+ conststring32 silentLabel, conststring32 soundingLabel);
+
+autoTextGrid Sound_to_TextGrid_detectVoiceActivity_lsfm (Sound me, double timeStep, double longTermWindow_r,
+ double shorttimeAveragingWindow, double lowFrequencyThreshold, double highFrequencyThreshold, double lsfmThreshold,
+ double silenceThreshold_dB, double minSilenceDuration,
+ double minSoundingDuration, conststring32 novoiceAcivityLabel, conststring32 voiceAcivityLabel);
+
+#endif /* _Sound_and_TextGrid_extensions_h_ */
=====================================
dwtools/Sound_extensions.cpp
=====================================
@@ -1,6 +1,6 @@
/* Sound_extensions.cpp
*
- * Copyright (C) 1993-2021 David Weenink, 2017 Paul Boersma
+ * Copyright (C) 1993-2022 David Weenink, 2017 Paul Boersma
*
* This code is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
#include "Sound_and_Spectrum.h"
#include "Spectrum_extensions.h"
#include "Sound_and_Spectrogram.h"
+#include "Sound_and_TextGrid_extensions.h"
#include "Spectrogram_extensions.h"
#include "Sound_to_Intensity.h"
#include "Sound_to_Pitch.h"
@@ -1318,7 +1319,7 @@ double Sound_correlateParts (Sound me, double tx, double ty, double duration) {
}
-static double interpolate (Sound me, integer i1, integer channel, double level)
+static double interpolate2 (Sound me, integer i1, integer channel, double level)
/* Precondition: my z [1] [i1] != my z [1] [i1 + 1]; */
{
const integer i2 = i1 + 1;
@@ -1333,13 +1334,23 @@ double Sound_getNearestLevelCrossing (Sound me, integer channel, double position
if (leftSample > my nx)
return undefined;
const integer rightSample = leftSample + 1;
+
+ auto interpolateLinear = [&] (integer i1) -> double {
+ const integer i2 = i1 + 1;
+ const double x1 = Sampled_indexToX (me, i1); // x2 = x1 + dx
+ const double y1 = my z [channel] [i1], y2 = my z [channel] [i2];
+ /*
+ y = x1 + (x2 - x1) * (y1 - level) / (y1 - y2) = x1 + dx * (y1 - level) / (y1 - y2)
+ */
+ return x1 + my dx * (y1 - level) / (y1 - y2); // y1 <> y2!
+ };
/*
Are we already at a level crossing?
*/
if (leftSample >= 1 && rightSample <= my nx &&
(amplitude [leftSample] >= level) != (amplitude [rightSample] >= level))
{
- const double crossing = interpolate (me, leftSample, channel, level);
+ const double crossing = interpolateLinear (leftSample);
return searchDirection == kSoundSearchDirection::LEFT ?
( crossing <= position ? crossing : undefined ) :
( crossing >= position ? crossing : undefined );
@@ -1349,7 +1360,7 @@ double Sound_getNearestLevelCrossing (Sound me, integer channel, double position
if (searchDirection == kSoundSearchDirection::LEFT || searchDirection == kSoundSearchDirection::NEAREST) {
for (integer ileft = leftSample - 1; ileft >= 1; ileft --)
if ((amplitude [ileft] >= level) != (amplitude [ileft + 1] >= level)) {
- leftCrossing = interpolate (me, ileft, channel, level);
+ leftCrossing = interpolateLinear (ileft);
break;
}
if (searchDirection == kSoundSearchDirection::LEFT)
@@ -1362,7 +1373,7 @@ double Sound_getNearestLevelCrossing (Sound me, integer channel, double position
if (searchDirection == kSoundSearchDirection::RIGHT || searchDirection == kSoundSearchDirection::NEAREST) {
for (integer iright = rightSample + 1; iright <= my nx; iright ++)
if ((amplitude [iright] >= level) != (amplitude [iright - 1] >= level)) {
- rightCrossing = interpolate (me, iright - 1, channel, level);
+ rightCrossing = interpolateLinear (iright - 1);
break;
}
if (searchDirection == kSoundSearchDirection::RIGHT)
@@ -1718,20 +1729,6 @@ autoTextGrid Sound_to_TextGrid_detectVoiceActivity_lsfm (Sound me, double timeSt
}
}
-autoTextGrid Sound_to_TextGrid_detectSilences (Sound me, double minPitch, double timeStep,
- double silenceThreshold, double minSilenceDuration, double minSoundingDuration,
- conststring32 silentLabel, conststring32 soundingLabel) {
- try {
- const bool subtractMeanPressure = true;
- autoSound filtered = Sound_filter_passHannBand (me, 80.0, 8000.0, 80.0);
- autoIntensity thee = Sound_to_Intensity (filtered.get(), minPitch, timeStep, subtractMeanPressure);
- autoTextGrid him = Intensity_to_TextGrid_detectSilences (thee.get(), silenceThreshold, minSilenceDuration, minSoundingDuration, silentLabel, soundingLabel);
- return him;
- } catch (MelderError) {
- Melder_throw (me, U": no TextGrid with silences created.");
- }
-}
-
void Sound_getStartAndEndTimesOfSounding (Sound me, double minPitch, double timeStep, double silenceThreshold, double minSilenceDuration, double minSoundingDuration, double *out_t1, double *out_t2) {
try {
const conststring32 silentLabel = U"-", soundingLabel = U"+";
@@ -1755,54 +1752,6 @@ void Sound_getStartAndEndTimesOfSounding (Sound me, double minPitch, double time
}
}
-autoSound Sound_IntervalTier_cutPartsMatchingLabel (Sound me, IntervalTier thee, conststring32 match) {
- try {
- /*
- Count samples of the trimmed sound
- */
- integer ixmin, ixmax, numberOfSamples = 0, previous_ixmax = 0;
- double xmin = my xmin; // start time of output sound is start time of input sound
- for (integer iint = 1; iint <= thy intervals.size; iint ++) {
- TextInterval interval = thy intervals.at [iint];
- if (! Melder_equ (interval -> text.get(), match)) {
- numberOfSamples += Sampled_getWindowSamples (me, interval -> xmin, interval -> xmax, & ixmin, & ixmax);
- /*
- If two contiguous intervals have to be copied then the last sample of previous interval
- and first sample of current interval might sometimes be equal
- */
- if (ixmin == previous_ixmax)
- -- numberOfSamples;
- previous_ixmax = ixmax;
- } else { // matches label
- if (iint == 1) // Start time of output sound is end time of first interval
- xmin = interval -> xmax;
- }
- }
- /*
- Now copy the parts. The output sound starts at xmin
- */
- autoSound him = Sound_create (my ny, xmin, xmin + numberOfSamples * my dx, numberOfSamples, my dx, xmin + 0.5 * my dx);
- numberOfSamples = 0;
- previous_ixmax = 0;
- for (integer iint = 1; iint <= thy intervals.size; iint ++) {
- const TextInterval interval = thy intervals.at [iint];
- if (! Melder_equ (interval -> text.get(), match)) {
- Sampled_getWindowSamples (me, interval -> xmin, interval -> xmax, & ixmin, & ixmax);
- if (ixmin == previous_ixmax)
- ixmin ++;
- previous_ixmax = ixmax;
- integer numberOfSamplesToCopy = ixmax - ixmin + 1;
- his z.part (1, my ny, numberOfSamples + 1, numberOfSamples + numberOfSamplesToCopy) <<= my z.part (1, my ny, ixmin, ixmax);
- numberOfSamples += numberOfSamplesToCopy;
- }
- }
- Melder_assert (numberOfSamples == his nx);
- return him;
- } catch (MelderError) {
- Melder_throw (me, U": intervals not trimmed.");
- }
-}
-
autoSound Sound_trimSilences (Sound me, double trimDuration, bool onlyAtStartAndEnd, double minPitch, double timeStep, double silenceThreshold, double minSilenceDuration, double minSoundingDuration, autoTextGrid *p_tg, conststring32 trimLabel) {
try {
Melder_require (my ny == 1,
@@ -2066,7 +2015,7 @@ static void Sound_fadeIn_general (Sound me, int channel, double time, double fad
std::swap (startTime, endTime);
Melder_require (startTime < my xmax,
- U"The start time for fade-in should earlier than the end time of the sound.");
+ U"Fade-in should start before the end time of the sound.");
const integer numberOfSamplesFade = Melder_ifloor (fabs (fadeTime) / my dx);
autoVEC fadeWindow = raw_VEC (numberOfSamplesFade);
@@ -2098,7 +2047,7 @@ static void Sound_fadeOut_general (Sound me, int channel, double time, double fa
std::swap (startTime, endTime);
Melder_require (endTime > my xmin,
- U"The end time for fade-out should not be earlier than the start time of the sound.");
+ U"Fade-out should end after the start time of the sound.");
const integer numberOfSamplesFade = Melder_ifloor (fabs (fadeTime) / my dx);
autoVEC fadeWindow = raw_VEC (numberOfSamplesFade);
=====================================
dwtools/Sound_extensions.h
=====================================
@@ -2,7 +2,7 @@
#define _Sound_extensions_h_
/* Sound_extensions.h
*
- * Copyright (C) 1993-2021 David Weenink
+ * Copyright (C) 1993-2022 David Weenink
*
* This code is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -180,13 +180,6 @@ autoSound Sound_Pitch_changeSpeaker (Sound me, Pitch him,
autoSound Sound_changeGender_old (Sound me, double fmin, double fmax, double formantRatio,
double new_pitch, double pitchRangeFactor, double durationFactor);
-autoTextGrid Sound_to_TextGrid_detectSilences (Sound me, double minPitch, double timeStep,
- double silenceThreshold, double minSilenceDuration, double minSoundingDuration,
- conststring32 silentLabel, conststring32 soundingLabel);
-
-autoTextGrid Sound_to_TextGrid_detectVoiceActivity_lsfm (Sound me, double timeStep, double longTermWindow_r, double shorttimeAveragingWindow, double lowFrequencyThreshold, double highFrequencyThreshold, double lsfmThreshold, double silenceThreshold_dB, double minSilenceDuration,
- double minSoundingDuration, conststring32 novoiceAcivityLabel, conststring32 voiceAcivityLabel);
-
void Sound_getStartAndEndTimesOfSounding (Sound me, double minPitch, double timeStep,
double silenceThreshold, double minSilenceDuration, double minSoundingDuration, double *out_t1, double *out_t2);
=====================================
dwtools/praat_David_init.cpp
=====================================
@@ -112,6 +112,7 @@
#include "Roots_to_Spectrum.h"
#include "Sound_and_Spectrum_dft.h"
#include "Sound_extensions.h"
+#include "Sound_and_TextGrid_extensions.h"
#include "Sounds_to_DTW.h"
#include "Spectrum_extensions.h"
#include "Spectrogram.h"
@@ -5751,6 +5752,16 @@ DO
CONVERT_EACH_TO_ONE_END (my name.get())
}
+FORM (CONVERT_EACH_TO_ONE__Sound_to_TextGrid_highMidLowIntervals, U"Sound: To TextGrid (high, mid, low)", nullptr) {
+ REAL (maxLevel, U"Maximum level", U"0.5")
+ REAL (minLevel, U"Minimum level", U"-0.5")
+ OK
+DO
+ CONVERT_EACH_TO_ONE (Sound)
+ autoTextGrid result = Sound_to_TextGrid_highMidLowIntervals (me, minLevel, maxLevel);
+ CONVERT_EACH_TO_ONE_END (my name.get())
+}
+
FORM (CONVERT_EACH_TO_ONE__Sound_copyChannelRanges, U"Sound: Copy channel ranges", nullptr) {
NATURALVECTOR (channels, U"Create a new Sound from the following channels", RANGES_, U"1:64")
OK
@@ -10072,6 +10083,8 @@ void praat_David_init () {
CONVERT_EACH_TO_ONE__Sound_to_TextGrid_detectSilences);
praat_addAction1 (classSound, 0, U"To TextGrid (voice activity)...", U"To IntervalTier", 1,
CONVERT_EACH_TO_ONE__Sound_to_TextGrid_voiceActivity);
+ praat_addAction1 (classSound, 0, U"To TextGrid (high, mid, low)...", U"To IntervalTier", praat_HIDDEN + praat_DEPTH_1,
+ CONVERT_EACH_TO_ONE__Sound_to_TextGrid_highMidLowIntervals);
praat_addAction1 (classSound, 0, U"Play one channel...", U"Play", praat_HIDDEN,
PLAY_EACH__Sound_playOneChannel);
praat_addAction1 (classSound, 0, U"Play as frequency shifted...", U"Play", praat_HIDDEN,
=====================================
dwtools/praat_MultiSampledSpectrogram.cpp
=====================================
@@ -1,6 +1,6 @@
/* praat_MultiSampledSpectrogram.cpp
*
- * Copyright (C) 2021 David Weenink
+ * Copyright (C) 2021-2022 David Weenink
*
* This code is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,6 +30,12 @@ DIRECT (CONVERT_EACH_TO_ONE__AnalyticSound_toIntensity) {
CONVERT_EACH_TO_ONE_END (my name.get())
}
+DIRECT (CONVERT_EACH_TO_ONE__AnalyticSound_toSound) {
+ CONVERT_EACH_TO_ONE (AnalyticSound)
+ autoSound result = AnalyticSound_to_Sound (me);
+ CONVERT_EACH_TO_ONE_END (my name.get())
+}
+
FORM (MODIFY_EACH_WEAK__MultiSampledSpectrogram_formula, U"MultiSampledSpectrogram: Formula", U"MultiSampledSpectrogram: Formula...") {
FORMULA (formula, U"Formula", U"2 * self")
OK
@@ -164,6 +170,8 @@ void praat_MultiSampledSpectrogram_init () {
praat_addAction1 (classAnalyticSound, 0, U"To Intensity", nullptr, 0,
CONVERT_EACH_TO_ONE__AnalyticSound_toIntensity);
+ praat_addAction1 (classAnalyticSound, 0, U"To Sound", nullptr, 0,
+ CONVERT_EACH_TO_ONE__AnalyticSound_toSound);
praat_addAction1 (classConstantQLog2FSpectrogram, 0, U"Paint...", nullptr, 0,
GRAPHICS_EACH__ConstantQLog2FSpectrogram_paint);
=====================================
fon/TextGridEditor.cpp
=====================================
@@ -1718,7 +1718,8 @@ bool structTextGridEditor :: v_mouseInWideDataView (GuiDrawingArea_MouseEvent ev
}
if (anchorIsInWideSoundOrAnalysisPart)
return our TextGridEditor_Parent :: v_mouseInWideDataView (event, xWC, yWC);
- Melder_assert (anchorIsInWideTextGridPart);
+ if (! anchorIsInWideTextGridPart)
+ Melder_throw (U"Unexpected order of events: drag or drop without preceding click (\"anchor is not in wide TextGrid part\").");
const integer mouseTier = _TextGridEditor_yWCtoTier (this, yWC);
our draggingTime = undefined; // information to next expose event
=====================================
fon/manual_tutorials.cpp
=====================================
@@ -22,8 +22,11 @@
void manual_tutorials_init (ManPages me);
void manual_tutorials_init (ManPages me) {
-MAN_BEGIN (U"What's new?", U"ppgb", 20220120)
+MAN_BEGIN (U"What's new?", U"ppgb", 20220128)
INTRO (U"Latest changes in Praat.")
+NORMAL (U"##6.2.07# (28 January 2022)")
+LIST_ITEM (U"• Prevented a rare crash in the TextGrid window.")
+LIST_ITEM (U"• Windows: corrected a bug introduced 6.2.04 by which some file names were unreadable.")
NORMAL (U"##6.2.06# (20 January 2022)")
LIST_ITEM (U"• Mac: prevent Demo window from hanging on copy or paste.")
NORMAL (U"##6.2.05# (5 January 2022)")
@@ -31,7 +34,6 @@ LIST_ITEM (U"• Calling Praat from the command line: the switch $$--send$ sends
"to a different already running GUI instance of Praat; this is more flexible than using %sendpraat, "
"because $$--send$ will start a new instance of Praat if Praat is not yet running.")
NORMAL (U"##6.2.04# (18 December 2021)")
-LIST_ITEM (U"• TextGrid window on Mac: fix entering Japanese text with the Enter key.")
LIST_ITEM (U"• Praat now includes eSpeak 1.51, raising the number of supported languages from 100 to 130.")
LIST_ITEM (U"• Scripting: support for $$infile$, $$outfile$ and $folder fields in forms.")
LIST_ITEM (U"• Calling Praat from the command line: the switch $$--open$ now adds files to an already running instance of Praat; "
=====================================
melder/melder_textencoding.cpp
=====================================
@@ -575,7 +575,7 @@ autostringW Melder_32toW (conststring32 text) {
}
conststringW Melder_peek32toW_fileSystem (conststring32 string) {
static wchar_t buffer [1 + kMelder_MAXPATH];
- NormalizeString (NormalizationKC, Melder_peek32toW (string), -1, buffer, 1 + kMelder_MAXPATH);
+ NormalizeString (NormalizationC, Melder_peek32toW (string), -1, buffer, 1 + kMelder_MAXPATH);
//FoldStringW (MAP_PRECOMPOSED, Melder_peek32toW (string), -1, buffer, 1 + kMelder_MAXPATH); // this works even on XP
return buffer;
}
=====================================
sys/praat_version.h
=====================================
@@ -1,5 +1,5 @@
-#define PRAAT_VERSION_STR 6.2.06
-#define PRAAT_VERSION_NUM 6206
+#define PRAAT_VERSION_STR 6.2.07
+#define PRAAT_VERSION_NUM 6207
#define PRAAT_YEAR 2022
#define PRAAT_MONTH January
-#define PRAAT_DAY 21
+#define PRAAT_DAY 28
=====================================
test/fon/examples/あ あ.wav
=====================================
Binary files /dev/null and "b/test/fon/examples/\343\201\202\343\200\200\343\201\202.wav" differ
=====================================
test/fon/soundFiles.praat
=====================================
Binary files a/test/fon/soundFiles.praat and b/test/fon/soundFiles.praat differ
View it on GitLab: https://salsa.debian.org/med-team/praat/-/commit/159a1b01094f0a2ae6918e8bce9bb4f46812410a
--
View it on GitLab: https://salsa.debian.org/med-team/praat/-/commit/159a1b01094f0a2ae6918e8bce9bb4f46812410a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220202/7f722ce8/attachment-0001.htm>
More information about the debian-med-commit
mailing list