/[svn]/libgig/trunk/src/gig.cpp
ViewVC logotype

Diff of /libgig/trunk/src/gig.cpp

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

revision 1158 by schoenebeck, Fri Apr 13 16:41:18 2007 UTC revision 1179 by persson, Sat May 12 11:25:04 2007 UTC
# Line 402  namespace { Line 402  namespace {
402          // update 'smpl' chunk          // update 'smpl' chunk
403          uint8_t* pData = (uint8_t*) pCkSmpl->LoadChunkData();          uint8_t* pData = (uint8_t*) pCkSmpl->LoadChunkData();
404          SamplePeriod = uint32_t(1000000000.0 / SamplesPerSecond + 0.5);          SamplePeriod = uint32_t(1000000000.0 / SamplesPerSecond + 0.5);
405          memcpy(&pData[0], &Manufacturer, 4);          store32(&pData[0], Manufacturer);
406          memcpy(&pData[4], &Product, 4);          store32(&pData[4], Product);
407          memcpy(&pData[8], &SamplePeriod, 4);          store32(&pData[8], SamplePeriod);
408          memcpy(&pData[12], &MIDIUnityNote, 4);          store32(&pData[12], MIDIUnityNote);
409          memcpy(&pData[16], &FineTune, 4);          store32(&pData[16], FineTune);
410          memcpy(&pData[20], &SMPTEFormat, 4);          store32(&pData[20], SMPTEFormat);
411          memcpy(&pData[24], &SMPTEOffset, 4);          store32(&pData[24], SMPTEOffset);
412          memcpy(&pData[28], &Loops, 4);          store32(&pData[28], Loops);
413    
414          // we skip 'manufByt' for now (4 bytes)          // we skip 'manufByt' for now (4 bytes)
415    
416          memcpy(&pData[36], &LoopID, 4);          store32(&pData[36], LoopID);
417          memcpy(&pData[40], &LoopType, 4);          store32(&pData[40], LoopType);
418          memcpy(&pData[44], &LoopStart, 4);          store32(&pData[44], LoopStart);
419          memcpy(&pData[48], &LoopEnd, 4);          store32(&pData[48], LoopEnd);
420          memcpy(&pData[52], &LoopFraction, 4);          store32(&pData[52], LoopFraction);
421          memcpy(&pData[56], &LoopPlayCount, 4);          store32(&pData[56], LoopPlayCount);
422    
423          // make sure '3gix' chunk exists          // make sure '3gix' chunk exists
424          pCk3gix = pWaveList->GetSubChunk(CHUNK_ID_3GIX);          pCk3gix = pWaveList->GetSubChunk(CHUNK_ID_3GIX);
# Line 438  namespace { Line 438  namespace {
438          }          }
439          // update '3gix' chunk          // update '3gix' chunk
440          pData = (uint8_t*) pCk3gix->LoadChunkData();          pData = (uint8_t*) pCk3gix->LoadChunkData();
441          memcpy(&pData[0], &iSampleGroup, 2);          store16(&pData[0], iSampleGroup);
442      }      }
443    
444      /// Scans compressed samples for mandatory informations (e.g. actual number of total sample points).      /// Scans compressed samples for mandatory informations (e.g. actual number of total sample points).
# Line 1504  namespace { Line 1504  namespace {
1504          // update '3ewa' chunk with DimensionRegion's current settings          // update '3ewa' chunk with DimensionRegion's current settings
1505    
1506          const uint32_t chunksize = _3ewa->GetSize();          const uint32_t chunksize = _3ewa->GetSize();
1507          memcpy(&pData[0], &chunksize, 4); // unknown, always chunk size?          store32(&pData[0], chunksize); // unknown, always chunk size?
1508    
1509          const int32_t lfo3freq = (int32_t) GIG_EXP_ENCODE(LFO3Frequency);          const int32_t lfo3freq = (int32_t) GIG_EXP_ENCODE(LFO3Frequency);
1510          memcpy(&pData[4], &lfo3freq, 4);          store32(&pData[4], lfo3freq);
1511    
1512          const int32_t eg3attack = (int32_t) GIG_EXP_ENCODE(EG3Attack);          const int32_t eg3attack = (int32_t) GIG_EXP_ENCODE(EG3Attack);
1513          memcpy(&pData[8], &eg3attack, 4);          store32(&pData[8], eg3attack);
1514    
1515          // next 2 bytes unknown          // next 2 bytes unknown
1516    
1517          memcpy(&pData[14], &LFO1InternalDepth, 2);          store16(&pData[14], LFO1InternalDepth);
1518    
1519          // next 2 bytes unknown          // next 2 bytes unknown
1520    
1521          memcpy(&pData[18], &LFO3InternalDepth, 2);          store16(&pData[18], LFO3InternalDepth);
1522    
1523          // next 2 bytes unknown          // next 2 bytes unknown
1524    
1525          memcpy(&pData[22], &LFO1ControlDepth, 2);          store16(&pData[22], LFO1ControlDepth);
1526    
1527          // next 2 bytes unknown          // next 2 bytes unknown
1528    
1529          memcpy(&pData[26], &LFO3ControlDepth, 2);          store16(&pData[26], LFO3ControlDepth);
1530    
1531          const int32_t eg1attack = (int32_t) GIG_EXP_ENCODE(EG1Attack);          const int32_t eg1attack = (int32_t) GIG_EXP_ENCODE(EG1Attack);
1532          memcpy(&pData[28], &eg1attack, 4);          store32(&pData[28], eg1attack);
1533    
1534          const int32_t eg1decay1 = (int32_t) GIG_EXP_ENCODE(EG1Decay1);          const int32_t eg1decay1 = (int32_t) GIG_EXP_ENCODE(EG1Decay1);
1535          memcpy(&pData[32], &eg1decay1, 4);          store32(&pData[32], eg1decay1);
1536    
1537          // next 2 bytes unknown          // next 2 bytes unknown
1538    
1539          memcpy(&pData[38], &EG1Sustain, 2);          store16(&pData[38], EG1Sustain);
1540    
1541          const int32_t eg1release = (int32_t) GIG_EXP_ENCODE(EG1Release);          const int32_t eg1release = (int32_t) GIG_EXP_ENCODE(EG1Release);
1542          memcpy(&pData[40], &eg1release, 4);          store32(&pData[40], eg1release);
1543    
1544          const uint8_t eg1ctl = (uint8_t) EncodeLeverageController(EG1Controller);          const uint8_t eg1ctl = (uint8_t) EncodeLeverageController(EG1Controller);
1545          memcpy(&pData[44], &eg1ctl, 1);          pData[44] = eg1ctl;
1546    
1547          const uint8_t eg1ctrloptions =          const uint8_t eg1ctrloptions =
1548              (EG1ControllerInvert) ? 0x01 : 0x00 |              (EG1ControllerInvert) ? 0x01 : 0x00 |
1549              GIG_EG_CTR_ATTACK_INFLUENCE_ENCODE(EG1ControllerAttackInfluence) |              GIG_EG_CTR_ATTACK_INFLUENCE_ENCODE(EG1ControllerAttackInfluence) |
1550              GIG_EG_CTR_DECAY_INFLUENCE_ENCODE(EG1ControllerDecayInfluence) |              GIG_EG_CTR_DECAY_INFLUENCE_ENCODE(EG1ControllerDecayInfluence) |
1551              GIG_EG_CTR_RELEASE_INFLUENCE_ENCODE(EG1ControllerReleaseInfluence);              GIG_EG_CTR_RELEASE_INFLUENCE_ENCODE(EG1ControllerReleaseInfluence);
1552          memcpy(&pData[45], &eg1ctrloptions, 1);          pData[45] = eg1ctrloptions;
1553    
1554          const uint8_t eg2ctl = (uint8_t) EncodeLeverageController(EG2Controller);          const uint8_t eg2ctl = (uint8_t) EncodeLeverageController(EG2Controller);
1555          memcpy(&pData[46], &eg2ctl, 1);          pData[46] = eg2ctl;
1556    
1557          const uint8_t eg2ctrloptions =          const uint8_t eg2ctrloptions =
1558              (EG2ControllerInvert) ? 0x01 : 0x00 |              (EG2ControllerInvert) ? 0x01 : 0x00 |
1559              GIG_EG_CTR_ATTACK_INFLUENCE_ENCODE(EG2ControllerAttackInfluence) |              GIG_EG_CTR_ATTACK_INFLUENCE_ENCODE(EG2ControllerAttackInfluence) |
1560              GIG_EG_CTR_DECAY_INFLUENCE_ENCODE(EG2ControllerDecayInfluence) |              GIG_EG_CTR_DECAY_INFLUENCE_ENCODE(EG2ControllerDecayInfluence) |
1561              GIG_EG_CTR_RELEASE_INFLUENCE_ENCODE(EG2ControllerReleaseInfluence);              GIG_EG_CTR_RELEASE_INFLUENCE_ENCODE(EG2ControllerReleaseInfluence);
1562          memcpy(&pData[47], &eg2ctrloptions, 1);          pData[47] = eg2ctrloptions;
1563    
1564          const int32_t lfo1freq = (int32_t) GIG_EXP_ENCODE(LFO1Frequency);          const int32_t lfo1freq = (int32_t) GIG_EXP_ENCODE(LFO1Frequency);
1565          memcpy(&pData[48], &lfo1freq, 4);          store32(&pData[48], lfo1freq);
1566    
1567          const int32_t eg2attack = (int32_t) GIG_EXP_ENCODE(EG2Attack);          const int32_t eg2attack = (int32_t) GIG_EXP_ENCODE(EG2Attack);
1568          memcpy(&pData[52], &eg2attack, 4);          store32(&pData[52], eg2attack);
1569    
1570          const int32_t eg2decay1 = (int32_t) GIG_EXP_ENCODE(EG2Decay1);          const int32_t eg2decay1 = (int32_t) GIG_EXP_ENCODE(EG2Decay1);
1571          memcpy(&pData[56], &eg2decay1, 4);          store32(&pData[56], eg2decay1);
1572    
1573          // next 2 bytes unknown          // next 2 bytes unknown
1574    
1575          memcpy(&pData[62], &EG2Sustain, 2);          store16(&pData[62], EG2Sustain);
1576    
1577          const int32_t eg2release = (int32_t) GIG_EXP_ENCODE(EG2Release);          const int32_t eg2release = (int32_t) GIG_EXP_ENCODE(EG2Release);
1578          memcpy(&pData[64], &eg2release, 4);          store32(&pData[64], eg2release);
1579    
1580          // next 2 bytes unknown          // next 2 bytes unknown
1581    
1582          memcpy(&pData[70], &LFO2ControlDepth, 2);          store16(&pData[70], LFO2ControlDepth);
1583    
1584          const int32_t lfo2freq = (int32_t) GIG_EXP_ENCODE(LFO2Frequency);          const int32_t lfo2freq = (int32_t) GIG_EXP_ENCODE(LFO2Frequency);
1585          memcpy(&pData[72], &lfo2freq, 4);          store32(&pData[72], lfo2freq);
1586    
1587          // next 2 bytes unknown          // next 2 bytes unknown
1588    
1589          memcpy(&pData[78], &LFO2InternalDepth, 2);          store16(&pData[78], LFO2InternalDepth);
1590    
1591          const int32_t eg1decay2 = (int32_t) (EG1InfiniteSustain) ? 0x7fffffff : (int32_t) GIG_EXP_ENCODE(EG1Decay2);          const int32_t eg1decay2 = (int32_t) (EG1InfiniteSustain) ? 0x7fffffff : (int32_t) GIG_EXP_ENCODE(EG1Decay2);
1592          memcpy(&pData[80], &eg1decay2, 4);          store32(&pData[80], eg1decay2);
1593    
1594          // next 2 bytes unknown          // next 2 bytes unknown
1595    
1596          memcpy(&pData[86], &EG1PreAttack, 2);          store16(&pData[86], EG1PreAttack);
1597    
1598          const int32_t eg2decay2 = (int32_t) (EG2InfiniteSustain) ? 0x7fffffff : (int32_t) GIG_EXP_ENCODE(EG2Decay2);          const int32_t eg2decay2 = (int32_t) (EG2InfiniteSustain) ? 0x7fffffff : (int32_t) GIG_EXP_ENCODE(EG2Decay2);
1599          memcpy(&pData[88], &eg2decay2, 4);          store32(&pData[88], eg2decay2);
1600    
1601          // next 2 bytes unknown          // next 2 bytes unknown
1602    
1603          memcpy(&pData[94], &EG2PreAttack, 2);          store16(&pData[94], EG2PreAttack);
1604    
1605          {          {
1606              if (VelocityResponseDepth > 4) throw Exception("VelocityResponseDepth must be between 0 and 4");              if (VelocityResponseDepth > 4) throw Exception("VelocityResponseDepth must be between 0 and 4");
# Line 1618  namespace { Line 1618  namespace {
1618                  default:                  default:
1619                      throw Exception("Could not update DimensionRegion's chunk, unknown VelocityResponseCurve selected");                      throw Exception("Could not update DimensionRegion's chunk, unknown VelocityResponseCurve selected");
1620              }              }
1621              memcpy(&pData[96], &velocityresponse, 1);              pData[96] = velocityresponse;
1622          }          }
1623    
1624          {          {
# Line 1637  namespace { Line 1637  namespace {
1637                  default:                  default:
1638                      throw Exception("Could not update DimensionRegion's chunk, unknown ReleaseVelocityResponseCurve selected");                      throw Exception("Could not update DimensionRegion's chunk, unknown ReleaseVelocityResponseCurve selected");
1639              }              }
1640              memcpy(&pData[97], &releasevelocityresponse, 1);              pData[97] = releasevelocityresponse;
1641          }          }
1642    
1643          memcpy(&pData[98], &VelocityResponseCurveScaling, 1);          pData[98] = VelocityResponseCurveScaling;
1644    
1645          memcpy(&pData[99], &AttenuationControllerThreshold, 1);          pData[99] = AttenuationControllerThreshold;
1646    
1647          // next 4 bytes unknown          // next 4 bytes unknown
1648    
1649          memcpy(&pData[104], &SampleStartOffset, 2);          store16(&pData[104], SampleStartOffset);
1650    
1651          // next 2 bytes unknown          // next 2 bytes unknown
1652    
# Line 1665  namespace { Line 1665  namespace {
1665                  default:                  default:
1666                      throw Exception("Could not update DimensionRegion's chunk, unknown DimensionBypass selected");                      throw Exception("Could not update DimensionRegion's chunk, unknown DimensionBypass selected");
1667              }              }
1668              memcpy(&pData[108], &pitchTrackDimensionBypass, 1);              pData[108] = pitchTrackDimensionBypass;
1669          }          }
1670    
1671          const uint8_t pan = (Pan >= 0) ? Pan : ((-Pan) + 63); // signed 8 bit -> signed 7 bit          const uint8_t pan = (Pan >= 0) ? Pan : ((-Pan) + 63); // signed 8 bit -> signed 7 bit
1672          memcpy(&pData[109], &pan, 1);          pData[109] = pan;
1673    
1674          const uint8_t selfmask = (SelfMask) ? 0x01 : 0x00;          const uint8_t selfmask = (SelfMask) ? 0x01 : 0x00;
1675          memcpy(&pData[110], &selfmask, 1);          pData[110] = selfmask;
1676    
1677          // next byte unknown          // next byte unknown
1678    
# Line 1681  namespace { Line 1681  namespace {
1681              if (LFO3Sync) lfo3ctrl |= 0x20; // bit 5              if (LFO3Sync) lfo3ctrl |= 0x20; // bit 5
1682              if (InvertAttenuationController) lfo3ctrl |= 0x80; // bit 7              if (InvertAttenuationController) lfo3ctrl |= 0x80; // bit 7
1683              if (VCFType == vcf_type_lowpassturbo) lfo3ctrl |= 0x40; // bit 6              if (VCFType == vcf_type_lowpassturbo) lfo3ctrl |= 0x40; // bit 6
1684              memcpy(&pData[112], &lfo3ctrl, 1);              pData[112] = lfo3ctrl;
1685          }          }
1686    
1687          const uint8_t attenctl = EncodeLeverageController(AttenuationController);          const uint8_t attenctl = EncodeLeverageController(AttenuationController);
1688          memcpy(&pData[113], &attenctl, 1);          pData[113] = attenctl;
1689    
1690          {          {
1691              uint8_t lfo2ctrl = LFO2Controller & 0x07; // lower 3 bits              uint8_t lfo2ctrl = LFO2Controller & 0x07; // lower 3 bits
1692              if (LFO2FlipPhase) lfo2ctrl |= 0x80; // bit 7              if (LFO2FlipPhase) lfo2ctrl |= 0x80; // bit 7
1693              if (LFO2Sync)      lfo2ctrl |= 0x20; // bit 5              if (LFO2Sync)      lfo2ctrl |= 0x20; // bit 5
1694              if (VCFResonanceController != vcf_res_ctrl_none) lfo2ctrl |= 0x40; // bit 6              if (VCFResonanceController != vcf_res_ctrl_none) lfo2ctrl |= 0x40; // bit 6
1695              memcpy(&pData[114], &lfo2ctrl, 1);              pData[114] = lfo2ctrl;
1696          }          }
1697    
1698          {          {
# Line 1701  namespace { Line 1701  namespace {
1701              if (LFO1Sync)      lfo1ctrl |= 0x40; // bit 6              if (LFO1Sync)      lfo1ctrl |= 0x40; // bit 6
1702              if (VCFResonanceController != vcf_res_ctrl_none)              if (VCFResonanceController != vcf_res_ctrl_none)
1703                  lfo1ctrl |= GIG_VCF_RESONANCE_CTRL_ENCODE(VCFResonanceController);                  lfo1ctrl |= GIG_VCF_RESONANCE_CTRL_ENCODE(VCFResonanceController);
1704              memcpy(&pData[115], &lfo1ctrl, 1);              pData[115] = lfo1ctrl;
1705          }          }
1706    
1707          const uint16_t eg3depth = (EG3Depth >= 0) ? EG3Depth          const uint16_t eg3depth = (EG3Depth >= 0) ? EG3Depth
1708                                                    : uint16_t(((-EG3Depth) - 1) ^ 0xffff); /* binary complementary for negatives */                                                    : uint16_t(((-EG3Depth) - 1) ^ 0xffff); /* binary complementary for negatives */
1709          memcpy(&pData[116], &eg3depth, 1);          pData[116] = eg3depth;
1710    
1711          // next 2 bytes unknown          // next 2 bytes unknown
1712    
1713          const uint8_t channeloffset = ChannelOffset * 4;          const uint8_t channeloffset = ChannelOffset * 4;
1714          memcpy(&pData[120], &channeloffset, 1);          pData[120] = channeloffset;
1715    
1716          {          {
1717              uint8_t regoptions = 0;              uint8_t regoptions = 0;
1718              if (MSDecode)      regoptions |= 0x01; // bit 0              if (MSDecode)      regoptions |= 0x01; // bit 0
1719              if (SustainDefeat) regoptions |= 0x02; // bit 1              if (SustainDefeat) regoptions |= 0x02; // bit 1
1720              memcpy(&pData[121], &regoptions, 1);              pData[121] = regoptions;
1721          }          }
1722    
1723          // next 2 bytes unknown          // next 2 bytes unknown
1724    
1725          memcpy(&pData[124], &VelocityUpperLimit, 1);          pData[124] = VelocityUpperLimit;
1726    
1727          // next 3 bytes unknown          // next 3 bytes unknown
1728    
1729          memcpy(&pData[128], &ReleaseTriggerDecay, 1);          pData[128] = ReleaseTriggerDecay;
1730    
1731          // next 2 bytes unknown          // next 2 bytes unknown
1732    
1733          const uint8_t eg1hold = (EG1Hold) ? 0x80 : 0x00; // bit 7          const uint8_t eg1hold = (EG1Hold) ? 0x80 : 0x00; // bit 7
1734          memcpy(&pData[131], &eg1hold, 1);          pData[131] = eg1hold;
1735    
1736          const uint8_t vcfcutoff = (VCFEnabled) ? 0x80 : 0x00 |  /* bit 7 */          const uint8_t vcfcutoff = (VCFEnabled) ? 0x80 : 0x00 |  /* bit 7 */
1737                                    (VCFCutoff & 0x7f);   /* lower 7 bits */                                    (VCFCutoff & 0x7f);   /* lower 7 bits */
1738          memcpy(&pData[132], &vcfcutoff, 1);          pData[132] = vcfcutoff;
1739    
1740          memcpy(&pData[133], &VCFCutoffController, 1);          pData[133] = VCFCutoffController;
1741    
1742          const uint8_t vcfvelscale = (VCFCutoffControllerInvert) ? 0x80 : 0x00 | /* bit 7 */          const uint8_t vcfvelscale = (VCFCutoffControllerInvert) ? 0x80 : 0x00 | /* bit 7 */
1743                                      (VCFVelocityScale & 0x7f); /* lower 7 bits */                                      (VCFVelocityScale & 0x7f); /* lower 7 bits */
1744          memcpy(&pData[134], &vcfvelscale, 1);          pData[134] = vcfvelscale;
1745    
1746          // next byte unknown          // next byte unknown
1747    
1748          const uint8_t vcfresonance = (VCFResonanceDynamic) ? 0x00 : 0x80 | /* bit 7 */          const uint8_t vcfresonance = (VCFResonanceDynamic) ? 0x00 : 0x80 | /* bit 7 */
1749                                       (VCFResonance & 0x7f); /* lower 7 bits */                                       (VCFResonance & 0x7f); /* lower 7 bits */
1750          memcpy(&pData[136], &vcfresonance, 1);          pData[136] = vcfresonance;
1751    
1752          const uint8_t vcfbreakpoint = (VCFKeyboardTracking) ? 0x80 : 0x00 | /* bit 7 */          const uint8_t vcfbreakpoint = (VCFKeyboardTracking) ? 0x80 : 0x00 | /* bit 7 */
1753                                        (VCFKeyboardTrackingBreakpoint & 0x7f); /* lower 7 bits */                                        (VCFKeyboardTrackingBreakpoint & 0x7f); /* lower 7 bits */
1754          memcpy(&pData[137], &vcfbreakpoint, 1);          pData[137] = vcfbreakpoint;
1755    
1756          const uint8_t vcfvelocity = VCFVelocityDynamicRange % 5 |          const uint8_t vcfvelocity = VCFVelocityDynamicRange % 5 |
1757                                      VCFVelocityCurve * 5;                                      VCFVelocityCurve * 5;
1758          memcpy(&pData[138], &vcfvelocity, 1);          pData[138] = vcfvelocity;
1759    
1760          const uint8_t vcftype = (VCFType == vcf_type_lowpassturbo) ? vcf_type_lowpass : VCFType;          const uint8_t vcftype = (VCFType == vcf_type_lowpassturbo) ? vcf_type_lowpass : VCFType;
1761          memcpy(&pData[139], &vcftype, 1);          pData[139] = vcftype;
1762    
1763          if (chunksize >= 148) {          if (chunksize >= 148) {
1764              memcpy(&pData[140], DimensionUpperLimits, 8);              memcpy(&pData[140], DimensionUpperLimits, 8);
# Line 2217  namespace { Line 2217  namespace {
2217    
2218          // update dimension definitions in '3lnk' chunk          // update dimension definitions in '3lnk' chunk
2219          uint8_t* pData = (uint8_t*) _3lnk->LoadChunkData();          uint8_t* pData = (uint8_t*) _3lnk->LoadChunkData();
2220          memcpy(&pData[0], &DimensionRegions, 4);          store32(&pData[0], DimensionRegions);
2221          for (int i = 0; i < iMaxDimensions; i++) {          for (int i = 0; i < iMaxDimensions; i++) {
2222              pData[4 + i * 8] = (uint8_t) pDimensionDefinitions[i].dimension;              pData[4 + i * 8] = (uint8_t) pDimensionDefinitions[i].dimension;
2223              pData[5 + i * 8] = pDimensionDefinitions[i].bits;              pData[5 + i * 8] = pDimensionDefinitions[i].bits;
# Line 2242  namespace { Line 2242  namespace {
2242                  }                  }
2243                  if (iWaveIndex < 0) throw gig::Exception("Could not update gig::Region, could not find DimensionRegion's sample");                  if (iWaveIndex < 0) throw gig::Exception("Could not update gig::Region, could not find DimensionRegion's sample");
2244              }              }
2245              memcpy(&pData[iWavePoolOffset + i * 4], &iWaveIndex, 4);              store32(&pData[iWavePoolOffset + i * 4], iWaveIndex);
2246          }          }
2247      }      }
2248    
# Line 2674  namespace { Line 2674  namespace {
2674          if (!_3ewg)  _3ewg = lart->AddSubChunk(CHUNK_ID_3EWG, 12);          if (!_3ewg)  _3ewg = lart->AddSubChunk(CHUNK_ID_3EWG, 12);
2675          // update '3ewg' RIFF chunk          // update '3ewg' RIFF chunk
2676          uint8_t* pData = (uint8_t*) _3ewg->LoadChunkData();          uint8_t* pData = (uint8_t*) _3ewg->LoadChunkData();
2677          memcpy(&pData[0], &EffectSend, 2);          store16(&pData[0], EffectSend);
2678          memcpy(&pData[2], &Attenuation, 4);          store32(&pData[2], Attenuation);
2679          memcpy(&pData[6], &FineTune, 2);          store16(&pData[6], FineTune);
2680          memcpy(&pData[8], &PitchbendRange, 2);          store16(&pData[8], PitchbendRange);
2681          const uint8_t dimkeystart = (PianoReleaseMode) ? 0x01 : 0x00 |          const uint8_t dimkeystart = (PianoReleaseMode) ? 0x01 : 0x00 |
2682                                      DimensionKeyRange.low << 1;                                      DimensionKeyRange.low << 1;
2683          memcpy(&pData[10], &dimkeystart, 1);          pData[10] = dimkeystart;
2684          memcpy(&pData[11], &DimensionKeyRange.high, 1);          pData[11] = DimensionKeyRange.high;
2685      }      }
2686    
2687      /**      /**

Legend:
Removed from v.1158  
changed lines
  Added in v.1179

  ViewVC Help
Powered by ViewVC