Reference Manager - Replace References

The Replace References function and the accompanying dialog is for textually and programatically editing the object references in your Instrument file and optionally sample file names.

The general task is to compile a list of “find this, replace with that” entries. Enter in a set and click the Add To List button. All entries are considered sequentially. You can remove entries or clear the list. The Import button allows syou to import a .txt file with entries, comma or tab delimited.

Find and Replace

The Opcodes popup menu puts the selected preset opcode in the “Upon finding...” box. They are defined below.

<rootkey> Adds the rootkey name (i.e. " C4") to the end of the existing object name (before the extension)
<replace> Replaces the entire object name with the new one
<instname>  
<groupname>  
<add> Adds the Replace With text to the begining of the existing object name
<delete> Deletes the Replace With text from the existing object name, if the text exists
<delete0:0> Deletes text at the position after 'insert" ("0" means the first character), and for the amt of chars after the colon
<deletebeforeext0> Deletes "x" amount of characters before the "dot" before the file extension.
<insert0> Inserts the Replace With text at the position stipulated after the 'insert". "0" means the first character.
<mapformat>

This parses the control file and rename all samples with the syntax below and updates the control file. If you leave the REPLACE WITH field blank, this is the syntax:

[Control File name without the nki extension]_[group name]_[rootkey]_[hivel].[fileext]

Once you are satisfied with that, you can do it with a folder of control files.

IMPORTANT NOTE: There may be issues if you have control files that share samples, because once a control file is modified, the sample name has changed, and then doesn't exist, then the new name is separated and the reference in that control file is not updated and the link is lost.

You can customize the function with your own syntax. In Replace With, enter the syntax codes. It creates the new custom name in the order you put the indicators. You must surround each with "tags" <>

Example: <instname><groupname><rootkey><hivel>

<instname> The name of the control file without the extension
<groupname> The name of the group the sample is attached to
<keyrange> e.g. C3-C4
<keyrangechar> same as <keyrange>
<keyrangenum> e.g. 60-72
<hivel> numerical string of the High Velocity
<lovel> numerical string of the Low Velocity
<velrange> e.g. 1-127
<rootkey> e.g. C3
<rootkeychar> same as <rootkey>
<rootkeynum> e.g. 60
<midc:[x]> VERY IMPORTANT for char-type indicators. The default is 60 as middle C (C4), but Kontakt and many others refer to middle C3 as 48. So you need to put this as '<midc:48>' to do the Konntakt-other types of
char-indicators.
<text:[x]> Any text you want to put
<sep:[x]> The default separator is the underscore (_). If you want something else, put it here. E.g. as a dash: <sep:-> or as a space <sep: >

When you are ready, click Rename. To cancel, click Cancel. If you don’t want to Rename, but want to go on anyway, click Don’t Rename.


Advanced

Clicking the Advanced>> button reveals more paramters to tweak exactly how you want Replace References to work.

Renaming
You can choose which part of the path you want to take under consideration. Options are:

File Name Only Entire Path + File Name Path Only
Parent Folder Only Parent Folder + File Name  

You can also choose whether the search will be case sensitive or not.


Update References


Method
Sometimes you want to affect the external sample file names, sometimes you don’t. Method allows different ways of dealing with the external file themselves.

Find Sample, then rename it Renames the originally referenced sample
Find already renamed sample Finds the aleady-named sample and fixes the path to point to it
Do not find sample Just textually rewrites the reference


File Operation
This is closely tied with Method. You can Rename the file, or Copy it, or Do Nothing to nullify the operation.


Example
We worked on several ProjectSAM libraries. Often they would use the same programs for different mic samples and simply change the samples. Their sample names would be the same except for the single lowercase letter before the .wav extension. We used Replace References to perform this.

We added an entry “Upon finding c.wav, replace with f.wav”, and under method we would choose Do Not Find Sample. That would rename the references. Then we would do a Fix References to point them to the different location. Very handy!