Rocaloid / RUCE

Rocaloid UTAU Compatible Engine
GNU General Public License v3.0
131 stars 25 forks source link

Spectrum discontinuties on a particular harmonic of a particular vocal unit with particular parameters #4

Closed Sleepwalking closed 10 years ago

Sleepwalking commented 10 years ago

I assign this bug to myself just for tracking down this bug and see if this would help me to fix it.

It is observed that when unit jiu in Rocaloid_Cyan_RUCE is elevated to F4, spectral discontinuity will appear at the third harmonic(around 1500Hz). Valgrind tells no error or memory leak. The problem is not likely to be caused by RUCE. Then there must be something wrong in CVESVP. I'll keep logging here.

sleepwalking@e6230:~/Data/RocaloidDB/Cyan_RUCE$ valgrind ./RUCE build/jiu.wav out.wav F4 100 V 0.0 2000 216.0 0.0 98 0 '!11' 'AA#48#Ai'
==19566== Memcheck, a memory error detector
==19566== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==19566== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==19566== Command: ./RUCE build/jiu.wav out.wav F4 100 V 0.0 2000 216.0 0.0 98 0 !11 AA#48#Ai
==19566== 
RUCE - Rocaloid UTAU Compatible Engine (1.0.0-alpha1)
  License: GNU GPL v3 (http://www.gnu.org/licenses/gpl-3.0.txt)
  www.rocaloid.org
Argument parsing done.
Arguments:
  #0: ./RUCE
  #1: build/jiu.wav
  #2: out.wav
  #3: F4
  #4: 100
  #5: V
  #6: 0.0
  #7: 2000
  #8: 216.0
  #9: 0.0
  #10: 98
  #11: 0
  #12: !11
  #13: AA#48#Ai
Input: build/jiu.wav, Output: out.wav
InvarLeft: 0.000000, InvarRight: 0.000000
LenRequire: 2.000000, FixedLength: 0.216000
Velocity: 100.000000, Modulation: 0.000000
Volume: 98.000000
DirName: build
UnitName: jiu
Initializing windows...
Initializing waves...
Initializing PSOLA-based consonant synthesis...
Initializing source PSOLA frames...
Frequency remapping...
Pulse accumulative reconstruction...
PSOLA-based consonant synthesis...
Initializing HNM frames...
Time mapping for HNM composition...
Interpolating & pitch-scaling target HNM frames...
Concatenative PSOLA-HNM & initial phase analysis...
HNM synthesis...
Concatenating...
Freeing memory...
Synthesis successfully finished.
==19566== 
==19566== HEAP SUMMARY:
==19566==     in use at exit: 0 bytes in 0 blocks
==19566==   total heap usage: 20,124 allocs, 20,124 frees, 39,815,803 bytes allocated
==19566== 
==19566== All heap blocks were freed -- no leaks are possible
==19566== 
==19566== For counts of detected and suppressed errors, rerun with: -v
==19566== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

screenshot from 2014-08-03 20 33 55

p.s. I'd be happy if anyone could join this discussion :)

Sleepwalking commented 10 years ago

The first cavity ranges from approx. 15100 to 18800 samples. Corresponding to no. 26, 27, 28, 29, 30 HNM frame in rudb.

I'm trying to find out the difference between the 30th and 31th HNM frames' harmonic components.

Frame 30:
  0: 266.011902Hz,   -1.637146log ampl
  1: 531.150085Hz,   -2.300606log ampl
  2: 796.788330Hz,   -2.257051log ampl
  3: 1061.347412Hz,  -4.097857log ampl
  4: 1325.452026Hz,  -2.547970log ampl
  5: 1436.407471Hz,  -5.542517log ampl
  6: 1862.239746Hz,  -5.546577log ampl
  7: 2125.274414Hz,  -5.858515log ampl
  8: 2386.110840Hz,  -5.824959log ampl
  9: 2657.126221Hz,  -5.364878log ampl
  10: 2921.813477Hz, -4.406525log ampl
Frame 31:
  0: 265.841064Hz,   -1.647950log ampl
  1: 530.838379Hz,   -2.303148log ampl
  2: 797.154846Hz,   -2.245424log ampl
  3: 1061.838013Hz,  -3.986563log ampl
  4: 1324.772949Hz,  -2.516903log ampl
  5: 1592.924194Hz,  -5.968227log ampl
  6: 1860.327148Hz,  -5.536384log ampl
  7: 2124.559326Hz,  -5.818486log ampl
  8: 2386.590332Hz,  -5.831464log ampl
  9: 2655.401855Hz,  -5.367336log ampl
  10: 2919.344238Hz, -4.508668log ampl

  0: 0.010804delta log ampl
  1: 0.002542delta log ampl
  2: -0.011627delta log ampl
  3: -0.111294delta log ampl
  4: -0.031067delta log ampl
  5: 0.425710delta log ampl
  6: -0.010193delta log ampl
  7: -0.040029delta log ampl
  8: 0.006506delta log ampl
  9: 0.002459delta log ampl
  10: 0.102143delta log ampl

Seems we have a problem with the fifth harmonic in the source HNM frames.

Sleepwalking commented 10 years ago

The following codes were added at line 173 in RUCE/src/Synth.c and the discontinuity is fixed:


            if(i > 0 && j > 1 && j < 10)
            {
                if(fabs(SorcFrame -> Freq[j] - (SorcFrame -> Freq[j - 1] +
                    SorcFrame -> Freq[0])) > 30.0)
                {
                    SorcFrame -> Freq[j] = SorcFrame -> Freq[j - 1] +
                                           SorcFrame -> Freq[0];
                    SorcFrame -> Ampl[j] = (SorcFrame - 1) -> Ampl[j];
                    printf("%d, %d: %f %f\n",i, j, SorcFrame -> Freq[j],
                        log(SorcFrame -> Ampl[j]));
                }
            }

Going to add this correction method to genrudb.

Sleepwalking commented 10 years ago

This feature has been added to genrudb of Rocaloid Toolchain. Issue closed.