Exemplo n.º 1
0
 public void LoadSf2(Sf2Region[] regions, AssetManager assets)
 {
     _intervalList = new PatchInterval[regions.Length];
     for (int x = 0; x < regions.Length; x++)
     {
         byte loKey;
         byte hiKey;
         byte loVel;
         byte hiVel;
         if (TypeUtils.IsLittleEndian)
         {
             loKey = TypeUtils.ToUInt8(regions[x].Generators[(int)GeneratorEnum.KeyRange] & 0xFF);
             hiKey = TypeUtils.ToUInt8((regions[x].Generators[(int)GeneratorEnum.KeyRange] >> 8) & 0xFF);
             loVel = TypeUtils.ToUInt8(regions[x].Generators[(int)GeneratorEnum.VelocityRange] & 0xFF);
             hiVel = TypeUtils.ToUInt8((regions[x].Generators[(int)GeneratorEnum.VelocityRange] >> 8) & 0xFF);
         }
         else
         {
             hiKey = TypeUtils.ToUInt8(regions[x].Generators[(int)GeneratorEnum.KeyRange] & 0xFF);
             loKey = TypeUtils.ToUInt8((regions[x].Generators[(int)GeneratorEnum.KeyRange] >> 8) & 0xFF);
             hiVel = TypeUtils.ToUInt8(regions[x].Generators[(int)GeneratorEnum.VelocityRange] & 0xFF);
             loVel = TypeUtils.ToUInt8((regions[x].Generators[(int)GeneratorEnum.VelocityRange] >> 8) & 0xFF);
         }
         var sf2 = new Sf2Patch(Name + "_" + x);
         sf2.Load(regions[x], assets);
         _intervalList[x] = new PatchInterval(sf2, 0, 15, loKey, hiKey, loVel, hiVel);
     }
     DetermineIntervalType();
 }
Exemplo n.º 2
0
 public void LoadSf2(Sf2Region[] regions, AssetManager assets)
 {
     _intervalList = new PatchInterval[regions.Length];
     for (int x = 0; x < regions.Length; x++)
     {
         byte loKey;
         byte hiKey;
         byte loVel;
         byte hiVel;
         if (TypeUtils.IsLittleEndian)
         {
             loKey = TypeUtils.ToUInt8(regions[x].Generators[(int)GeneratorEnum.KeyRange] & 0xFF);
             hiKey = TypeUtils.ToUInt8((regions[x].Generators[(int)GeneratorEnum.KeyRange] >> 8) & 0xFF);
             loVel = TypeUtils.ToUInt8(regions[x].Generators[(int)GeneratorEnum.VelocityRange] & 0xFF);
             hiVel = TypeUtils.ToUInt8((regions[x].Generators[(int)GeneratorEnum.VelocityRange] >> 8) & 0xFF);
         }
         else
         {
             hiKey = TypeUtils.ToUInt8(regions[x].Generators[(int)GeneratorEnum.KeyRange] & 0xFF);
             loKey = TypeUtils.ToUInt8((regions[x].Generators[(int)GeneratorEnum.KeyRange] >> 8) & 0xFF);
             hiVel = TypeUtils.ToUInt8(regions[x].Generators[(int)GeneratorEnum.VelocityRange] & 0xFF);
             loVel = TypeUtils.ToUInt8((regions[x].Generators[(int)GeneratorEnum.VelocityRange] >> 8) & 0xFF);
         }
         var sf2 = new Sf2Patch(Name + "_" + x);
         sf2.Load(regions[x], assets);
         _intervalList[x] = new PatchInterval(sf2, 0, 15, loKey, hiKey, loVel, hiVel);
     }
     DetermineIntervalType();
 }