/[svn]/libgig/trunk/src/tools/gigdump.cpp
ViewVC logotype

Diff of /libgig/trunk/src/tools/gigdump.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2 by schoenebeck, Sat Oct 25 20:15:04 2003 UTC revision 511 by schoenebeck, Thu May 5 13:49:53 2005 UTC
# Line 2  Line 2 
2   *                                                                         *   *                                                                         *
3   *   libgig - C++ cross-platform Gigasampler format file loader library    *   *   libgig - C++ cross-platform Gigasampler format file loader library    *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003 by Christian Schoenebeck                           *   *   Copyright (C) 2003-2005 by Christian Schoenebeck                      *
6   *                         <cuse@users.sourceforge.net>                    *   *                              <cuse@users.sourceforge.net>               *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 22  Line 22 
22   ***************************************************************************/   ***************************************************************************/
23    
24  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
25  #include <config.h>  # include <config.h>
26  #endif  #endif
27    
28  #include <iostream>  #include <iostream>
# Line 81  void PrintSamples(gig::File* gig) { Line 81  void PrintSamples(gig::File* gig) {
81          if (name == "") name = "<NO NAME>";          if (name == "") name = "<NO NAME>";
82          else            name = '\"' + name + '\"';          else            name = '\"' + name + '\"';
83          cout << "    Sample " << samples << ") " << name << ", ";          cout << "    Sample " << samples << ") " << name << ", ";
84          cout << pSample->SamplesPerSecond << "Hz, " << pSample->Channels << " Channels, " << pSample->Loops          cout << pSample->SamplesPerSecond << "Hz, " << pSample->Channels << " Channels, " << pSample->Loops << " Loops";
85               << " Loops, LoopFraction=" << pSample->LoopFraction << ", Length=" << pSample->SamplesTotal << " Compressed=" << pSample->Compressed << endl;          if (pSample->Loops) {
86                cout << " (Type: ";
87                switch (pSample->LoopType) {
88                    case gig::loop_type_normal:         cout << "normal)";   break;
89                    case gig::loop_type_bidirectional:  cout << "pingpong)"; break;
90                    case gig::loop_type_backward:       cout << "reverse)";  break;
91                }
92                cout << ", LoopFraction=" << pSample->LoopFraction << ", Start=" << pSample->LoopStart << ", End=" << pSample->LoopEnd;
93                cout << ", LoopPlayCount=" << pSample->LoopPlayCount;
94            }
95            cout << ", Length=" << pSample->SamplesTotal << " Compressed=" << ((pSample->Compressed) ? "true" : "false") << endl;
96          pSample = gig->GetNextSample();          pSample = gig->GetNextSample();
97      }      }
98  }  }
# Line 122  void PrintRegions(gig::Instrument* instr Line 132  void PrintRegions(gig::Instrument* instr
132              cout << "<NO_VALID_SAMPLE_REFERENCE> ";              cout << "<NO_VALID_SAMPLE_REFERENCE> ";
133          }          }
134          cout << "            KeyRange=" << pRegion->KeyRange.low << "-" << pRegion->KeyRange.high << ", ";          cout << "            KeyRange=" << pRegion->KeyRange.low << "-" << pRegion->KeyRange.high << ", ";
135          cout << "VelocityRange=" << pRegion->VelocityRange.low << "-" << pRegion->VelocityRange.high << ", Layer=" << pRegion->Layer << endl;          cout << "VelocityRange=" << pRegion->VelocityRange.low << "-" << pRegion->VelocityRange.high << ", Layers=" << pRegion->Layers << endl;
136          cout << "            Loops=" << pRegion->SampleLoops << endl;          cout << "            Loops=" << pRegion->SampleLoops << endl;
137            cout << "            Dimensions=" << pRegion->Dimensions << endl;
138            for (int iDimension = 0; iDimension < pRegion->Dimensions; iDimension++) {
139                cout << "            Dimension[" << iDimension << "]: Type=";
140                gig::dimension_def_t DimensionDef = pRegion->pDimensionDefinitions[iDimension];
141                switch (DimensionDef.dimension) {
142                    case gig::dimension_none:
143                        cout << "NONE";
144                        break;
145                    case gig::dimension_samplechannel: // If used sample has more than one channel (thus is not mono).
146                        cout << "SAMPLECHANNEL";
147                        break;
148                    case gig::dimension_layer: { // For layering of up to 8 instruments (and eventually crossfading of 2 or 4 layers).
149                        gig::crossfade_t crossfade = pRegion->pDimensionRegions[iDimension]->Crossfade;
150                        cout << "LAYER (Crossfade in_start=" << (int) crossfade.in_start << ",in_end=" << (int) crossfade.in_end << ",out_start=" << (int) crossfade.out_start << ",out_end=" << (int) crossfade.out_end << ")";
151                        break;
152                    }
153                    case gig::dimension_velocity: // Key Velocity (this is the only dimension where the ranges can exactly be defined).
154                        cout << "VELOCITY";
155                        break;
156                    case gig::dimension_channelaftertouch: // Channel Key Pressure
157                        cout << "AFTERTOUCH";
158                        break;
159                    case gig::dimension_releasetrigger: // Special dimension for triggering samples on releasing a key.
160                        cout << "RELEASETRIGGER";
161                        break;
162                    case gig::dimension_keyboard: // Key Position
163                        cout << "KEYBOARD";
164                        break;
165                    case gig::dimension_roundrobin: // Different samples triggered each time a note is played, dimension regions selected in sequence
166                        cout << "ROUNDROBIN";
167                        break;
168                    case gig::dimension_random: // Different samples triggered each time a note is played, random order
169                        cout << "RANDOM";
170                        break;
171                    case gig::dimension_modwheel: // Modulation Wheel (MIDI Controller 1)
172                        cout << "MODWHEEL";
173                        break;
174                    case gig::dimension_breath: // Breath Controller (Coarse, MIDI Controller 2)
175                        cout << "BREATH";
176                        break;
177                    case gig::dimension_foot: // Foot Pedal (Coarse, MIDI Controller 4)
178                        cout << "FOOT";
179                        break;
180                    case gig::dimension_portamentotime: // Portamento Time (Coarse, MIDI Controller 5)
181                        cout << "PORTAMENTOTIME";
182                        break;
183                    case gig::dimension_effect1: // Effect Controller 1 (Coarse, MIDI Controller 12)
184                        cout << "EFFECT1";
185                        break;
186                    case gig::dimension_effect2: // Effect Controller 2 (Coarse, MIDI Controller 13)
187                        cout << "EFFECT2";
188                        break;
189                    case gig::dimension_genpurpose1: // General Purpose Controller 1 (Slider, MIDI Controller 16)
190                        cout << "GENPURPOSE1";
191                        break;
192                    case gig::dimension_genpurpose2: // General Purpose Controller 2 (Slider, MIDI Controller 17)
193                        cout << "GENPURPOSE2";
194                        break;
195                    case gig::dimension_genpurpose3: // General Purpose Controller 3 (Slider, MIDI Controller 18)
196                        cout << "GENPURPOSE3";
197                        break;
198                    case gig::dimension_genpurpose4: // General Purpose Controller 4 (Slider, MIDI Controller 19)
199                        cout << "GENPURPOSE4";
200                        break;
201                    case gig::dimension_sustainpedal: // Sustain Pedal (MIDI Controller 64)
202                        cout << "SUSTAINPEDAL";
203                        break;
204                    case gig::dimension_portamento: // Portamento (MIDI Controller 65)
205                        cout << "PORTAMENTO";
206                        break;
207                    case gig::dimension_sostenutopedal: // Sostenuto Pedal (MIDI Controller 66)
208                        cout << "SOSTENUTOPEDAL";
209                        break;
210                    case gig::dimension_softpedal: // Soft Pedal (MIDI Controller 67)
211                        cout << "SOFTPEDAL";
212                        break;
213                    case gig::dimension_genpurpose5: // General Purpose Controller 5 (Button, MIDI Controller 80)
214                        cout << "GENPURPOSE5";
215                        break;
216                    case gig::dimension_genpurpose6: // General Purpose Controller 6 (Button, MIDI Controller 81)
217                        cout << "GENPURPOSE6";
218                        break;
219                    case gig::dimension_genpurpose7: // General Purpose Controller 7 (Button, MIDI Controller 82)
220                        cout << "GENPURPOSE7";
221                        break;
222                    case gig::dimension_genpurpose8: // General Purpose Controller 8 (Button, MIDI Controller 83)
223                        cout << "GENPURPOSE8";
224                        break;
225                    case gig::dimension_effect1depth: // Effect 1 Depth (MIDI Controller 91)
226                        cout << "EFFECT1DEPTH";
227                        break;
228                    case gig::dimension_effect2depth: // Effect 2 Depth (MIDI Controller 92)
229                        cout << "EFFECT2DEPTH";
230                        break;
231                    case gig::dimension_effect3depth: // Effect 3 Depth (MIDI Controller 93)
232                        cout << "EFFECT3DEPTH";
233                        break;
234                    case gig::dimension_effect4depth: // Effect 4 Depth (MIDI Controller 94)
235                        cout << "EFFECT4DEPTH";
236                        break;
237                    case gig::dimension_effect5depth:  // Effect 5 Depth (MIDI Controller 95)
238                        cout << "EFFECT5DEPTH";
239                        break;
240                    default:
241                        cout << "UNKNOWN (" << int(DimensionDef.dimension) << ") - please report this !";
242                        break;
243                }
244                cout << ", Bits=" << (uint) DimensionDef.bits << ", Zones=" << (uint) DimensionDef.zones;
245                cout << ", SplitType=";
246                switch (DimensionDef.split_type) {
247                    case gig::split_type_normal:
248                        cout << "NORMAL" << endl;
249                        break;
250                    case gig::split_type_customvelocity:
251                        cout << "CUSTOMVELOCITY" << endl;
252                        break;
253                    case gig::split_type_bit:
254                        cout << "BIT" << endl;
255                        break;
256                    default:
257                        cout << "UNKNOWN" << endl;
258                }
259            }
260    
261          PrintDimensionRegions(pRegion);          PrintDimensionRegions(pRegion);
262    
263          pRegion = instr->GetNextRegion();          pRegion = instr->GetNextRegion();
# Line 145  void PrintDimensionRegions(gig::Region* Line 279  void PrintDimensionRegions(gig::Region*
279              if (pSample->pInfo->Name != "") {              if (pSample->pInfo->Name != "") {
280                  cout << "\"" << pSample->pInfo->Name << "\", ";                  cout << "\"" << pSample->pInfo->Name << "\", ";
281              }              }
282              cout << pSample->SamplesPerSecond << "Hz, " << endl;              cout << pSample->SamplesPerSecond << "Hz, ";
283                cout << "UnityNote=" << (int) pDimensionRegion->UnityNote << ", FineTune=" << (int) pDimensionRegion->FineTune << ", Gain=" << (-pDimensionRegion->Gain / 655360.0) << "dB, SampleStartOffset=" << pDimensionRegion->SampleStartOffset << endl;
284          }          }
285          else {          else {
286              cout << "                Sample: <NO_VALID_SAMPLE_REFERENCE> " << endl;              cout << "                Sample: <NO_VALID_SAMPLE_REFERENCE> " << endl;
# Line 156  void PrintDimensionRegions(gig::Region* Line 291  void PrintDimensionRegions(gig::Region*
291          cout << "                EG1PreAttack=" << pDimensionRegion->EG1PreAttack << "permille, EG1Attack=" << pDimensionRegion->EG1Attack << "s, EG1Decay1=" << pDimensionRegion->EG1Decay1 << "s,  EG1Sustain=" << pDimensionRegion->EG1Sustain << "permille, EG1Release=" << pDimensionRegion->EG1Release << "s, EG1Decay2=" << pDimensionRegion->EG1Decay2 << "s, EG1Hold=" << pDimensionRegion->EG1Hold << endl;          cout << "                EG1PreAttack=" << pDimensionRegion->EG1PreAttack << "permille, EG1Attack=" << pDimensionRegion->EG1Attack << "s, EG1Decay1=" << pDimensionRegion->EG1Decay1 << "s,  EG1Sustain=" << pDimensionRegion->EG1Sustain << "permille, EG1Release=" << pDimensionRegion->EG1Release << "s, EG1Decay2=" << pDimensionRegion->EG1Decay2 << "s, EG1Hold=" << pDimensionRegion->EG1Hold << endl;
292          cout << "                EG2PreAttack=" << pDimensionRegion->EG2PreAttack << "permille, EG2Attack=" << pDimensionRegion->EG2Attack << "s, EG2Decay1=" << pDimensionRegion->EG2Decay1 << "s,  EG2Sustain=" << pDimensionRegion->EG2Sustain << "permille, EG2Release=" << pDimensionRegion->EG2Release << "s, EG2Decay2=" << pDimensionRegion->EG2Decay2 << "s" << endl;          cout << "                EG2PreAttack=" << pDimensionRegion->EG2PreAttack << "permille, EG2Attack=" << pDimensionRegion->EG2Attack << "s, EG2Decay1=" << pDimensionRegion->EG2Decay1 << "s,  EG2Sustain=" << pDimensionRegion->EG2Sustain << "permille, EG2Release=" << pDimensionRegion->EG2Release << "s, EG2Decay2=" << pDimensionRegion->EG2Decay2 << "s" << endl;
293          cout << "                VCFEnabled=" << pDimensionRegion->VCFEnabled << ", VCFType=" << pDimensionRegion->VCFType << ", VCFCutoff=" << (int) pDimensionRegion->VCFCutoff << ",  VCFResonance=" << (int) pDimensionRegion->VCFResonance << ", VCFCutoffController=" << pDimensionRegion->VCFCutoffController << endl;          cout << "                VCFEnabled=" << pDimensionRegion->VCFEnabled << ", VCFType=" << pDimensionRegion->VCFType << ", VCFCutoff=" << (int) pDimensionRegion->VCFCutoff << ",  VCFResonance=" << (int) pDimensionRegion->VCFResonance << ", VCFCutoffController=" << pDimensionRegion->VCFCutoffController << endl;
294            cout << "                VelocityResponseCurve=";
295            switch (pDimensionRegion->VelocityResponseCurve) {
296                case gig::curve_type_nonlinear:
297                    cout << "NONLINEAR";
298                    break;
299                case gig::curve_type_linear:
300                    cout << "LINEAR";
301                    break;
302                case gig::curve_type_special:
303                    cout << "SPECIAL";
304                    break;
305                case gig::curve_type_unknown:
306                default:
307                    cout << "UNKNOWN - please report this !";
308            }
309            cout << ", VelocityResponseDepth=" << (int) pDimensionRegion->VelocityResponseDepth << ", VelocityResponseCurveScaling=" << (int) pDimensionRegion->VelocityResponseCurveScaling << endl;
310            cout << "                Pan=" << (int) pDimensionRegion->Pan << endl;
311    
312          dimensionRegions++;          dimensionRegions++;
313      }      }

Legend:
Removed from v.2  
changed lines
  Added in v.511

  ViewVC Help
Powered by ViewVC