ECMC PVC example file inharm2-4
# ECMC example "inharm2-4" is similar to example "inharm2-1," but
# in "inharm2-4" no pitch shift is applied to either the target or
# non-target partials.
# NON_TARGETS_frequency_shift=-0
# TARGETS_frequency_shift=0
# Instead, a function table is created with values that move linearly
# from 0 to 1 over the course of the resynthesized note:
# gen1 -L1000 0 0 .1 0 .9 1. 1. 1 > $SFDIR/rampup
# This function then is applied to the pitch TRANSPOSITION of the target
# partials, which begin at the original pitch level and glissando up
# a half step
# TARGETS_pitch_transposition_in_semitones=$SFDIR/rampup # int, float or FUNC
#******************************************************
#................. INHARMONATOR .......................
#******************************************************
     # ******ECMC CHANGES & ADDITIONS: ***************
#******** INPUT & OUTPUT SOUNDFILES *************
  # input soundfile, can be aiff or wave format on Linux, aiff only on SGI
inputsf=/sflib/wind/bssn.a2 
outputsf=inharm2-1  # output soundfile
outputformat=AIFF  # for Linux only : specify AIFF or WAVE output format
# ********************* #

   ##### Cmusic function file generator tempates #####
#   gen1 creates linear {straight line} segments, like Csound gen 7
 gen1 -L1000 0 0 .1 0 .9 1. 1. 1 > $SFDIR/rampup

#******************** OUTPUT **************************
output_data_format=0
   #  0=  Same as input file, 1 = integers 2 = rescaled floats 
#******************** INPUT ***************************
#........ BEGIN/END TIMES .............................
begintime=0
endtime=0
# (0 or less end time defaults to end of file)

#======================================================
#*** ANALYSIS PARAMETERS ******************************

FFT_length=1024  # must be power-of-2, usually 1024, 512 or 2048
window_type=2
    # window type: 0 = Hamming,1 = rectangular, 2 = Blackman (DEFAULT),
    #  3 = Bartlett triangular, 4-12 = Kaiser windows for alpha = 4-12
    # generally recommended: 2 or 8
windowsize=0
        # 0 sets windowsize to 2 * FFT (or larger)
frames_per_second=200   # generally 200, occasionally 400 or 600 when time stretching

#======================================================
#*** RESYNTHESIS PARAMETERS ***************************

#.................. TIME ..............................
time_expansion_contraction_factor=.75 # 

#........... OUTPUT CHANNEL(S) .......................
output_channel=0

# (channels are numbered from 1-maximum)
  # channels are numbered from 1 to the maximum; 0 = all channels

#.............OSCIL THRESHOLD ........................
oscillator_resynthesis_threshold_in_dB=-80

#****************** MODIFICATIONS *********************

#.................. DECIBELS ..........................

MASTER_gain_in_decibels=-7  # int, float or FUNC

#======================================================
#********** SOURCE ************************************

SOURCE_frequency_shift=0  # int, float or FUNC
SOURCE_pitch_transposition_in_semitones=-0  # int, float or FUNC
SOURCE_gain_in_dB=-20  # int, float or FUNC

#............ AMPLITUDE RESPONSE ......................
SOURCE_attack_time_in_seconds=0  # int, float or FUNC
SOURCE_release_time_in_seconds=0  # int, float or FUNC

#********** NON TARGETS ********************************
NON_TARGETS_frequency_shift=0
NON_TARGETS_pitch_transposition_in_semitones=0 # int, float or FUNC
NON_TARGETS_gain_in_dB=0  # int, float or FUNC
   # Range 0 to -96 (the default)
   # -96 provides the maximum possible suppression of non-target partials
   # but does not provide complete suppression
   # 0 causes no attenuation in the amplitude of the non-target partials
#======================================================
#********** TARGETS ********************************

#............ FUNDAMENTAL FREQUENCY .....................
INHARMONATOR_fundamental_frequency=110  # int, float or FUNC
#  IMPORTANT: If possible change the default value of 500 above
  #  to the fundamental frequency, in herz, of the input soundfile
  #  Use the "midinote" command, or else consult the help file "herz"  #  to determine this frequuency
  #  For inharmonic sounds, try changing the 500 default to various other
  #  values, and choose the value that provides the best result

#*****TARGETS SHIFT FILE: DATA FORMAT
# Edit the template table below, changing the 3 values for each partial
# and adding or deleting lines to specify more or less than 10 target
# partials. Do not include any comments or blank lines within this function
# definition and make sure that the \ at the end of each line is preceded
# by a space
# The 3 arguments on each line below specify the:
# 1) partial number
# 2) shift
# 3) change in gain in decibels

echo \
2       1           -0 \
4       1           -0 \
6       1           0 \
8       1           -0 \
10       1           -0 \
\
12       1           -0 \
14       1           -0 \
16      1           0 \
18      1           0 \
20      1           0 \
> $SFDIR/inharmonatorfile  

#*************** TARGETS ********************************
TARGETS_shift_file=$SFDIR/inharmonatorfile #Do not change this line unless
                                         # you really know what you are doing
#======================================================
SHIFT_DATA_FORMAT=0
#  0 = frequency multiplier       1 = map to frequency 
#  2 = map to octave.pitchclass   3 = map to partial number 
#======================================================

TARGETS_partial_band_edge_decibels=-0

#.................. DECIBELS ..........................
TARGETS_frequency_shift=0  # int, float or FUNC
TARGETS_pitch_transposition_in_semitones=$SFDIR/rampup # int, float or FUNC
TARGETS_gain_in_dB=-0  # int, float or FUNC

#.................CONTROL  ..........................
TARGETS_freq_shift_control_proportion=1  # int, float or FUNC
#(control proportion is 0-1, 0=no shift, 1=full shift)


#............ SPECTRUM WARPSHAPE ......................
TARGETS_spectrum_warpshape_index=0

#............ RESPONSE ...............................

INHARMONATOR_attack_time_in_seconds=0 # int,float or FUNC
INHARMONATOR_release_time_in_seconds=0 # int,float or FUNC
INHARMONATOR_frequency_response_time_in_seconds=0 # int,float or FUNC

#======================================================

#*****TARGETS SHIFT FILE: DATA FORMAT ******************
# Edit the template table below, changing the 3 values for each partial
# and adding or deleting lines to specify more or less than 10 target# partials.
# Do not include any comments or blank lines within this function definition
# and make sure the \ at the end of each line is preceded by a space
# The 3 arguments on each line below specify the:
# 1) partial number
# 2) shift
# 3) change in gain in decibels
#======================================================
#==== CREATE TARGET SHIFT FILE DATA HERE ==============

echo \
1       1        0  \
2       1        0  \
3       1        0  \
4       1        0  \
5       1        0  \
\
6       1        0  \
7       1        0  \
8       1        0  \
9       1        0  \
10      1        0  \
> inharmonatorfile

#====================================================
#........... RESCALE for floating point only ......
rescale_level_in_decibels=0
   # set to 1 to rescale to peak of input file; do not do this if input amplitude
   # is low
#********** AMPLITUDE STATISTICS *********************** 
print_amplitude_statistics_0_no__1_yes=1
amplitude_statistics_time_interval=.25

#====================================================
# 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
   input_file=pvcin  # ECMC temporary NeXT format input soundfile
   output_file=pvcout  # ECMC temporary NeXT format output soundfile
   /sbin/rm -f pvcin pvcout  
   #  Create temporary NeXT format input soundfile "pvcin:" ECMC
   /usr/local/bin/sox -t aiff $inputsf -t au pvcin # ECMC
elif [ `echo "$OSTYPE" | grep linux`  ]
 then
  input_file=$inputsf
  output_file=$outputsf
fi
#  ****** end of ECMC changes & additions ****** #

pvroutine=inharmonator

PVFLAGS="\
\
-N$FFT_length \
-M$windowsize \
-D$frames_per_second \
-I$time_expansion_contraction_factor \
\
-C$output_channel \
-t$oscillator_resynthesis_threshold_in_dB \
\
-b$begintime \
-e$endtime \
\
-A$MASTER_gain_in_decibels \
\
-Q$SOURCE_frequency_shift \
-u$SOURCE_pitch_transposition_in_semitones \
-r$SOURCE_gain_in_dB \
-l$SOURCE_attack_time_in_seconds \
-L$SOURCE_release_time_in_seconds \
\
-f$INHARMONATOR_fundamental_frequency \
-v$INHARMONATOR_attack_time_in_seconds \
-V$INHARMONATOR_release_time_in_seconds \
-Y$INHARMONATOR_frequency_response_time_in_seconds \
-Z$SHIFT_DATA_FORMAT \
\
-a$NON_TARGETS_frequency_shift \
-P$NON_TARGETS_pitch_transposition_in_semitones \
-G$NON_TARGETS_gain_in_dB \
\
-F$TARGETS_shift_file \
-B$TARGETS_partial_band_edge_decibels \
-q$TARGETS_frequency_shift \
-X$TARGETS_pitch_transposition_in_semitones \
-m$TARGETS_gain_in_dB \
-S$TARGETS_shift_control_proportion \
\
\
-W$TARGETS_spectrum_warpshape_index \
\
-p$print_amplitude_statistics_0_no__1_yes \
-i$amplitude_statistics_time_interval \
\
-_$output_data_format \
-=$rescale_level_in_decibels \
\
\
"
echo "\n\n$pvroutine $PVFLAGS $input_file $output_file "

$pvroutine  $PVFLAGS $input_file $output_file   ; 
# *****  ECMC CHANGES & ADDITIONS: ******* #
if  [ "$OSTYPE" = "irix" ]
then
   echo 'Converting temporary NeXT format output soundfile to aiff format:"'
   /usr/local/bin/sox -t au pvcout -t aiff  $outputsf # ECMC
   /sbin/rm -f pvcin pvcout   # ECMC
   echo "Header information for output soundfile >> $outputsf << :"
   /usr/sbin/sfinfo -s $outputsf # ECMC
elif [ `echo "$OSTYPE" | grep linux`  ]
then
   if  [ "$outputformat" = "AIFF" ] 
     then
            echo "   Converting output soundfile $output_file to AIFF format ..."
            /usr/local/soundapps/PVC/bin/wav2aiff $output_file
   fi
   echo "Header information for output soundfile >> $outputsf << :"
   /usr/local/bin/sfinfo -s $outputsf 
fi
#  ****** end of ECMC changes & additions ****** #


# If you have created any gen function files above delete them below:
rm  $SFDIR/inharmonatorfile $SFDIR/rampup