Skip to content
Commits on Source (5)
......@@ -7,6 +7,18 @@ What's new?
<p>
Latest changes in Praat.</p>
<p>
<b>6.0.49</b> (2 March 2019)</p>
<ul>
<li>
&nbsp;Removed a bug introduced in 6.0.41 whereby a script could misreport an undefined table value.
<li>
&nbsp;Removed a bug introduced in 6.0.44 whereby an MFCC's maximum frequency could be ignored.
<li>
&nbsp;Pitch: Tabulate candidates.
<li>
&nbsp;SoundSet.
</ul>
<p>
<b>6.0.48</b> (17 February 2019)</p>
<ul>
<li>
......@@ -644,7 +656,7 @@ What used to be new?</h3>
</ul>
<hr>
<address>
<p>&copy; ppgb, February 17, 2019</p>
<p>&copy; ppgb, March 2, 2019</p>
</address>
</body>
</html>
praat (6.0.49-1) unstable; urgency=medium
* New upstream version 6.0.49
* d/copyright: Reflect upstream changes
-- Rafael Laboissiere <rafael@debian.org> Sun, 10 Mar 2019 19:37:06 -0300
praat (6.0.48-1) unstable; urgency=medium
* New upstream version 6.0.48
......
......@@ -5,7 +5,7 @@ Source: http://www.fon.hum.uva.nl/praat/download_sources.html
Files: *
Copyright: 1990-2019 Paul Boersma
1992-2018 David Weenink
1992-2019 David Weenink
2007 Erez Volk
2002 Hansjoerg Mixdorff
2008, 2017 Stefan de Konink
......
/* CC.cpp
*
* Copyright (C) 1993-2018 David Weenink
* Copyright (C) 1993-2019 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
......@@ -49,7 +49,7 @@
Thing_implement (CC, Sampled, 1);
static integer CC_getMaximumNumberOfCoefficientsUsed (CC me) {
integer CC_getMaximumNumberOfCoefficientsUsed (CC me) {
integer numberOfCoefficients = 0;
for (integer iframe = 1; iframe <= my nx; iframe ++) {
CC_Frame cf = & my frame [iframe];
......
......@@ -2,7 +2,7 @@
#define _CC_h_
/* CC.h
*
* Copyright (C) 1993-2017 David Weenink
* Copyright (C) 1993-2019 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
......@@ -34,6 +34,8 @@ void CC_init (CC me, double tmin, double tmax, integer nt, double dt, double t1,
void CC_getNumberOfCoefficients_extrema (CC me, integer startframe, integer endframe, integer *min, integer *max);
integer CC_getMaximumNumberOfCoefficientsUsed (CC me);
integer CC_getMinimumNumberOfCoefficients (CC me, integer startframe, integer endframe);
integer CC_getMaximumNumberOfCoefficients (CC me, integer startframe, integer endframe);
......
......@@ -56,7 +56,7 @@ autoDTW CCs_to_DTW (CC me, CC thee, double coefficientWeight, double logEnergyWe
integer nr = Melder_ifloor (regressionWindowLength / my dx);
Melder_require (my maximumNumberOfCoefficients == thy maximumNumberOfCoefficients,
U"CC orders should be equal.");
U"The maximum number of coefficients should be equal.");
Melder_require (! (coefficientRegressionWeight != 0.0 && nr < 2),
U"Time window for regression is too small.");
......
/* Sound_and_Spectrogram_extensions.cpp
*
* Copyright (C) 1993-2018 David Weenink
* Copyright (C) 1993-2019 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
......@@ -166,7 +166,7 @@ static void Sound_into_MelSpectrogram_frame (Sound me, MelSpectrogram thee, inte
autoSpectrum him = Sound_to_Spectrum_power (me);
for (integer ifilter = 1; ifilter <= thy ny; ifilter ++) {
double power = 0;
longdouble power = 0.0;
double fc_mel = thy y1 + (ifilter - 1) * thy dy;
double fc_hz = thy v_frequencyToHertz (fc_mel);
double fl_hz = thy v_frequencyToHertz (fc_mel - thy dy);
......@@ -180,7 +180,7 @@ static void Sound_into_MelSpectrogram_frame (Sound me, MelSpectrogram thee, inte
double a = NUMtriangularfilter_amplitude (fl_hz, fc_hz, fh_hz, f);
power += a * his z [1] [i];
}
thy z [ifilter] [frame] = power;
thy z [ifilter] [frame] = double (power);
}
}
......@@ -195,8 +195,10 @@ autoMelSpectrogram Sound_to_MelSpectrogram (Sound me, double analysisWidth, doub
if (fmax_mel <= 0.0 || fmax_mel > fceiling)
fmax_mel = fceiling;
if (fmax_mel <= f1_mel)
f1_mel = fbottom; fmax_mel = fceiling;
if (fmax_mel <= f1_mel) {
f1_mel = fbottom;
fmax_mel = fceiling;
}
if (f1_mel <= 0.0)
f1_mel = fbottom;
if (df_mel <= 0.0)
......
......@@ -4072,6 +4072,12 @@ DO
NUMBER_ONE_END (U"")
}
DIRECT (NUMMAT_PatternList_getAllValues) {
NUMMAT_ONE (PatternList)
autoMAT result = newMATcopy (my z.all());
NUMMAT_ONE_END
}
FORM (MODIFY_PatternList_formula, U"PatternList: Formula", nullptr) {
LABEL (U"# `col` is the node number, `row` is the pattern number")
LABEL (U"for row from 1 to nrow ; for all patterns")
......@@ -8159,6 +8165,7 @@ void praat_uvafon_David_init () {
praat_addAction1 (classPatternList, 0, MODIFY_BUTTON, nullptr, 0, 0);
praat_addAction1 (classPatternList, 0, U"Formula...", nullptr, 1, MODIFY_PatternList_formula);
praat_addAction1 (classPatternList, 0, U"Set value...", nullptr, 1, MODIFY_PatternList_setValue);
praat_addAction1 (classPatternList, 0, U"Get all values", nullptr, 0, NUMMAT_PatternList_getAllValues);
praat_addAction1 (classPatternList, 0, U"To Matrix", nullptr, 0, NEW_PatternList_to_Matrix);
praat_addAction2 (classPatternList, 1, classCategories, 1, U"To TableOfReal", nullptr, 0, NEW1_Matrix_Categories_to_TableOfReal);
......
# Makefile of the library "fon"
# Paul Boersma, 10 August 2018
# Paul Boersma, 28 February 2019
include ../makefile.defs
......@@ -8,7 +8,7 @@ CPPFLAGS = -I ../kar -I ../melder -I ../sys -I ../dwsys -I ../stat -I ../dwtools
OBJECTS = Transition.o Distributions_and_Transition.o \
Function.o Sampled.o SampledXY.o Matrix.o Vector.o Polygon.o PointProcess.o \
Matrix_and_PointProcess.o Matrix_and_Polygon.o AnyTier.o RealTier.o \
Sound.o LongSound.o Sound_files.o Sound_audio.o PointProcess_and_Sound.o Sound_PointProcess.o ParamCurve.o \
Sound.o LongSound.o SoundSet.o Sound_files.o Sound_audio.o PointProcess_and_Sound.o Sound_PointProcess.o ParamCurve.o \
Pitch.o Harmonicity.o Intensity.o Matrix_and_Pitch.o Sound_to_Pitch.o \
Sound_to_Intensity.o Sound_to_Harmonicity.o Sound_to_Harmonicity_GNE.o Sound_to_PointProcess.o \
Pitch_to_PointProcess.o Pitch_to_Sound.o Pitch_Intensity.o \
......
......@@ -926,4 +926,40 @@ void Pitch_step (Pitch me, double step, double precision, double tmin, double tm
}
}
static autoTable Pitch_Frame_tabulateCandidates (Pitch_Frame me) {
autoTable you = Table_createWithColumnNames (my nCandidates, U"frequency strength");
for (integer icand = 1; icand <= my nCandidates; icand ++) {
Pitch_Candidate candidate = & my candidate [icand];
Table_setNumericValue (you.get(), icand, 1, candidate -> frequency);
Table_setNumericValue (you.get(), icand, 2, candidate -> strength);
}
return you;
}
autoTable Pitch_tabulateCandidatesInFrame (Pitch me, integer frameNumber) {
Pitch_checkFrameNumber (me, frameNumber);
Pitch_Frame frame = & my frame [frameNumber];
return Pitch_Frame_tabulateCandidates (frame);
}
autoTable Pitch_tabulateCandidates (Pitch me) {
integer totalNumberOfCandidates = 0;
for (integer iframe = 1; iframe <= my nx; iframe ++) {
Pitch_Frame frame = & my frame [iframe];
totalNumberOfCandidates += frame -> nCandidates;
}
autoTable result = Table_createWithColumnNames(totalNumberOfCandidates, U"frame frequency strength");
integer rowNumber = 0;
for (integer iframe = 1; iframe <= my nx; iframe ++) {
Pitch_Frame frame = & my frame [iframe];
for (integer icand = 1; icand <= frame -> nCandidates; icand ++) {
Pitch_Candidate candidate = & frame -> candidate [icand];
Table_setNumericValue (result.get(), ++ rowNumber, 1, double (iframe));
Table_setNumericValue (result.get(), rowNumber, 2, candidate -> frequency);
Table_setNumericValue (result.get(), rowNumber, 3, candidate -> strength);
}
}
return result;
}
/* End of file Pitch.cpp */
......@@ -2,7 +2,7 @@
#define _Pitch_h_
/* Pitch.h
*
* Copyright (C) 1992-2007,2009,2011,2012,2014-2018 Paul Boersma
* Copyright (C) 1992-2007,2009,2011,2012,2014-2019 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
......@@ -20,6 +20,7 @@
#include "Sampled.h"
#include "Graphics.h"
#include "Table.h"
Thing_declare (Interpreter);
#include "Pitch_enums.h"
......@@ -203,5 +204,8 @@ void Pitch_step (Pitch me, double step, double precision, double tmin, double tm
void Pitch_formula (Pitch me, conststring32 formula, Interpreter interpreter);
autoTable Pitch_tabulateCandidatesInFrame (Pitch me, integer frameNumber);
autoTable Pitch_tabulateCandidates (Pitch me);
/* End of file Pitch.h */
#endif
......@@ -1273,34 +1273,4 @@ autoSound Sounds_crossCorrelate_short (Sound me, Sound thee, double tmin, double
Thing_implement (SoundList, Ordered, 0);
integer SoundList_getMinimumNumberOfSamples (SoundList me) {
integer result = INTEGER_MAX;
for (integer isound = 1; isound <= my size; isound ++)
if (my at [isound] -> nx < result)
result = my at [isound] -> nx;
return result;
}
autoMAT SoundList_getRandomizedPatterns (SoundList me, integer numberOfPatterns, integer patternSize) {
try {
integer minimumNumberOfSamples = SoundList_getMinimumNumberOfSamples (me);
Melder_require (patternSize <= minimumNumberOfSamples,
U"The pattern size cannot be ", patternSize, U", because there is a Sound that is only ", minimumNumberOfSamples, U" samples long.");
autoMAT result = newMATzero (numberOfPatterns, patternSize);
for (integer ipattern = 1; ipattern <= numberOfPatterns; ipattern ++) {
integer soundNumber = NUMrandomInteger (1, my size);
Sound sound = my at [soundNumber];
integer numberOfSamples = sound -> nx;
integer endSample = NUMrandomInteger (patternSize, numberOfSamples);
integer startSample = endSample - (patternSize - 1);
Melder_assert (startSample >= 1);
constVEC const samples = sound -> z.row (1);
result.row (ipattern) <<= samples. part (startSample, endSample);
}
return result;
} catch (MelderError) {
Melder_throw (me, U": no randomize patterns gotten.");
}
}
/* End of file Sound.cpp */
......@@ -346,8 +346,5 @@ autoSound Sound_deepenBandModulation (Sound me, double enhancement_dB,
Collection_define (SoundList, OrderedOf, Sound) {
};
integer SoundList_getMinimumNumberOfSamples (SoundList me);
autoMAT SoundList_getRandomizedPatterns (SoundList me, integer numberOfPatterns, integer patternSize);
/* End of file Sound.h */
#endif
/* SoundSet.cpp
*
* Copyright (C) 2019 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
* 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 "SoundSet.h"
Thing_implement (SoundSet, Ordered, 0);
integer SoundSet_getMinimumNumberOfSamples (SoundSet me) {
integer result = INTEGER_MAX;
for (integer isound = 1; isound <= my size; isound ++)
if (my at [isound] -> nx < result)
result = my at [isound] -> nx;
return result;
}
autoMAT SoundSet_getRandomizedPatterns (SoundSet me, integer numberOfPatterns, integer patternSize) {
try {
integer minimumNumberOfSamples = SoundSet_getMinimumNumberOfSamples (me);
Melder_require (patternSize <= minimumNumberOfSamples,
U"The pattern size cannot be ", patternSize, U", because there is a Sound that is only ", minimumNumberOfSamples, U" samples long.");
autoMAT result = newMATzero (numberOfPatterns, patternSize);
for (integer ipattern = 1; ipattern <= numberOfPatterns; ipattern ++) {
integer soundNumber = NUMrandomInteger (1, my size);
Sound sound = my at [soundNumber];
integer numberOfSamples = sound -> nx;
integer endSample = NUMrandomInteger (patternSize, numberOfSamples);
integer startSample = endSample - (patternSize - 1);
Melder_assert (startSample >= 1);
constVEC const samples = sound -> z.row (1);
result.row (ipattern) <<= samples. part (startSample, endSample);
}
return result;
} catch (MelderError) {
Melder_throw (me, U": no randomize patterns gotten.");
}
}
void SoundSet_Table_getRandomizedPatterns (SoundSet me, Table thee, conststring32 columnName, integer numberOfPatterns, integer inputSize, integer outputSize,
autoPatternList *out_inputs, autoPatternList *out_outputs)
{
try {
Melder_require (thy rows.size == my size,
U"The number of rows of ", thee, U" should be equal to the number of elements of ", me);
integer columnNumber = Table_getColumnIndexFromColumnLabel (thee, columnName);
integer minimumNumberOfSamples = SoundSet_getMinimumNumberOfSamples (me);
Melder_require (inputSize <= minimumNumberOfSamples,
U"The input size cannot be ", inputSize, U", because there is a Sound that is only ", minimumNumberOfSamples, U" samples long.");
Table_numericize_Assert (thee, columnNumber);
autoPatternList inputs = PatternList_create (numberOfPatterns, inputSize);
autoPatternList outputs = PatternList_create (numberOfPatterns, outputSize);
for (integer ipattern = 1; ipattern <= numberOfPatterns; ipattern ++) {
integer soundNumber = NUMrandomInteger (1, my size);
Sound sound = my at [soundNumber];
integer numberOfSamples = sound -> nx;
integer endSample = NUMrandomInteger (inputSize, numberOfSamples);
integer startSample = endSample - (inputSize - 1);
Melder_assert (startSample >= 1);
constVEC const samples = sound -> z.row (1);
inputs -> z.row (ipattern) <<= samples. part (startSample, endSample);
integer classNumber = Melder_iround (thy rows.at [soundNumber] -> cells [columnNumber]. number);
Melder_require (classNumber >= 1 && classNumber <= outputSize,
U"The class number has to be betwene 1 and ", outputSize, U", not ", classNumber, U".");
outputs -> z [ipattern] [classNumber] = 1.0;
}
if (out_inputs) *out_inputs = inputs.move();
if (out_outputs) *out_outputs = outputs.move();
} catch (MelderError) {
Melder_throw (me, U" and ", thee, U": no randomized patterns gotten.");
}
}
/* End of file SoundSet.cpp */
#ifndef _SoundSet_h_
#define _SoundSet_h_
/* SoundSet.h
*
* Copyright (C) 2019 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
* 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 "Table.h"
#include "PatternList.h"
/*
Abstract.
*/
Collection_define (SoundSet, OrderedOf, Sound) {
};
integer SoundSet_getMinimumNumberOfSamples (SoundSet me);
autoMAT SoundSet_getRandomizedPatterns (SoundSet me, integer numberOfPatterns, integer patternSize);
void SoundSet_Table_getRandomizedPatterns (SoundSet me, Table thee, conststring32 columnName, integer numberOfPatterns, integer inputSize, integer outputSize,
autoPatternList *out_inputs, autoPatternList *out_outputs);
/* End of file Sound.h */
#endif
......@@ -22,9 +22,14 @@
void manual_tutorials_init (ManPages me);
void manual_tutorials_init (ManPages me) {
MAN_BEGIN (U"What's new?", U"ppgb", 20190217)
MAN_BEGIN (U"What's new?", U"ppgb", 20190302)
INTRO (U"Latest changes in Praat.")
//LIST_ITEM (U"• Manual page about @@drawing a vowel triangle@.")
NORMAL (U"##6.0.49# (2 March 2019)")
LIST_ITEM (U"• Removed a bug introduced in 6.0.41 whereby a script could misreport an undefined table value.")
LIST_ITEM (U"• Removed a bug introduced in 6.0.44 whereby an MFCC's maximum frequency could be ignored.")
LIST_ITEM (U"• Pitch: Tabulate candidates.")
LIST_ITEM (U"• SoundSet.")
NORMAL (U"##6.0.48# (17 February 2019)")
LIST_ITEM (U"• Removed a bug introduced in 6.0.44 whereby Praat could crash when drawing a function without any points.")
LIST_ITEM (U"• Removed a bug whereby Praat would not start up on macOS 10.10 (because of required GPU libraries).")
......
......@@ -1559,6 +1559,21 @@ DO
NUMMAT_ONE_END
}
FORM (NEW_Pitch_tabulateCandidatesInFrame, U"Pitch: Tabulate candidates in frame", nullptr) {
NATURAL (frameNumber, U"Frame number", U"1")
OK
DO
CONVERT_EACH (Pitch)
autoTable result = Pitch_tabulateCandidatesInFrame (me, frameNumber);
CONVERT_EACH_END (my name.get(), U"_", frameNumber)
}
DIRECT (NEW_Pitch_tabulateCandidates) {
CONVERT_EACH (Pitch)
autoTable result = Pitch_tabulateCandidates (me);
CONVERT_EACH_END (my name.get())
}
FORM (REAL_Pitch_getMinimum, U"Pitch: Get minimum", nullptr) {
praat_TimeFunction_RANGE (fromTime, toTime)
OPTIONMENU_ENUM (kPitch_unit, unit, U"Unit", kPitch_unit::DEFAULT)
......@@ -3211,6 +3226,8 @@ praat_addAction1 (classFormant, 0, U"Hack", nullptr, 0, nullptr);
praat_addAction1 (classPitch, 2, U"Count differences", nullptr, 1, INFO_Pitch_difference);
praat_addAction1 (classPitch, 2, U"-- hack --", nullptr, 1, nullptr);
praat_addAction1 (classPitch, 1, U"Internal", nullptr, 1, nullptr);
praat_addAction1 (classPitch, 0, U"Tabulate candidates", nullptr, 2, NEW_Pitch_tabulateCandidates);
praat_addAction1 (classPitch, 0, U"Tabulate candidates in frame...", nullptr, 2, NEW_Pitch_tabulateCandidatesInFrame);
praat_addAction1 (classPitch, 1, U"Get all candidates in frame...", nullptr, 2, NUMMAT_Pitch_getAllCandidatesInFrame);
praat_addAction1 (classPitch, 0, U"Modify -", nullptr, 0, nullptr);
praat_TimeFunction_modify_init (classPitch);
......
......@@ -355,6 +355,23 @@ DIRECT (REAL_Matrix_getSum) {
NUMBER_ONE_END (U" (sum)");
}
DIRECT (NUMMAT_Matrix_getAllValues) {
NUMMAT_ONE (Matrix)
autoMAT result = newMATcopy (my z.all());
NUMMAT_ONE_END
}
FORM (NUMVEC_Matrix_getAllValuesInRow, U"Get all values in row", nullptr) {
NATURAL (rowNumber, U"Row number", U"1")
OK
DO
NUMVEC_ONE (Matrix)
Melder_require (rowNumber <= my ny,
U"The row number (", rowNumber, U") should not be greater than the number of rows (", my ny, U").");
autoVEC result = newVECcopy (my z.row (rowNumber));
NUMVEC_ONE_END
}
// MARK: Modify
FORM (MODIFY_Matrix_formula, U"Matrix Formula", U"Formula...") {
......@@ -829,6 +846,8 @@ void praat_Matrix_init () {
praat_addAction1 (classMatrix, 1, U"-- get value --", nullptr, 1, nullptr);
praat_addAction1 (classMatrix, 1, U"Get value in cell...", nullptr, 1, REAL_Matrix_getValueInCell);
praat_addAction1 (classMatrix, 1, U"Get value at xy...", nullptr, 1, REAL_Matrix_getValueAtXY);
praat_addAction1 (classMatrix, 1, U"Get all values", nullptr, 1, NUMMAT_Matrix_getAllValues);
praat_addAction1 (classMatrix, 1, U"Get all values in row...", nullptr, 1, NUMVEC_Matrix_getAllValuesInRow);
praat_addAction1 (classMatrix, 1, U"Get minimum", nullptr, 1, REAL_Matrix_getMinimum);
praat_addAction1 (classMatrix, 1, U"Get maximum", nullptr, 1, REAL_Matrix_getMaximum);
praat_addAction1 (classMatrix, 1, U"Get sum", nullptr, 1, REAL_Matrix_getSum);
......
/* praat_Sound_init.cpp
*
* Copyright (C) 1992-2018 Paul Boersma
* Copyright (C) 1992-2019 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
......@@ -31,6 +31,7 @@
#include "Sound_to_PointProcess.h"
#include "SoundEditor.h"
#include "SoundRecorder.h"
#include "SoundSet.h"
#include "SpectrumEditor.h"
#include "TextGrid_Sound.h"
#include "mp3.h"
......@@ -360,6 +361,14 @@ DIRECT (NEW1_Sounds_combineIntoSoundList) {
autoSoundList result = SoundList_create ();
for (integer iobject = 1; iobject <= list.size; iobject ++)
result -> addItem_move (Data_copy (list.at [iobject]));
CONVERT_LIST_END (U"list")
}
DIRECT (NEW1_Sounds_combineIntoSoundSet) {
CONVERT_LIST (Sound)
autoSoundSet result = SoundSet_create ();
for (integer iobject = 1; iobject <= list.size; iobject ++)
result -> addItem_move (Data_copy (list.at [iobject]));
CONVERT_LIST_END (U"ensemble")
}
......@@ -2000,13 +2009,38 @@ FORM_SAVE (SAVE_Sound_saveAsWavFile, U"Save as WAV file", nullptr, U"wav") {
/***** SOUNDLIST *****/
DIRECT (NEWMANY_Extract_all_Sounds) {
DIRECT (NEWMANY_SoundList_extractAllSounds) {
CONVERT_EACH (SoundList)
autoSoundList result = Data_copy (me);
result -> classInfo = classCollection; // YUCK, in order to force automatic unpacking
CONVERT_EACH_END (U"dummy")
}
/***** SOUNDSET *****/
DIRECT (NEWMANY_SoundSet_extractAllSounds) {
CONVERT_EACH (SoundSet)
autoSoundSet result = Data_copy (me);
result -> classInfo = classCollection; // YUCK, in order to force automatic unpacking
CONVERT_EACH_END (U"dummy")
}
FORM (NEW2_SoundSet_Table_getRandomizedPatterns, U"SoundSet & Table: Get randomized patterns", nullptr) {
SENTENCE (columnName, U"Column name", U"")
NATURAL (numberOfPatterns, U"Number of patterns", U"1000")
NATURAL (inputSize, U"Input size (number of samples)", U"8000")
NATURAL (outputSize, U"Output size (number of classes)", U"5")
OK
DO
FIND_TWO (SoundSet, Table)
autoPatternList inputs, outputs;
SoundSet_Table_getRandomizedPatterns (me, you, columnName, numberOfPatterns, inputSize, outputSize,
& inputs, & outputs);
praat_new (inputs.move(), U"inputs");
praat_new (outputs.move(), U"outputs");
END
}
/***** STOP *****/
DIRECT (PLAY_stopPlayingSound) {
......@@ -2112,7 +2146,7 @@ static int publishPlayedProc () {
/***** buttons *****/
void praat_Sound_init () {
Thing_recognizeClassesByName (classSound, classLongSound, classSoundList, nullptr);
Thing_recognizeClassesByName (classSound, classLongSound, classSoundList, classSoundSet, nullptr);
Data_recognizeFileType (macSoundOrEmptyFileRecognizer);
Data_recognizeFileType (soundFileRecognizer);
......@@ -2407,6 +2441,7 @@ void praat_Sound_init () {
praat_addAction1 (classSound, 0, U"Combine -", nullptr, 0, nullptr);
praat_addAction1 (classSound, 0, U"Combine to stereo", nullptr, 1, NEW1_Sounds_combineToStereo);
praat_addAction1 (classSound, 0, U"Combine into SoundList", nullptr, 1, NEW1_Sounds_combineIntoSoundList);
praat_addAction1 (classSound, 0, U"Combine into SoundSet", nullptr, 1, NEW1_Sounds_combineIntoSoundSet);
praat_addAction1 (classSound, 0, U"Concatenate", nullptr, 1, NEW1_Sounds_concatenate);
praat_addAction1 (classSound, 0, U"Concatenate recoverably", nullptr, 1, NEW2_Sounds_concatenateRecoverably);
praat_addAction1 (classSound, 0, U"Concatenate with overlap...", nullptr, 1, NEW1_Sounds_concatenateWithOverlap);
......@@ -2428,7 +2463,10 @@ void praat_Sound_init () {
praat_addAction2 (classLongSound, 0, classSound, 0, U"Save as FLAC file...", nullptr, 0, SAVE_LongSound_Sound_saveAsFlacFile);
praat_addAction2 (classLongSound, 0, classSound, 0, U"Write to FLAC file...", U"*Save as FLAC file...", praat_DEPRECATED_2011, SAVE_LongSound_Sound_saveAsFlacFile);
praat_addAction1 (classSoundList, 1, U"Extract all Sounds", nullptr, 0, NEWMANY_Extract_all_Sounds);
praat_addAction1 (classSoundList, 1, U"Extract all Sounds", nullptr, 0, NEWMANY_SoundList_extractAllSounds);
praat_addAction1 (classSoundSet, 1, U"Extract all Sounds", nullptr, 0, NEWMANY_SoundSet_extractAllSounds);
praat_addAction2 (classSoundSet, 1, classTable, 1, U"Get randomized patterns...", nullptr, 0, NEW2_SoundSet_Table_getRandomizedPatterns);
}
/* End of file praat_Sound.cpp */
......@@ -492,6 +492,18 @@
<key>LSTypeIsPackage</key>
<integer>0</integer>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>SoundSet</string>
</array>
<key>CFBundleTypeName</key>
<string>Praat Sound set</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSTypeIsPackage</key>
<integer>0</integer>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>Praat</string>
......