ECMC PVC example file pitchtracker1
# ECMC PVC example >> pitchtracker1 <<
# This files creates a pitch analsyis file of /sflib/voice/sop1.b3
# Defaults are used for all parameters except the following:
# (1) The "reference pitch" for the analysis is set to 245 herz (the precise
# equal tempered pitch for b3 is 246.9421
# reference_frequency=245 # changed from the default 440
# (2) The "lowest possible" and "highest possible" fundamentals are set to
# fs3 (7.06 in octave pitch class) and cs4 (8.01 in oct. pitch class), allowing
# a wide range for the note attack
# boundary_data_type__freq_0__octavepitchclass_1=1
# low_freq_or_pitch_boundary=7.06 # Lowest possible pitch
# high_freq_or_pitch_boundary=8.01 # Highest possible pitch
# The output pitch track analysis created here is used in ECMC PVC example plainpv8
#******************************************************
#*********** PITCHTRACKER *****************************
#******************************************************
# ( THIS IS A WORK-IN-PROGRESS. IT WORKS RATHER WELL,  
#   BUT LIKE ALL PITCH TRACKING,  HAS ITS INEXPLICABLE MOMENTS

     # ******ECMC CHANGES & ADDITIONS: ***************
#******** INPUT SOUNDFILE & OUTPUT ENVELOPE ANALYSIS FILE  ************* # input soundfile, can be aiff or wave format on Linux, aiff only on SGI
inputsf=/sflib/voice/sop1.b3  
envelope_file=pvc.sop1.b3.ptrack # output pitch track analysis file

#******************************************************
#************ OUTPUT SETTINGS ************************

#......... OUTPUT FORMAT ............................ 

output_format=2 # # default 2 usually recommended
# 0: freq # 1: octdec # 2: semitones # 3: invertsemitones

#.........REFERENCE FREQUENCY ............................ 

reference_frequency=245 # changed from the default 440 to 245 (b3  246.942 hz)
#( for use with output format 3: inverted semitones)

#........OUTPUT SAMPLE RATE ............................ 
ouput_sample_rate=1000
#( for non soundfile data types)

#........OUTPUT DATA TYPE ............................ 

output_data_type=1  # default 1 usually recommended
# 0: ascii   # 1: 32-bit floats )
# 2: integer soundfile with:
#     freq track in left, and
#     freq/amp modulated sine in right. 

#........ BEGIN/END TIMES .............................

begintime=0
endtime=0

analysis_frames_per_second=200

#======================================================
#*** ANALYSIS PARAMETERS ******************************
FFT_length=1024
windowsize=0

#*************** CHANNELS ****************************
analysis_channel_1_to_max=1

method_on_multiple_channels__average_0__peak_1=0
#******************************************************

#======================================================
#*********** DETECTION PARAMETERS *********************
#======================================================

#......... DETECTION METHOD ........................... 

detection_method_0_or_1=0

# 0 = the strongest harmonic collection
#	formants (optimal comb)
#	(This method finds up to 12 of the strongest formants
#	 and determines which is the logical fundamental
#	 based on the reinforcement of its harmonic spectrum
#	 by the other formants.)
# 1 = the strongest formant
#	( This method selects the strongest formant between
#	  the low-high boundaries.)
# 2 = band-limited centroid
#	(This method takes the amplitude (squared) weighted
#	 average of the spectrum between the low-high boundaries.)

#******************************************************

#......... DETECTION BOUNDARIES ....................... 
# if 0, XXX & YYY below are frequencies; if 1, XXX & YYY are in oct. pch class
boundary_data_type__freq_0__octavepitchclass_1=1

# VERY IMPORTANT : YOU ***MUST*** EDIT THE 2 LINES BELOW and
# SUPPLY LOWEST AND HIGHEST POSSIBLE INPUT PITCH, either
# in frequency or octave pitch class as determined by
# the boundary_data_typ argument (0 or 1) above
low_freq_or_pitch_boundary=7.06 # Lowest possible pitch
high_freq_or_pitch_boundary=8.01 # Highest possible pitch


#......... DETECTION TIME WINDOW ....................... 

detection_window_size_minimum=.05
detection_window_size_maximum=.2
# (Keep range between .05 and .2, "I guess".....)

#......... DETECTION THRESHOLD ....................... 

detection_threshold_in_decibels=-20
#( -10 to -20, perhaps? ) ; 

#******************************************************

#......... DETECTED ENVELOPE SMOOTHING ................. 

frequency_response_time=0
# (This is a lowpass filter which smooths the changes to the
#  tracked pitch trajectory. 0 = off, larger values smooth. )

#***** AMPLITUDE ENVELOPE *******************
#  RESPONSE TIME ###
release_time_in_seconds=0
attack_time_in_seconds=0

#........ COMPRESSOR ............................... 
compression_threshold_in_decibels=-0
decibels_of_compression=-0

#........GATE ..................................... 
gate_threshold_in_decibels=-80

#........WARP ....................................... 
amplitude_envelope_warp=0


#====================================================
# COMMAND LINE SETUP -- OFFICE USE ONLY
#      (DO NOT WRITE BELOW THIS LINE)
#====================================================
#PVCDIR=/usr/local/soundapps/PVC
#PVCBIN=$PVCDIR/bin
cd $SFDIR  # ECMC

if  [ "$OSTYPE" = "irix" ]
then
   analysis_sndfile=pvcin
   input_file=pvcin  # ECMC temporary NeXT format input soundfile
   #  Create temporary NeXT format input soundfile "pvcin:" ECMC
   /sbin/rm -f pvcin 
   /usr/local/bin/sox -t aiff $inputsf -t au pvcin # ECMC
elif [ `echo "$OSTYPE" | grep linux`  ]
 then
  analysis_sndfile=$inputsf
fi
#  ****** end of ECMC changes & additions ****** #

# ANALYSIS

#
analysisroutine=pitchtracker

PVFLAGS="\
\
-N$FFT_length \
-M$windowsize \
-D$analysis_frames_per_second \
\
-b$begintime \
-e$endtime \
\
-C$analysis_channel_1_to_max \
\
-Q$boundary_data_type__freq_0__octavepitchclass_1 \
-f$low_freq_or_pitch_boundary \
-F$high_freq_or_pitch_boundary \
-L$release_time_in_seconds \
-l$attack_time_in_seconds \
-W$amplitude_envelope_warp \
-G$decibels_of_compression \
-T$compression_threshold_in_decibels \
-S$gate_threshold_in_decibels \
-r$ouput_sample_rate \
-g$output_data_type \
\
-m$detection_method_0_or_1 \
\
-j$detection_window_size_minimum \
-J$detection_window_size_maximum \
-d$detection_threshold_in_decibels \
\
-O$output_format \
-o$reference_frequency \
\
\
-a$frequency_response_time \
\
-X$method_on_multiple_channels__average_0__peak_1 \
-p1 \
\
"
echo "\n\n$analysisroutine $PVFLAGS $analysis_sndfile $envelope_file  "
$analysisroutine $PVFLAGS $analysis_sndfile $envelope_file ;
#  ECMC CHANGES & ADDITIONS: ******* #
if  [ "$OSTYPE" = "irix" ]
then
   /sbin/rm -f pvcin 
fi
#  ****** end of ECMC changes & additions ****** #
echo "Header information for PVC pitch track analysis file $envelope_file :"
ls -l  $envelope_file

# If you have created any gen function files above delete them below: