示例#1
0
FujisakiPitch Pitch_to_FujisakiPitch (Pitch me, double gamma, double timeResolution,
                                      FujisakiPitch *intermediate1, FujisakiPitch *intermediate2, FujisakiPitch *intermediate3)
{
    (void) timeResolution;
    try {

        autoFujisakiPitch thee = FujisakiPitch_create (my xmin, my xmax, 0, 0, 0, gamma);
        /*
         * Get phrase commands.
         */
        while (/* ... */ 0) {
            double onsetTime = /* ... */ 0.0;
            double offsetTime = /* ... */ 3.0;
            double amplitude = /* ... */ 1.0;
            autoFujisakiCommand phraseCommand = FujisakiCommand_create (onsetTime, offsetTime, amplitude);
            Collection_addItem (thy phraseCommands, phraseCommand.transfer());
        }
        if (intermediate1) *intermediate1 = Data_copy (thee.peek());
        /*
         * Get accent commands.
         */
        while (/* ... */ 0) {
            double onsetTime = /* ... */ 0.0;
            double offsetTime = /* ... */ 3.0;
            double amplitude = /* ... */ 1.0;
            autoFujisakiCommand accentCommand = FujisakiCommand_create (onsetTime, offsetTime, amplitude);
            Collection_addItem (thy accentCommands, accentCommand.transfer());
        }
        if (intermediate2) *intermediate2 = Data_copy (thee.peek());
        /*
         * Do some extra processing.
         */
        /* ... */
        if (intermediate3) *intermediate3 = Data_copy (thee.peek());
        /*
         * Tidy up.
         */
        for (long i = 1; i <= thy phraseCommands -> size; i ++) {
            FujisakiCommand phraseCommand = (FujisakiCommand) thy phraseCommands -> item [i];
            /* ... */
        }
        for (long i = 1; i <= thy accentCommands -> size; i ++) {
            FujisakiCommand accentCommand = (FujisakiCommand) thy accentCommands -> item [i];
            /* ... */
        }
        return thee.transfer();
    } catch (MelderError) {
        Melder_throw (me, ": not converted to FujisakiPitch.");
    }
}
示例#2
0
autoFujisakiPitch Pitch_to_FujisakiPitch (Pitch me, double gamma, double /* timeResolution */,
        autoFujisakiPitch *intermediate1, autoFujisakiPitch *intermediate2, autoFujisakiPitch *intermediate3)
{
    try {
        autoFujisakiPitch thee = FujisakiPitch_create (my xmin, my xmax, 0, 0, 0, gamma);
        /*
         * Get phrase commands.
         */
        while (/* ... */ 0) {
            double onsetTime = /* ... */ 0.0;
            double offsetTime = /* ... */ 3.0;
            double amplitude = /* ... */ 1.0;
            autoFujisakiCommand phraseCommand = FujisakiCommand_create (onsetTime, offsetTime, amplitude);
            thy phraseCommands. addItem_move (phraseCommand.move());
        }
        if (intermediate1) *intermediate1 = Data_copy (thee.get());
        /*
         * Get accent commands.
         */
        while (/* ... */ 0) {
            double onsetTime = /* ... */ 0.0;
            double offsetTime = /* ... */ 3.0;
            double amplitude = /* ... */ 1.0;
            autoFujisakiCommand accentCommand = FujisakiCommand_create (onsetTime, offsetTime, amplitude);
            thy accentCommands. addItem_move (accentCommand.move());
        }
        if (intermediate2) *intermediate2 = Data_copy (thee.get());
        /*
         * Do some extra processing.
         */
        /* ... */
        if (intermediate3) *intermediate3 = Data_copy (thee.get());
        /*
         * Tidy up.
         */
        for (long i = 1; i <= thy phraseCommands.size; i ++) {
            FujisakiCommand phraseCommand = thy phraseCommands.at [i];
            /* ... */
        }
        for (long i = 1; i <= thy accentCommands.size; i ++) {
            FujisakiCommand accentCommand = thy accentCommands.at [i];
            /* ... */
        }
        return thee;
    } catch (MelderError) {
        Melder_throw (me, U": not converted to FujisakiPitch.");
    }
}