Tapas Das How to construct your own .INS file Sun Apr 27 19:02:17 2003 12.83.71.153 How to construct your own Cakewalk Instrument Definition File ============================================================== Have you ever wondered what is the mystery behind the .INS file inside your Cakewalk/Sonar Install directory? Would you like to know how to create one from scratch so that you can customize it for your own needs? Here is a simple explanation. The purpose of the Instrument Definition File (.INS) is simply to give you a convenient way to access all the voices in your synthesizer via software control. Taking the i30 as an example, let's say you were to write a simple .INS file for accessing the first two voices A11, A12 from Bank A. Here is what you need to do: Open up a text editor like Notepad and write an MSDOS text file ------------------------------------- .Patch Names [Bank] 0=Piano 1=BritePiano .Instrument Definitions [i30] Patch[0]=Bank -------------------------------------- Save this file as 'i30.ins' and you have just created your very first .INS File. There are two sections. The first section starts with .Patch Names Under this section we have 1 voice bank defined as [Bank] There are two entries under this bank. It begins with a number and an equal sign followed by any description you want to add. You could have also done this: [Bank] 0=A: Normal Acoustic Piano 1=A: Bright Acoustic Piano The actual description to the right of the (=) sign is up to you. Infact, you should make a habbit of entering a Category/Variation code in front of your patch name for easy alphabetical sorting of your patch list when displayed in SONAR. Each voice bank can hold up to a maximum of 128 entries numbered 0~127. You do not need to fill them up. They can be in any order. What happens is that when you click on any entry like 'A: Normal Acoustic Piano' SONAR refers to the number of this entry to the left and sends that Program Change message to your synth. It is that simple. Indeed, if every synth just carried 1 bank of 128 voices, we could have designed an even more basic .INS format like this: --------------------------- 0=Piano 1=BritePiano 2=HammerPno 3=HonkyTonk 4=New Tines 5=Digi Piano ... ... 125=Helicopter 126=Stadium!! 127=Gunshot ---------------------------- Unfortunately, synths carry more than 1 bank of sounds. So there has to be a way to differentiate between several voice banks. If you were to write a .INS file to access the first two sounds from Bank C as well, you would need to do this: ---------------------------- .Patch Names [BankA] 0=Piano 1=BritePiano [BankC] 0=90's Piano 1=Rock Piano .Instrument Definitions [i30] Patch[0]=BankA Patch[1]=BankC ------------------------------ Carrying this example to the next step, if you were to access the first 3 sounds from Bank E in addition, you would need to do this: ------------------------------ .Patch Names [BankA] 0=Piano 1=BritePiano [BankC] 0=90's Piano 1=Rock Piano [BankE] 0=Pno & Strings 1=Piano Pad 2=Midi Piano .Instrument Definitions [i30] Patch[0]=BankA Patch[1]=BankC Patch[2]=BankE ------------------------------ So you can see, the first section that defines the voice Banks and the voices they carry is very straight forward. Just add in as many banks you want and establish the mapping of the numbers (0~127) to your patch name description. The second section under the header .Instrument Definitions is the tricky part. This is where you tell SONAR how to change Banks in addition to changing voices within a Bank. It first starts with a simple [i30] entry. This is how the entry will show up in your .INS definitions list. Then comes: Patch[0]=BankA It is simply stating what Bank Message to send before sending a Program change message in order to correctly select a voice from Bank A Typically, a synth requires to receive an (MSB value + LSB value + Program Value) to select the proper voice from the proper bank. Cakewalk uses a very simple formula to calculate the bank value: [Bank Value] = (MSB x 128) + LSB MSB = Most Significant Byte = Control Change #0 = CC0 LSB = Least Significant Byte = Control Change #32 = CC32 There are a total of 128 different MIDI Control Parameters. They control various parameters like Volume, Pan, Expression, Reverb etc. Each of these Control Parameters can have a possible range of values from 0 to 127. All you need to do is find out what are the values of your Bank Select Messages (MSB, LSB) of your synth and you are in business. Here are a few examples: Korg i30 ------------ Bank A/B MSB = 0 LSB = 0 Cakewalk Bank Value = (0 x 128) + 0 = 0 Bank C/D MSB = 0 LSB = 1 Cakewalk Bank Value = (0 x 128) + 1 = 1 Bank E MSB = 0 LSB = 2 Cakewalk Bank Value = (0 x 128) + 2 = 2 Bank F/G MSB = 0 LSB = 3 Cakewalk Bank Value = (0 x 128) + 3 = 3 Bank R MSB = 0 LSB = 4 Cakewalk Bank Value = (0 x 128) + 4 = 4 Emu Proteus 1000 ---------------------- CMPSR Bank 0 MSB = 4 LSB = 0 Cakewalk Bank Value = (4 x 128) + 0 = 512 CMPSR Bank 1 MSB = 4 LSB = 1 Cakewalk Bank Value = (4 x 128) + 1 = 513 CMPSR Bank 2 MSB = 4 LSB = 2 Cakewalk Bank Value = (4 x 128) + 2 = 514 Once you calculate the [Bank Value] for Cakewalk, you would enter the line: Patch[Bank Value]=Name of the Voice Bank you want to control. That's all there is to a basic .INS file. You can add some comment lines preceded with (;) to make it look professional ;============================================== ; KORG i30 ; Cakewalk Instrument Definition File ;---------------------------------------------- .Patch Names [BankA] 0=Piano 1=BritePiano [BankC] 0=90's Piano 1=Rock Piano [BankE] 0=Pno & Strings 1=Piano Pad 2=Midi Piano ;----------------------------------------------- .Instrument Definitions Patch[0]=BankA Patch[1]=BankC Patch[2]=BankE ;=============================================== An actual .INS file also carries definition for Controllers, Note names for drum kits, Registered Parameter Numbers and Non Registered Parameter Numbers. They appear under the following section headings: .Controller Names .Note Names .RPN Names .NRPN Names Note of trivia: --------------- The reason for this limit of 128 values/notes is because MIDI bytes are 7 bits in length. The possible values are 2^7 = 128. The easiest way to overcome this limitation is to combine 2 MIDI bytes together to give you an extended range of 128 x 128 = 16384 possible values. This is where the idea of Bank Change Message preceding a Program Change Message comes from. Taken to its fullest extent, you can have 128 Voice Banks, each containing 128 voices for a grand total of 16384 voices! Tapas