SoundSource.java
     1: //========================================================================================
     2: //  SoundSource.java
     3: //    en:Sound source -- It outputs mixed sound of the frequency modulation sound source and ADPCM sound source while converting the sampling frequency.
     4: //    ja:音源 -- FM音源とADPCM音源を合成してサンプリング周波数を変換しながら出力します。
     5: //  Copyright (C) 2003-2017 Makoto Kamada
     6: //
     7: //  This file is part of the XEiJ (X68000 Emulator in Java).
     8: //  You can use, modify and redistribute the XEiJ if the conditions are met.
     9: //  Read the XEiJ License for more details.
    10: //  http://stdkmd.com/xeij/
    11: //========================================================================================
    12: 
    13: //----------------------------------------------------------------------------------------
    14: //  内部のサンプリング周波数を62500Hzに固定し、周波数を変換しながら出力する
    15: //  音を出さないまたは出せないときも、タイマやレジスタは音が出ているときと同じように機能しなければならない
    16: //
    17: //  参考
    18: //    Java Sound API プログラマーズガイド
    19: //      http://docs.oracle.com/javase/jp/1.3/guide/sound/prog_guide/title.fm.html
    20: //! 非対応。PCMの入力は実装しない
    21: //----------------------------------------------------------------------------------------
    22: 
    23: package xeij;
    24: 
    25: import java.lang.*;  //Boolean,Character,Class,Comparable,Double,Exception,Float,IllegalArgumentException,Integer,Long,Math,Number,Object,Runnable,SecurityException,String,StringBuilder,System
    26: import java.nio.*;  //ByteBuffer,ByteOrder
    27: import java.util.*;  //ArrayList,Arrays,Calendar,GregorianCalendar,HashMap,Map,Map.Entry,Timer,TimerTask,TreeMap
    28: import javax.sound.sampled.*;  //AudioFormat,AudioSystem,DataLine,LineUnavailableException,SourceDataLine
    29: 
    30: public class SoundSource {
    31: 
    32:   //ソースデータライン
    33:   public static final boolean SND_ON = true;  //true=出力する
    34:   public static final int SND_SAMPLE_FREQ = 48000;  //サンプリング周波数(Hz)。22050,44100,48000のいずれか
    35:   public static final int SND_CHANNELS = 2;  //チャンネル数。1=モノラル,2=ステレオ
    36:   public static final int SND_SAMPLE_SHIFT = SND_CHANNELS == 1 ? 1 : 2;  //1サンプルのバイト数のシフトカウント
    37:   public static final int SND_SAMPLE_BYTES = 1 << SND_SAMPLE_SHIFT;  //1サンプルのバイト数
    38:   public static SourceDataLine sndLine;  //出力ライン。null=出力不可。SND_ONのときだけsndLine!=nullになる
    39: 
    40:   //動作モード
    41:   public static boolean sndPlayOn;  //true=出力する。sndLine!=nullのときだけtrueになる
    42: 
    43:   //ブロック
    44:   //  動作単位。1/25秒(0.04秒)ずつ出力する
    45:   //  SND_BLOCK_FREQはXEiJ.TMR_FREQとSND_SAMPLE_FREQとYM2151.OPM_SAMPLE_FREQとADPCM.PCM_SAMPLE_FREQをすべて割り切らなければならない
    46:   public static final int SND_BLOCK_FREQ = 25;  //ブロック周波数(Hz)
    47:   public static final long SND_BLOCK_TIME = XEiJ.TMR_FREQ / SND_BLOCK_FREQ;  //1ブロックの時間(XEiJ.TMR_FREQ単位)
    48:   public static final int SND_BLOCK_SAMPLES = SND_SAMPLE_FREQ / SND_BLOCK_FREQ;  //1ブロックのサンプル数。882,1764,1920
    49:   public static final int SND_BLOCK_BYTES = SND_BLOCK_SAMPLES << SND_SAMPLE_SHIFT;  //1ブロックのバイト数
    50: 
    51:   //周波数変換
    52:   //  線形補間
    53:   //    62500Hzのサンプリングデータを線形補間したものを22050Hzまたは44100Hzまたは48000Hzのサンプリング間隔でサンプリングし直す
    54:   //
    55:   //    入力周波数=13Hz,出力周波数=10Hzのとき
    56:   //    aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgggggggggghhhhhhhhhhiiiiiiiiiijjjjjjjjjj 入力データ
    57:   //         01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 サンプリング位置の端数
    58:   //         0            1            2            3            4            5            6            7    サンプリング位置
    59:   //        a*10       b*7+c*3      c*4+d*6      d*1+e*9      f*8+g*2      g*5+h*5      h*2+i*8      j*9+k*1 出力データ
    60:   //
    61:   public static final boolean SND_FREQ_TABLE = true;  //true=規定の周波数で出力するとき周波数変換テーブルを使う
    62:   public static final boolean SND_INTERPOLATION_ON = true;  //true=62500Hzから規定の周波数に変換するとき線形補間を行う
    63:   public static final int SND_INTERPOLATION_BIT = 8;  //線形補間の分解能。前後のデータに掛ける比率の合計のlog2。入力データが符号付き16bitに収まっていれば15以下だが溢れているとき割れてしまうので小さめにしておく
    64:   public static final int[] sndFreqConvIndex = new int[SND_BLOCK_SAMPLES];  //周波数変換のインデックス。0~YM2151.OPM_BLOCK_SAMPLES-1(2500-1)
    65:   public static final int[] sndFreqConvFraction = new int[SND_BLOCK_SAMPLES];  //周波数変換の端数。0~(1<<SND_INTERPOLATION_BIT)-1
    66:   public static SNDRateConverter sndRateConverter;  //サンプリング周波数変換アルゴリズムの選択
    67: 
    68:   //バッファ
    69:   //  バッファを大きくしすぎると音声の遅延(画面とのずれ)が大きくなる
    70:   public static final int SND_BUFFER_SAMPLES = SND_BLOCK_SAMPLES * 3;  //バッファのサンプル数。ブロックの3倍
    71:   public static final int SND_BUFFER_BYTES = SND_BUFFER_SAMPLES << SND_SAMPLE_SHIFT;
    72:   public static final byte[] sndByteBlock = new byte[SND_BUFFER_BYTES];  //ブロックのbyte配列
    73: 
    74:   //タイマー
    75:   public static long sndBlockClock;  //次のブロックを出力する時刻。再生中はSND_BLOCK_TIMEずつ増える。再生開始時刻はSND_BLOCK_TIMEの倍数とは限らない
    76: 
    77:   //エンディアン制御
    78:   //  デフォルトはリトルエンディアン
    79:   //  ByteBufferでエンディアンを制御するときはネイティブのエンディアンになる
    80:   public static final boolean SND_BYTE_BUFFER_ENDIAN = false;  //true=ByteBufferでエンディアンを制御する
    81:   public static ByteOrder sndNativeEndian;  //ネイティブのエンディアン
    82:   public static short[] sndShortBlock;  //ブロックのshort配列
    83:   public static ByteBuffer sndByteBuffer;  //sndByteBlockをラップしたByteBuffer
    84:   public static ShortBuffer sndShortBuffer;  //sndByteBlockをラップしたShortBuffer
    85: 
    86:   //ボリュームコントロール
    87:   //  スピーカに負荷をかけたくないので2倍を上限とする
    88:   //  デフォルトは0.5倍
    89:   //  ボリュームを変更するとき、瞬時に変えるとプチノイズが出るので段階的に変える
    90:   public static final int SND_VOLUME_MAX = 40;  //8倍
    91:   public static final int SND_VOLUME_DEFAULT = 20;  //0.5倍
    92:   public static final int SND_VOLUME_STEP = 5;  //2倍になる差分
    93:   public static int sndVolume;  //ボリュームの設定値。5=1/16倍,10=1/8倍,15=1/4倍,20=1/2倍,25=1倍,30=2倍,35=4倍,40=8倍
    94:   public static int sndCurrentScale;  //ボリュームの現在のスケール。1倍は4096に固定。256=1/16倍,512=1/8倍,1024=1/4倍,2048=1/2倍,4096=1倍,8192=2倍,16384=4倍,32768=8倍
    95:   public static int sndTargetScale;  //ボリュームの変更後のスケール
    96: 
    97:   //ゼロレベルシフト
    98:   //  OPMとPCMの合成後のデータが範囲外のときゼロレベルをシフトしてなるべく音が割れないようにする
    99:   //  PCMを12ビットでマスクする必要があることに変わりはない
   100:   public static final boolean SND_ZERO_LEVEL_SHIFT = false;
   101:   public static int sndAdaptiveShiftM;
   102:   public static int sndAdaptiveShiftL;
   103:   public static int sndAdaptiveShiftR;
   104: 
   105:   //ライン出力
   106:   public static final TickerQueue.Ticker sndBlockTicker = new TickerQueue.Ticker () {
   107:     @Override protected void tick () {
   108:       //OPMのバッファを充填する
   109:       if (YM2151.opmPointer < SND_CHANNELS * YM2151.OPM_BLOCK_SAMPLES) {
   110:         YM2151.opmUpdate (SND_CHANNELS * YM2151.OPM_BLOCK_SAMPLES);
   111:       }
   112:       YM2151.opmPointer = 0;
   113:       //PCMのバッファを充填する
   114:       if (ADPCM.pcmPointer < SND_CHANNELS * ADPCM.PCM_BLOCK_SAMPLES) {
   115:         ADPCM.pcmFillBuffer (SND_CHANNELS * ADPCM.PCM_BLOCK_SAMPLES);
   116:       }
   117:       if ((sndTargetScale | sndCurrentScale) != 0) {  //フェードインとフェードアウトの両方が必要。0以上なのでまとめてテストする
   118:         int outputSamples = SND_BLOCK_SAMPLES;
   119:         //周波数変換
   120:         (SND_FREQ_TABLE && outputSamples == SND_BLOCK_SAMPLES ? sndRateConverter : SNDRateConverter.ADAPTIVE).convert (outputSamples);
   121:         //ラインに出力する
   122:         //  sndLine.available()はバッファアンダーランが起きたとき0を返すことがある
   123:         //  ラインがダミーのデータで充填されているのかも知れない
   124:         //  その状態で出力しようとすると待たされるのでコアと音声出力の両方が止まってしまう
   125:         //  音声出力が止まるのは避けられないがコアを止めたくないので、
   126:         //  sndLine.available()が0を返したときは出力をキャンセルする
   127:         if (sndLine.available () != 0) {
   128:           try {
   129:             long t = System.nanoTime ();
   130:             sndLine.write (sndByteBlock, 0, outputSamples << SND_SAMPLE_SHIFT);
   131:             Indicator.indTotalNano -= System.nanoTime () - t;  //ラインへの出力にかかった時間をコアが消費した時間から除く
   132:           } catch (Exception e) {
   133:           }
   134:         }
   135:       }
   136:       //PCMの出力ポインタを巻き戻す
   137:       //  はみ出している部分を先頭にコピーするので周波数変換の前に行えない
   138:       ADPCM.pcmPointer = Math.max (0, ADPCM.pcmPointer - SND_CHANNELS * ADPCM.PCM_BLOCK_SAMPLES);
   139:       for (int i = 0; i < ADPCM.pcmPointer; i++) {
   140:         ADPCM.pcmBuffer[i] = ADPCM.pcmBuffer[i + SND_CHANNELS * ADPCM.PCM_BLOCK_SAMPLES];
   141:       }
   142:       //PCMの原発振周波数の切り替えを行う
   143:       if (ADPCM.pcmOSCFreqMode != ADPCM.pcmOSCFreqRequest) {
   144:         ADPCM.pcmOSCFreqMode = ADPCM.pcmOSCFreqRequest;
   145:         ADPCM.pcmUpdateRepeatInterval ();
   146:       }
   147:       //音声モニタを更新する
   148:       if (SoundMonitor.smnIsVisible) {
   149:         SoundMonitor.smnUpdate ();
   150:       }
   151:       //Arrays.fill (ADPCM.pcmBuffer, ADPCM.pcmPointer, SND_CHANNELS * (ADPCM.PCM_BLOCK_SAMPLES + ADPCM.PCM_MAX_REPEAT * 2 - 1), 0);
   152:       //次の割り込み時刻を設定する
   153:       sndBlockClock += SND_BLOCK_TIME;
   154:       TickerQueue.tkqAdd (sndBlockTicker, sndBlockClock);
   155:     }
   156:   };
   157: 
   158:   //タイマAオーバーフロー
   159:   public static final TickerQueue.Ticker sndOpmATicker = new TickerQueue.Ticker () {
   160:     @Override protected void tick () {
   161:       //次の割り込み時刻を設定する
   162:       YM2151.opmClockA += YM2151.opmIntervalA;
   163:       TickerQueue.tkqAdd (sndOpmATicker, YM2151.opmClockA);
   164:       //設定に応じてMFPに割り込み要求を出す
   165:       if (YM2151.opmIRQENA) {
   166:         YM2151.opmISTA = YM2151.OPM_ISTA;
   167:         MC68901.mfpOpmirqFall ();
   168:       }
   169:       if (YM2151.opmCSMOn) {  //全スロットキーON
   170:         //除算の負荷を軽減するためYM2151.opmPointerを進める必要があるかどうかを先に確認する
   171:         if (sndBlockClock - SND_BLOCK_TIME + YM2151.OPM_SAMPLE_TIME / SND_CHANNELS * YM2151.opmPointer < XEiJ.mpuClockTime) {
   172:           //現在のブロックの残り時間が1サンプルの時間の倍数になるように切り上げる
   173:           YM2151.opmUpdate (SND_CHANNELS * (YM2151.OPM_BLOCK_SAMPLES - Math.max (0, (int) ((double) (sndBlockClock - XEiJ.mpuClockTime) / (double) YM2151.OPM_SAMPLE_TIME))));
   174:         }
   175:         YM2151.opmCSMRequest = 1;
   176:       }
   177:     }
   178:   };
   179: 
   180:   //タイマBオーバーフロー
   181:   public static final TickerQueue.Ticker sndOpmBTicker = new TickerQueue.Ticker () {
   182:     @Override protected void tick () {
   183:       //次の割り込み時刻を設定する
   184:       YM2151.opmClockB += YM2151.opmIntervalB;
   185:       TickerQueue.tkqAdd (sndOpmBTicker, YM2151.opmClockB);
   186:       //設定に応じてMFPに割り込み要求を出す
   187:       if (YM2151.opmIRQENB) {
   188:         YM2151.opmISTB = YM2151.OPM_ISTB;
   189:         MC68901.mfpOpmirqFall ();
   190:       }
   191:     }
   192:   };
   193: 
   194:   //PCM出力
   195:   public static final TickerQueue.Ticker sndPcmTicker = new TickerQueue.Ticker () {
   196:     @Override protected void tick () {
   197:       if (ADPCM.pcmEncodedData >= 0) {  //有効なPCMデータがあるとき
   198:         //PCMデータを引き取って変換テーブルの中を移動する
   199:         //  補間したときに中間の値を取れるようにするためにデータを4bitシフトする
   200:         int decoded = (ADPCM.PCM_MODIFY_ZERO_ZERO && (!ADPCM.PCM_MODIFY_ZERO_TWICE || ADPCM.pcmEncodedData == ADPCM.pcmZeroPreviousData) ?
   201:                        ADPCM.pcmDecodedData1 >= 0 ? ADPCM.pcmDecoderTableP : ADPCM.pcmDecoderTableM :
   202:                        ADPCM.pcmDecoderTable)[ADPCM.pcmDecoderPointer << 8 | ADPCM.pcmEncodedData];  //下位の差分<<19|(上位の差分&8191)<<6|次の予測指標
   203:         int delta1 = decoded       >> -13 << 4;  //下位の差分(符号あり13bit)
   204:         int delta2 = decoded << 13 >> -13 << 4;  //上位の差分(符号あり13bit)
   205:         ADPCM.pcmDecoderPointer = decoded & 63;  //次の予測指標(符号なし6bit)
   206:         if (ADPCM.PCM_MODIFY_ZERO_ZERO && ADPCM.PCM_MODIFY_ZERO_TWICE) {
   207:           ADPCM.pcmZeroPreviousData = ADPCM.pcmEncodedData == 0x00 || ADPCM.pcmEncodedData == 0x88 ? ADPCM.pcmEncodedData : -1;
   208:         }
   209:         ADPCM.pcmEncodedData = -1;
   210:         if (false) {  //下位4bitの飽和処理を行わない
   211:           //  クリッピングの範囲が0x8000..0x7ff0ではなく0x8000..0x7fffになる
   212:           int m = ADPCM.pcmDecodedData1 + delta1;
   213:           ADPCM.pcmInterpolationEngine.write ((short) m == m ? m : (m = m >> -1 ^ 32767));
   214:           m += delta2;
   215:           ADPCM.pcmInterpolationEngine.write ((short) m == m ? m :      m >> -1 ^ 32767);
   216:         } else {  //本来の範囲でクリッピングを行う
   217:           int m;
   218:           ADPCM.pcmInterpolationEngine.write (m = Math.max (-2048 << 4, Math.min (2047 << 4, ADPCM.pcmDecodedData1 + delta1)));
   219:           ADPCM.pcmInterpolationEngine.write (    Math.max (-2048 << 4, Math.min (2047 << 4, m               + delta2)));
   220:         }
   221:       } else {  //有効なPCMデータがないとき
   222:         int m = ADPCM.pcmDecodedData1;
   223:         if (ADPCM.PCM_DECAY_ON) {  //減衰させる
   224:           ADPCM.pcmInterpolationEngine.write (m += (m >>> 31) - (-m >>> 31));
   225:           ADPCM.pcmInterpolationEngine.write (m +  (m >>> 31) - (-m >>> 31));
   226:         } else {  //同じデータを繰り返す
   227:           ADPCM.pcmInterpolationEngine.write (m);
   228:           ADPCM.pcmInterpolationEngine.write (m);
   229:         }
   230:       }
   231:       //次の割り込み時刻を設定する
   232:       ADPCM.pcmClock += ADPCM.pcmInterval;
   233:       TickerQueue.tkqAdd (sndPcmTicker, ADPCM.pcmClock);
   234:       //DMAに次のデータを要求する
   235:       HD63450.dmaFallPCL (3);
   236:     }
   237:   };
   238: 
   239:   //sndInit ()
   240:   //  サウンドを初期化する
   241:   public static void sndInit () {
   242:     //ソースデータライン
   243:     sndNativeEndian = ByteOrder.nativeOrder ();
   244:     if (SND_ON) {
   245:       try {
   246:         AudioFormat audioFormat = new AudioFormat ((float) SND_SAMPLE_FREQ,
   247:                                                    16,
   248:                                                    SND_CHANNELS,
   249:                                                    true,
   250:                                                    SND_BYTE_BUFFER_ENDIAN ? sndNativeEndian == ByteOrder.BIG_ENDIAN : false);
   251:         //sndLine = (SourceDataLine) (AudioSystem.getLine (new DataLine.Info (SourceDataLine.class, audioFormat)));
   252:         sndLine = AudioSystem.getSourceDataLine (audioFormat);  //AudioSystem.getSourceDataLine()は1.5から
   253:         sndLine.open (audioFormat, SND_BUFFER_BYTES);
   254:         sndLine.start ();
   255:       } catch (Exception e) {
   256:         sndLine = null;  //出力不可
   257:         sndPlayOn = false;
   258:       }
   259:     } else {
   260:       sndLine = null;  //出力不可
   261:       sndPlayOn = false;
   262:     }
   263:     //ブロック
   264:     //sndByteBlock = new byte[SND_BUFFER_BYTES];
   265:     if (SND_BYTE_BUFFER_ENDIAN) {
   266:       //エンディアン制御
   267:       sndShortBlock = new short[SND_CHANNELS * SND_BUFFER_SAMPLES];
   268:       sndByteBuffer = ByteBuffer.wrap (sndByteBlock);
   269:       sndByteBuffer.order (sndNativeEndian);
   270:       sndShortBuffer = sndByteBuffer.asShortBuffer ();
   271:     }
   272:     //周波数変換
   273:     if (SND_FREQ_TABLE) {
   274:       //sndFreqConvIndex = new int[SND_BLOCK_SAMPLES];
   275:       for (int i = 0; i < SND_BLOCK_SAMPLES; i++) {
   276:         if (!SND_INTERPOLATION_ON) {  //間引き
   277:           sndFreqConvIndex[i] = SND_CHANNELS * i * YM2151.OPM_BLOCK_SAMPLES / SND_BLOCK_SAMPLES;
   278:         } else {  //線形補間
   279:           int t = i * YM2151.OPM_BLOCK_SAMPLES;  //0~(882-1)*62500,(1764-1)*62500,(1920-1)*62500
   280:           int q = t / SND_BLOCK_SAMPLES;  //サンプリング位置。入力周波数の62500Hzよりも出力周波数の22050Hz,44100Hz,48000Hzの方が小さく、サンプリング位置の最大値が2498になるため、インデックスに1を加えても溢れない
   281:           sndFreqConvIndex[i] = SND_CHANNELS * q;  //インデックス
   282:           sndFreqConvFraction[i] = (t - q * SND_BLOCK_SAMPLES << SND_INTERPOLATION_BIT) / SND_BLOCK_SAMPLES;  //端数
   283:         }
   284:       }
   285:     }
   286:     //sndRateConverter = SND_CHANNELS == 1 ? SNDRateConverter.LINEAR_MONO : SNDRateConverter.LINEAR_STEREO;  //線形補間
   287:     //ボリュームコントロール
   288:     sndCurrentScale = 0;
   289:     sndTargetScale = sndPlayOn && sndVolume > 0 ? (int) (Math.pow (2.0, 12 - 1 + (double) (sndVolume - SND_VOLUME_DEFAULT) / SND_VOLUME_STEP) + 0.5) : 0;
   290:     if (SND_ZERO_LEVEL_SHIFT) {
   291:       //ゼロレベルシフト
   292:       if (SND_CHANNELS == 1) {  //モノラル
   293:         sndAdaptiveShiftM = 0;
   294:       } else {  //ステレオ
   295:         sndAdaptiveShiftL = 0;
   296:         sndAdaptiveShiftR = 0;
   297:       }
   298:     }
   299:   }  //sndInit
   300: 
   301:   //sndTini ()
   302:   //  サウンドの後始末
   303:   //  ラインを閉じる
   304:   public static void sndTini () {
   305:     if (sndLine != null) {
   306:       sndLine.stop ();
   307:       sndLine.close ();
   308:     }
   309:   }  //sndTini()
   310: 
   311:   //sndStart ()
   312:   //  サウンドの動作を開始する
   313:   public static void sndStart () {
   314:     sndReset ();
   315:     YM2151.opmReset ();
   316:     ADPCM.pcmReset ();
   317:   }  //sndStart
   318: 
   319:   //リセット
   320:   public static void sndReset () {
   321:     YM2151.opmClockA = XEiJ.FAR_FUTURE;
   322:     YM2151.opmClockB = XEiJ.FAR_FUTURE;
   323:     ADPCM.pcmClock = XEiJ.FAR_FUTURE;
   324:     sndBlockClock = XEiJ.mpuClockTime + SND_BLOCK_TIME;
   325:     TickerQueue.tkqRemove (sndOpmATicker);
   326:     TickerQueue.tkqRemove (sndOpmBTicker);
   327:     TickerQueue.tkqRemove (sndPcmTicker);
   328:     TickerQueue.tkqAdd (sndBlockTicker, sndBlockClock);
   329:   }  //sndReset
   330: 
   331:   //sndSetPlayOn (mode)
   332:   //  音声出力
   333:   public static void sndSetPlayOn (boolean on) {
   334:     if (sndLine != null && sndPlayOn != on) {
   335:       sndPlayOn = on;
   336:       sndSetVolume (sndVolume);
   337:       //コアが動いていたら再起動する
   338:       if (XEiJ.mpuTask != null) {
   339:         XEiJ.mpuStart ();
   340:       }
   341:     }
   342:   }  //sndSetPlayOn(boolean)
   343: 
   344:   //sndSetVolume (volume)
   345:   //  音量
   346:   public static void sndSetVolume (int volume) {
   347:     sndVolume = Math.max (0, Math.min (SND_VOLUME_MAX, volume));
   348:     sndTargetScale = sndPlayOn && sndVolume > 0 ? (int) (Math.pow (2.0, 12 - 1 + (double) (sndVolume - SND_VOLUME_DEFAULT) / SND_VOLUME_STEP) + 0.5) : 0;
   349:     if (XEiJ.mnbVolumeLabel != null) {
   350:       XEiJ.mnbVolumeLabel.setText (String.valueOf (sndVolume));
   351:     }
   352:   }  //sndSetVolume(int)
   353: 
   354: 
   355: 
   356:   //enum SNDRateConverter
   357:   //  サンプリング周波数変換
   358:   //  入力サンプリング周波数と出力サンプリング周波数が両方高いとどの変換も同じように聞こえる
   359:   public static enum SNDRateConverter {
   360: 
   361:     //規定の周波数で出力しないとき
   362:     ADAPTIVE {
   363:       @Override public void convert (int outputSamples) {
   364:         final int inputSamples = YM2151.OPM_BLOCK_SAMPLES;
   365:         int src = 0;
   366:         int dst = 0;
   367:         int balance = (inputSamples >> 1) - outputSamples;
   368:         if (balance >= 0) {
   369:           do {
   370:             src++;
   371:           } while ((balance -= outputSamples) >= 0);
   372:         }
   373:       outputLoop:
   374:         for (;;) {
   375:           if (SND_CHANNELS == 1) {  //モノラル
   376:             int m = (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src] + ADPCM.pcmBuffer[src] :
   377:                      YM2151.OPM_ON           ? YM2151.opmBuffer[src]                  :
   378:                      ADPCM.PCM_ON           ?                  ADPCM.pcmBuffer[src] :
   379:                      0) * sndCurrentScale >> 12;
   380:             if (SND_ZERO_LEVEL_SHIFT) {  //ゼロレベルシフトあり
   381:               m += sndAdaptiveShiftM;
   382:               if ((short) m != m) {  //オーバーフローしたとき
   383:                 int t = m >> 31 ^ 0x7fff;
   384:                 sndAdaptiveShiftM -= m - t;
   385:                 m = t;
   386:               }
   387:               sndAdaptiveShiftM += (sndAdaptiveShiftM >>> 31) - (-sndAdaptiveShiftM >>> 31);
   388:             } else {  //ゼロレベルシフトなし
   389:               m = XEiJ.SHORT_SATURATION_CAST ? (short) m == m ? m : m >> 31 ^ 32767 : Math.max (-32768, Math.min (32767, m));
   390:             }
   391:             do {
   392:               if (SND_BYTE_BUFFER_ENDIAN) {  //ByteBufferでエンディアンを制御するとき
   393:                 sndShortBlock[dst] = (short) m;
   394:               } else {  //ByteBufferでエンディアンを制御しないとき
   395:                 int dst2 = dst << 1;
   396:                 sndByteBlock[dst2    ] = (byte) m;
   397:                 sndByteBlock[dst2 + 1] = (byte) (m >> 8);
   398:               }
   399:               sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   400:               dst++;
   401:               if (dst >= outputSamples) {
   402:                 break outputLoop;
   403:               }
   404:             } while ((balance += inputSamples) < 0);
   405:           } else {  //ステレオ
   406:             int src2 = src << 1;
   407:             int l = (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src2    ] + ADPCM.pcmBuffer[src2    ] :
   408:                      YM2151.OPM_ON           ? YM2151.opmBuffer[src2    ]                       :
   409:                      ADPCM.PCM_ON           ?                       ADPCM.pcmBuffer[src2    ] :
   410:                      0) * sndCurrentScale >> 12;
   411:             int r = (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src2 + 1] + ADPCM.pcmBuffer[src2 + 1] :
   412:                      YM2151.OPM_ON           ? YM2151.opmBuffer[src2 + 1]                       :
   413:                      ADPCM.PCM_ON           ?                       ADPCM.pcmBuffer[src2 + 1] :
   414:                      0) * sndCurrentScale >> 12;
   415:             if (SND_ZERO_LEVEL_SHIFT) {  //ゼロレベルシフトあり
   416:               l += sndAdaptiveShiftL;
   417:               r += sndAdaptiveShiftR;
   418:               if ((short) l != l) {  //オーバーフローしたとき
   419:                 int t = l >> 31 ^ 0x7fff;
   420:                 sndAdaptiveShiftL -= l - t;
   421:                 l = t;
   422:               }
   423:               if ((short) r != r) {  //オーバーフローしたとき
   424:                 int t = r >> 31 ^ 0x7fff;
   425:                 sndAdaptiveShiftR -= r - t;
   426:                 r = t;
   427:               }
   428:               sndAdaptiveShiftL += (sndAdaptiveShiftL >>> 31) - (-sndAdaptiveShiftL >>> 31);
   429:               sndAdaptiveShiftR += (sndAdaptiveShiftR >>> 31) - (-sndAdaptiveShiftR >>> 31);
   430:             } else {  //ゼロレベルシフトなし
   431:               l = XEiJ.SHORT_SATURATION_CAST ? (short) l == l ? l : l >> 31 ^ 32767 : Math.max (-32768, Math.min (32767, l));
   432:               r = XEiJ.SHORT_SATURATION_CAST ? (short) r == r ? r : r >> 31 ^ 32767 : Math.max (-32768, Math.min (32767, r));
   433:             }
   434:             do {
   435:               if (SND_BYTE_BUFFER_ENDIAN) {  //ByteBufferでエンディアンを制御するとき
   436:                 int dst2 = dst << 1;
   437:                 sndShortBlock[dst2    ] = (short) l;
   438:                 sndShortBlock[dst2 + 1] = (short) r;
   439:               } else {  //ByteBufferでエンディアンを制御しないとき
   440:                 int dst4 = dst << 2;
   441:                 sndByteBlock[dst4    ] = (byte) l;
   442:                 sndByteBlock[dst4 + 1] = (byte) (l >> 8);
   443:                 sndByteBlock[dst4 + 2] = (byte) r;
   444:                 sndByteBlock[dst4 + 3] = (byte) (r >> 8);
   445:               }
   446:               sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   447:               dst++;
   448:               if (dst >= outputSamples) {
   449:                 break outputLoop;
   450:               }
   451:             } while ((balance += inputSamples) < 0);
   452:           }  //if モノラル/ステレオ
   453:           do {
   454:             src++;
   455:           } while ((balance -= outputSamples) >= 0);
   456:         }  //outputLoop
   457:         if (SND_BYTE_BUFFER_ENDIAN) {  //ByteBufferでエンディアンを制御するとき
   458:           //sndByteBlockにsndShortBlockを上書きする
   459:           sndShortBuffer.rewind ();
   460:           sndShortBuffer.put (sndShortBlock, 0, outputSamples << SND_SAMPLE_SHIFT - 1);
   461:         }
   462:       }  //convert(int)
   463:     },  //SNDRateConverter.ADAPTIVE
   464: 
   465:     //間引き,モノラル
   466:     THINNING_MONO {
   467:       @Override public void convert (int outputSamples) {
   468:         for (int dst = 0; dst < SND_BLOCK_SAMPLES; dst++) {
   469:           int src = sndFreqConvIndex[dst];
   470:           int m = (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src] + ADPCM.pcmBuffer[src] :
   471:                    YM2151.OPM_ON           ? YM2151.opmBuffer[src]                  :
   472:                    ADPCM.PCM_ON           ?                  ADPCM.pcmBuffer[src] :
   473:                    0) * sndCurrentScale >> 12;
   474:           if (SND_ZERO_LEVEL_SHIFT) {  //ゼロレベルシフトあり
   475:             m += sndAdaptiveShiftM;
   476:             if ((short) m != m) {  //オーバーフローしたとき
   477:               int t = m >> 31 ^ 0x7fff;
   478:               sndAdaptiveShiftM -= m - t;
   479:               m = t;
   480:             }
   481:             sndAdaptiveShiftM += (sndAdaptiveShiftM >>> 31) - (-sndAdaptiveShiftM >>> 31);
   482:           } else {  //ゼロレベルシフトなし
   483:             m = XEiJ.SHORT_SATURATION_CAST ? (short) m == m ? m : m >> 31 ^ 32767 : Math.max (-32768, Math.min (32767, m));
   484:           }
   485:           if (SND_BYTE_BUFFER_ENDIAN) {  //ByteBufferでエンディアンを制御するとき
   486:             sndShortBlock[dst] = (short) m;
   487:           } else {  //ByteBufferでエンディアンを制御しないとき
   488:             int dst2 = dst << 1;
   489:             sndByteBlock[dst2    ] = (byte) m;
   490:             sndByteBlock[dst2 + 1] = (byte) (m >> 8);
   491:           }
   492:           sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   493:         }  //for dst
   494:         if (SND_BYTE_BUFFER_ENDIAN) {  //ByteBufferでエンディアンを制御するとき
   495:           //sndByteBlockにsndShortBlockを上書きする
   496:           sndShortBuffer.rewind ();
   497:           sndShortBuffer.put (sndShortBlock, 0, outputSamples << SND_SAMPLE_SHIFT - 1);
   498:         }
   499:       }  //convert(int)
   500:     },  //SNDRateConverter.THINNING_MONO
   501: 
   502:     //間引き,ステレオ
   503:     THINNING_STEREO {
   504:       @Override public void convert (int outputSamples) {
   505:         for (int dst = 0; dst < SND_BLOCK_SAMPLES; dst++) {
   506:           int src = sndFreqConvIndex[dst];
   507:           int l = (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src    ] + ADPCM.pcmBuffer[src    ] :
   508:                    YM2151.OPM_ON           ? YM2151.opmBuffer[src    ]                      :
   509:                    ADPCM.PCM_ON           ?                      ADPCM.pcmBuffer[src    ] :
   510:                    0) * sndCurrentScale >> 12;
   511:           int r = (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src + 1] + ADPCM.pcmBuffer[src + 1] :
   512:                    YM2151.OPM_ON           ? YM2151.opmBuffer[src + 1]                      :
   513:                    ADPCM.PCM_ON           ?                      ADPCM.pcmBuffer[src + 1] :
   514:                    0) * sndCurrentScale >> 12;
   515:           if (SND_ZERO_LEVEL_SHIFT) {  //ゼロレベルシフトあり
   516:             l += sndAdaptiveShiftL;
   517:             r += sndAdaptiveShiftR;
   518:             if ((short) l != l) {  //オーバーフローしたとき
   519:               int t = l >> 31 ^ 0x7fff;
   520:               sndAdaptiveShiftL -= l - t;
   521:               l = t;
   522:             }
   523:             if ((short) r != r) {  //オーバーフローしたとき
   524:               int t = r >> 31 ^ 0x7fff;
   525:               sndAdaptiveShiftR -= r - t;
   526:               r = t;
   527:             }
   528:             sndAdaptiveShiftL += (sndAdaptiveShiftL >>> 31) - (-sndAdaptiveShiftL >>> 31);
   529:             sndAdaptiveShiftR += (sndAdaptiveShiftR >>> 31) - (-sndAdaptiveShiftR >>> 31);
   530:           } else {  //ゼロレベルシフトなし
   531:             l = XEiJ.SHORT_SATURATION_CAST ? (short) l == l ? l : l >> 31 ^ 32767 : Math.max (-32768, Math.min (32767, l));
   532:             r = XEiJ.SHORT_SATURATION_CAST ? (short) r == r ? r : r >> 31 ^ 32767 : Math.max (-32768, Math.min (32767, r));
   533:           }
   534:           if (SND_BYTE_BUFFER_ENDIAN) {  //ByteBufferでエンディアンを制御するとき
   535:             int dst2 = dst << 1;
   536:             sndShortBlock[dst2    ] = (short) l;
   537:             sndShortBlock[dst2 + 1] = (short) r;
   538:           } else {  //ByteBufferでエンディアンを制御しないとき
   539:             int dst4 = dst << 2;
   540:             sndByteBlock[dst4    ] = (byte) l;
   541:             sndByteBlock[dst4 + 1] = (byte) (l >> 8);
   542:             sndByteBlock[dst4 + 2] = (byte) r;
   543:             sndByteBlock[dst4 + 3] = (byte) (r >> 8);
   544:           }
   545:           sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   546:         }  //for dst
   547:         if (SND_BYTE_BUFFER_ENDIAN) {  //ByteBufferでエンディアンを制御するとき
   548:           //sndByteBlockにsndShortBlockを上書きする
   549:           sndShortBuffer.rewind ();
   550:           sndShortBuffer.put (sndShortBlock, 0, outputSamples << SND_SAMPLE_SHIFT - 1);
   551:         }
   552:       }  //convert(int)
   553:     },  //SNDRateConverter.THINNING_STEREO
   554: 
   555:     //線形補間,モノラル
   556:     LINEAR_MONO {
   557:       @Override public void convert (int outputSamples) {
   558:         for (int dst = 0; dst < SND_BLOCK_SAMPLES; dst++) {
   559:           int src = sndFreqConvIndex[dst];
   560:           int rat2 = sndFreqConvFraction[dst];
   561:           int rat1 = (1 << SND_INTERPOLATION_BIT) - rat2;
   562:           int m = ((YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src    ] + ADPCM.pcmBuffer[src    ] :
   563:                     YM2151.OPM_ON           ? YM2151.opmBuffer[src    ]                      :
   564:                     ADPCM.PCM_ON           ?                      ADPCM.pcmBuffer[src    ] :
   565:                     0) * rat1 +
   566:                    (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src + 1] + ADPCM.pcmBuffer[src + 1] :
   567:                     YM2151.OPM_ON           ? YM2151.opmBuffer[src + 1]                      :
   568:                     ADPCM.PCM_ON           ?                      ADPCM.pcmBuffer[src + 1] :
   569:                     0) * rat2 >> SND_INTERPOLATION_BIT) * sndCurrentScale >> 12;
   570:           if (SND_ZERO_LEVEL_SHIFT) {  //ゼロレベルシフトあり
   571:             m += sndAdaptiveShiftM;
   572:             if ((short) m != m) {  //オーバーフローしたとき
   573:               int t = m >> 31 ^ 0x7fff;
   574:               sndAdaptiveShiftM -= m - t;
   575:               m = t;
   576:             }
   577:             sndAdaptiveShiftM += (sndAdaptiveShiftM >>> 31) - (-sndAdaptiveShiftM >>> 31);
   578:           } else {  //ゼロレベルシフトなし
   579:             m = XEiJ.SHORT_SATURATION_CAST ? (short) m == m ? m : m >> 31 ^ 32767 : Math.max (-32768, Math.min (32767, m));
   580:           }
   581:           if (SND_BYTE_BUFFER_ENDIAN) {  //ByteBufferでエンディアンを制御するとき
   582:             sndShortBlock[dst] = (short) m;
   583:           } else {  //ByteBufferでエンディアンを制御しないとき
   584:             int dst2 = dst << 1;
   585:             sndByteBlock[dst2    ] = (byte) m;
   586:             sndByteBlock[dst2 + 1] = (byte) (m >> 8);
   587:           }
   588:           sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   589:         }  //for dst
   590:         if (SND_BYTE_BUFFER_ENDIAN) {  //ByteBufferでエンディアンを制御するとき
   591:           //sndByteBlockにsndShortBlockを上書きする
   592:           sndShortBuffer.rewind ();
   593:           sndShortBuffer.put (sndShortBlock, 0, outputSamples << SND_SAMPLE_SHIFT - 1);
   594:         }
   595:       }  //convert(int)
   596:     },  //SNDRateConverter.LINEAR_MONO
   597: 
   598:     //線形補間,ステレオ
   599:     LINEAR_STEREO {
   600:       @Override public void convert (int outputSamples) {
   601:         for (int dst = 0; dst < SND_BLOCK_SAMPLES; dst++) {
   602:           int src2 = sndFreqConvIndex[dst];
   603:           int rat2 = sndFreqConvFraction[dst];
   604:           int rat1 = (1 << SND_INTERPOLATION_BIT) - rat2;
   605:           int l = ((YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src2    ] + ADPCM.pcmBuffer[src2    ] :
   606:                     YM2151.OPM_ON           ? YM2151.opmBuffer[src2    ]                       :
   607:                     ADPCM.PCM_ON           ?                       ADPCM.pcmBuffer[src2    ] :
   608:                     0) * rat1 +
   609:                    (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src2 + 2] + ADPCM.pcmBuffer[src2 + 2] :
   610:                     YM2151.OPM_ON           ? YM2151.opmBuffer[src2 + 2]                       :
   611:                     ADPCM.PCM_ON           ?                       ADPCM.pcmBuffer[src2 + 2] :
   612:                     0) * rat2 >> SND_INTERPOLATION_BIT) * sndCurrentScale >> 12;
   613:           int r = ((YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src2 + 1] + ADPCM.pcmBuffer[src2 + 1] :
   614:                     YM2151.OPM_ON           ? YM2151.opmBuffer[src2 + 1]                       :
   615:                     ADPCM.PCM_ON           ?                       ADPCM.pcmBuffer[src2 + 1] :
   616:                     0) * rat1 +
   617:                    (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src2 + 3] + ADPCM.pcmBuffer[src2 + 3] :
   618:                     YM2151.OPM_ON           ? YM2151.opmBuffer[src2 + 3]                       :
   619:                     ADPCM.PCM_ON           ?                       ADPCM.pcmBuffer[src2 + 3] :
   620:                     0) * rat2 >> SND_INTERPOLATION_BIT) * sndCurrentScale >> 12;
   621:           if (SND_ZERO_LEVEL_SHIFT) {  //ゼロレベルシフトあり
   622:             l += sndAdaptiveShiftL;
   623:             r += sndAdaptiveShiftR;
   624:             if ((short) l != l) {  //オーバーフローしたとき
   625:               int t = l >> 31 ^ 0x7fff;
   626:               sndAdaptiveShiftL -= l - t;
   627:               l = t;
   628:             }
   629:             if ((short) r != r) {  //オーバーフローしたとき
   630:               int t = r >> 31 ^ 0x7fff;
   631:               sndAdaptiveShiftR -= r - t;
   632:               r = t;
   633:             }
   634:             sndAdaptiveShiftL += (sndAdaptiveShiftL >>> 31) - (-sndAdaptiveShiftL >>> 31);
   635:             sndAdaptiveShiftR += (sndAdaptiveShiftR >>> 31) - (-sndAdaptiveShiftR >>> 31);
   636:           } else {  //ゼロレベルシフトなし
   637:             l = XEiJ.SHORT_SATURATION_CAST ? (short) l == l ? l : l >> 31 ^ 32767 : Math.max (-32768, Math.min (32767, l));
   638:             r = XEiJ.SHORT_SATURATION_CAST ? (short) r == r ? r : r >> 31 ^ 32767 : Math.max (-32768, Math.min (32767, r));
   639:           }
   640:           if (SND_BYTE_BUFFER_ENDIAN) {  //ByteBufferでエンディアンを制御するとき
   641:             int dst2 = dst << 1;
   642:             sndShortBlock[dst2    ] = (short) l;
   643:             sndShortBlock[dst2 + 1] = (short) r;
   644:           } else {  //ByteBufferでエンディアンを制御しないとき
   645:             int dst4 = dst << 2;
   646:             sndByteBlock[dst4    ] = (byte) l;
   647:             sndByteBlock[dst4 + 1] = (byte) (l >> 8);
   648:             sndByteBlock[dst4 + 2] = (byte) r;
   649:             sndByteBlock[dst4 + 3] = (byte) (r >> 8);
   650:           }
   651:           sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   652:         }  //for dst
   653:         if (SND_BYTE_BUFFER_ENDIAN) {  //ByteBufferでエンディアンを制御するとき
   654:           //sndByteBlockにsndShortBlockを上書きする
   655:           sndShortBuffer.rewind ();
   656:           sndShortBuffer.put (sndShortBlock, 0, outputSamples << SND_SAMPLE_SHIFT - 1);
   657:         }
   658:       }  //convert(int)
   659:     },  //SNDRateConverter.LINEAR_STEREO
   660: 
   661:     //区分定数面積補間
   662:     //  入力データを区分定数補間した波形を出力サンプリング間隔で刻み、各断片の平均の変位(断片の面積に比例する)を出力データとする
   663:     //  出力周波数が入力周波数の1/2倍~1倍のとき、1個の出力データを求めるために2個または3個の入力データが必要になる
   664:     //  7Hz→5Hzの場合
   665:     //    aaaaabbbbbcccccdddddeeeeefffffggggg
   666:     //    AAAAAAABBBBBBBCCCCCCCDDDDDDDEEEEEEE
   667:     //      A=(5*a+2*b)/7
   668:     //      B=(3*b+4*c)/7
   669:     //      C=(1*c+5*d+1*e)/7
   670:     //      D=(4*e+3*f)/7
   671:     //      E=(2*f+5*g)/7
   672:     //    perl -e "$m=7;$n=5;$k=0;for$i(0..$n-1){$j0=int($i*$m/$n);$c0=$n-$i*$m+$j0*$n;$c1=$m-$c0;if($c1>$n){$c2=$c1-$n;$c1=$n}elsif($c0<=$c1){$c2=0}else{$c2=$c1;$c1=$c0;$c0=0;$j0--}printf'    //      d[%2d] = (',$i;if($c0){if($c0==1){print'    '}else{printf'%2d *',$c0};printf' s[%3d] +',$j0}else{print'             '};printf' %2d * s[%3d] ',$c1,$j0+1;if($c2){print'+ ';if($c2==1){print'    '}else{printf'%2d *',$c2};printf' s[%3d]',$j0+2}else{print'             '};printf') / %d;%c',$m,10}"
   673:     //      d[ 0] = (               5 * s[  0] +  2 * s[  1]) / 7;
   674:     //      d[ 1] = ( 3 * s[  1] +  4 * s[  2]              ) / 7;
   675:     //      d[ 2] = (     s[  2] +  5 * s[  3] +      s[  4]) / 7;
   676:     //      d[ 3] = (               4 * s[  4] +  3 * s[  5]) / 7;
   677:     //      d[ 4] = ( 2 * s[  5] +  5 * s[  6]              ) / 7;
   678: 
   679:     //区分定数面積補間,ステレオ,48kHz
   680:     CONSTANT_AREA_STEREO_48000 {
   681:       @Override public void convert (int outputSamples) {
   682:         //OPMとPCMを合わせてボリュームを掛ける
   683:         for (int src = 0; src < 2 * YM2151.OPM_BLOCK_SAMPLES; src += 2) {
   684:           YM2151.opmBuffer[src    ] = (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src    ] + ADPCM.pcmBuffer[src    ] :
   685:                                 YM2151.OPM_ON           ? YM2151.opmBuffer[src    ]                      :
   686:                                 ADPCM.PCM_ON           ?                      ADPCM.pcmBuffer[src    ] :
   687:                                 0) * sndCurrentScale >> 12;
   688:           YM2151.opmBuffer[src + 1] = (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src + 1] + ADPCM.pcmBuffer[src + 1] :
   689:                                 YM2151.OPM_ON           ? YM2151.opmBuffer[src + 1]                      :
   690:                                 ADPCM.PCM_ON           ?                      ADPCM.pcmBuffer[src + 1] :
   691:                                 0) * sndCurrentScale >> 12;
   692:         }
   693:         //区分定数面積補間
   694:         //  通分したときの分母は125だが、125≒128=1<<7なので、125で割る代わりに右7bitシフトで済ませている
   695:         //  本来の値よりもわずかに小さい値(125/128倍)が出力される
   696:         for (int src = 0, dst = 0; src < 2 * YM2151.OPM_BLOCK_SAMPLES; src += 2 * 125, dst += 4 * 96) {
   697:           int l, r;
   698:                 //  perl -e "$m=125;$n=96;$k=0;for$i(0..$n-1){$j0=int($i*$m/$n);$c0=$n-$i*$m+$j0*$n;$c1=$m-$c0;if($c1>$n){$c2=$c1-$n;$c1=$n}elsif($c0<=$c1){$c2=0}else{$c2=$c1;$c1=$c0;$c0=0;$j0--}printf'%16sl = Math.max (-32768, Math.min (32767, ','',$i;if($c0){if($c0==1){print'    '}else{printf'%2d *',$c0};printf' YM2151.opmBuffer[src + %3d] +',$j0<<1|0}else{printf'%27s',''};printf' %2d * YM2151.opmBuffer[src + %3d] ',$c1,$j0+1<<1|0;if($c2){print'+ ';if($c2==1){print'    '}else{printf'%2d *',$c2};printf' YM2151.opmBuffer[src + %3d]',$j0+2<<1|0}else{printf'%27s',''};printf' + 64 >> 7));%c',10;printf'%16sr = Math.max (-32768, Math.min (32767, ','',$i;if($c0){if($c0==1){print'    '}else{printf'%2d *',$c0};printf' YM2151.opmBuffer[src + %3d] +',$j0<<1|1}else{printf'%27s',''};printf' %2d * YM2151.opmBuffer[src + %3d] ',$c1,$j0+1<<1|1;if($c2){print'+ ';if($c2==1){print'    '}else{printf'%2d *',$c2};printf' YM2151.opmBuffer[src + %3d]',$j0+2<<1|1}else{printf'%27s',''};printf' + 64 >> 7));%c',10;printf'%16ssndByteBlock[dst + %2d] = (byte) l;%c','',$i<<2|0,10;printf'%16ssndByteBlock[dst + %2d] = (byte) (l >> 8);%c','',$i<<2|1,10;printf'%16ssndByteBlock[dst + %2d] = (byte) r;%c','',$i<<2|2,10;printf'%16ssndByteBlock[dst + %2d] = (byte) (r >> 8);%c','',$i<<2|3,10;printf'%16ssndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);%c','',10}"
   699:                 l = Math.max (-32768, Math.min (32767,                             96 * YM2151.opmBuffer[src +   0] + 29 * YM2151.opmBuffer[src +   2] + 64 >> 7));
   700:                 r = Math.max (-32768, Math.min (32767,                             96 * YM2151.opmBuffer[src +   1] + 29 * YM2151.opmBuffer[src +   3] + 64 >> 7));
   701:                 sndByteBlock[dst +  0] = (byte) l;
   702:                 sndByteBlock[dst +  1] = (byte) (l >> 8);
   703:                 sndByteBlock[dst +  2] = (byte) r;
   704:                 sndByteBlock[dst +  3] = (byte) (r >> 8);
   705:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   706:                 l = Math.max (-32768, Math.min (32767,                             67 * YM2151.opmBuffer[src +   2] + 58 * YM2151.opmBuffer[src +   4] + 64 >> 7));
   707:                 r = Math.max (-32768, Math.min (32767,                             67 * YM2151.opmBuffer[src +   3] + 58 * YM2151.opmBuffer[src +   5] + 64 >> 7));
   708:                 sndByteBlock[dst +  4] = (byte) l;
   709:                 sndByteBlock[dst +  5] = (byte) (l >> 8);
   710:                 sndByteBlock[dst +  6] = (byte) r;
   711:                 sndByteBlock[dst +  7] = (byte) (r >> 8);
   712:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   713:                 l = Math.max (-32768, Math.min (32767, 38 * YM2151.opmBuffer[src +   4] + 87 * YM2151.opmBuffer[src +   6]                             + 64 >> 7));
   714:                 r = Math.max (-32768, Math.min (32767, 38 * YM2151.opmBuffer[src +   5] + 87 * YM2151.opmBuffer[src +   7]                             + 64 >> 7));
   715:                 sndByteBlock[dst +  8] = (byte) l;
   716:                 sndByteBlock[dst +  9] = (byte) (l >> 8);
   717:                 sndByteBlock[dst + 10] = (byte) r;
   718:                 sndByteBlock[dst + 11] = (byte) (r >> 8);
   719:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   720:                 l = Math.max (-32768, Math.min (32767,  9 * YM2151.opmBuffer[src +   6] + 96 * YM2151.opmBuffer[src +   8] + 20 * YM2151.opmBuffer[src +  10] + 64 >> 7));
   721:                 r = Math.max (-32768, Math.min (32767,  9 * YM2151.opmBuffer[src +   7] + 96 * YM2151.opmBuffer[src +   9] + 20 * YM2151.opmBuffer[src +  11] + 64 >> 7));
   722:                 sndByteBlock[dst + 12] = (byte) l;
   723:                 sndByteBlock[dst + 13] = (byte) (l >> 8);
   724:                 sndByteBlock[dst + 14] = (byte) r;
   725:                 sndByteBlock[dst + 15] = (byte) (r >> 8);
   726:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   727:                 l = Math.max (-32768, Math.min (32767,                             76 * YM2151.opmBuffer[src +  10] + 49 * YM2151.opmBuffer[src +  12] + 64 >> 7));
   728:                 r = Math.max (-32768, Math.min (32767,                             76 * YM2151.opmBuffer[src +  11] + 49 * YM2151.opmBuffer[src +  13] + 64 >> 7));
   729:                 sndByteBlock[dst + 16] = (byte) l;
   730:                 sndByteBlock[dst + 17] = (byte) (l >> 8);
   731:                 sndByteBlock[dst + 18] = (byte) r;
   732:                 sndByteBlock[dst + 19] = (byte) (r >> 8);
   733:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   734:                 l = Math.max (-32768, Math.min (32767, 47 * YM2151.opmBuffer[src +  12] + 78 * YM2151.opmBuffer[src +  14]                             + 64 >> 7));
   735:                 r = Math.max (-32768, Math.min (32767, 47 * YM2151.opmBuffer[src +  13] + 78 * YM2151.opmBuffer[src +  15]                             + 64 >> 7));
   736:                 sndByteBlock[dst + 20] = (byte) l;
   737:                 sndByteBlock[dst + 21] = (byte) (l >> 8);
   738:                 sndByteBlock[dst + 22] = (byte) r;
   739:                 sndByteBlock[dst + 23] = (byte) (r >> 8);
   740:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   741:                 l = Math.max (-32768, Math.min (32767, 18 * YM2151.opmBuffer[src +  14] + 96 * YM2151.opmBuffer[src +  16] + 11 * YM2151.opmBuffer[src +  18] + 64 >> 7));
   742:                 r = Math.max (-32768, Math.min (32767, 18 * YM2151.opmBuffer[src +  15] + 96 * YM2151.opmBuffer[src +  17] + 11 * YM2151.opmBuffer[src +  19] + 64 >> 7));
   743:                 sndByteBlock[dst + 24] = (byte) l;
   744:                 sndByteBlock[dst + 25] = (byte) (l >> 8);
   745:                 sndByteBlock[dst + 26] = (byte) r;
   746:                 sndByteBlock[dst + 27] = (byte) (r >> 8);
   747:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   748:                 l = Math.max (-32768, Math.min (32767,                             85 * YM2151.opmBuffer[src +  18] + 40 * YM2151.opmBuffer[src +  20] + 64 >> 7));
   749:                 r = Math.max (-32768, Math.min (32767,                             85 * YM2151.opmBuffer[src +  19] + 40 * YM2151.opmBuffer[src +  21] + 64 >> 7));
   750:                 sndByteBlock[dst + 28] = (byte) l;
   751:                 sndByteBlock[dst + 29] = (byte) (l >> 8);
   752:                 sndByteBlock[dst + 30] = (byte) r;
   753:                 sndByteBlock[dst + 31] = (byte) (r >> 8);
   754:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   755:                 l = Math.max (-32768, Math.min (32767, 56 * YM2151.opmBuffer[src +  20] + 69 * YM2151.opmBuffer[src +  22]                             + 64 >> 7));
   756:                 r = Math.max (-32768, Math.min (32767, 56 * YM2151.opmBuffer[src +  21] + 69 * YM2151.opmBuffer[src +  23]                             + 64 >> 7));
   757:                 sndByteBlock[dst + 32] = (byte) l;
   758:                 sndByteBlock[dst + 33] = (byte) (l >> 8);
   759:                 sndByteBlock[dst + 34] = (byte) r;
   760:                 sndByteBlock[dst + 35] = (byte) (r >> 8);
   761:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   762:                 l = Math.max (-32768, Math.min (32767, 27 * YM2151.opmBuffer[src +  22] + 96 * YM2151.opmBuffer[src +  24] +  2 * YM2151.opmBuffer[src +  26] + 64 >> 7));
   763:                 r = Math.max (-32768, Math.min (32767, 27 * YM2151.opmBuffer[src +  23] + 96 * YM2151.opmBuffer[src +  25] +  2 * YM2151.opmBuffer[src +  27] + 64 >> 7));
   764:                 sndByteBlock[dst + 36] = (byte) l;
   765:                 sndByteBlock[dst + 37] = (byte) (l >> 8);
   766:                 sndByteBlock[dst + 38] = (byte) r;
   767:                 sndByteBlock[dst + 39] = (byte) (r >> 8);
   768:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   769:                 l = Math.max (-32768, Math.min (32767,                             94 * YM2151.opmBuffer[src +  26] + 31 * YM2151.opmBuffer[src +  28] + 64 >> 7));
   770:                 r = Math.max (-32768, Math.min (32767,                             94 * YM2151.opmBuffer[src +  27] + 31 * YM2151.opmBuffer[src +  29] + 64 >> 7));
   771:                 sndByteBlock[dst + 40] = (byte) l;
   772:                 sndByteBlock[dst + 41] = (byte) (l >> 8);
   773:                 sndByteBlock[dst + 42] = (byte) r;
   774:                 sndByteBlock[dst + 43] = (byte) (r >> 8);
   775:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   776:                 l = Math.max (-32768, Math.min (32767,                             65 * YM2151.opmBuffer[src +  28] + 60 * YM2151.opmBuffer[src +  30] + 64 >> 7));
   777:                 r = Math.max (-32768, Math.min (32767,                             65 * YM2151.opmBuffer[src +  29] + 60 * YM2151.opmBuffer[src +  31] + 64 >> 7));
   778:                 sndByteBlock[dst + 44] = (byte) l;
   779:                 sndByteBlock[dst + 45] = (byte) (l >> 8);
   780:                 sndByteBlock[dst + 46] = (byte) r;
   781:                 sndByteBlock[dst + 47] = (byte) (r >> 8);
   782:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   783:                 l = Math.max (-32768, Math.min (32767, 36 * YM2151.opmBuffer[src +  30] + 89 * YM2151.opmBuffer[src +  32]                             + 64 >> 7));
   784:                 r = Math.max (-32768, Math.min (32767, 36 * YM2151.opmBuffer[src +  31] + 89 * YM2151.opmBuffer[src +  33]                             + 64 >> 7));
   785:                 sndByteBlock[dst + 48] = (byte) l;
   786:                 sndByteBlock[dst + 49] = (byte) (l >> 8);
   787:                 sndByteBlock[dst + 50] = (byte) r;
   788:                 sndByteBlock[dst + 51] = (byte) (r >> 8);
   789:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   790:                 l = Math.max (-32768, Math.min (32767,  7 * YM2151.opmBuffer[src +  32] + 96 * YM2151.opmBuffer[src +  34] + 22 * YM2151.opmBuffer[src +  36] + 64 >> 7));
   791:                 r = Math.max (-32768, Math.min (32767,  7 * YM2151.opmBuffer[src +  33] + 96 * YM2151.opmBuffer[src +  35] + 22 * YM2151.opmBuffer[src +  37] + 64 >> 7));
   792:                 sndByteBlock[dst + 52] = (byte) l;
   793:                 sndByteBlock[dst + 53] = (byte) (l >> 8);
   794:                 sndByteBlock[dst + 54] = (byte) r;
   795:                 sndByteBlock[dst + 55] = (byte) (r >> 8);
   796:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   797:                 l = Math.max (-32768, Math.min (32767,                             74 * YM2151.opmBuffer[src +  36] + 51 * YM2151.opmBuffer[src +  38] + 64 >> 7));
   798:                 r = Math.max (-32768, Math.min (32767,                             74 * YM2151.opmBuffer[src +  37] + 51 * YM2151.opmBuffer[src +  39] + 64 >> 7));
   799:                 sndByteBlock[dst + 56] = (byte) l;
   800:                 sndByteBlock[dst + 57] = (byte) (l >> 8);
   801:                 sndByteBlock[dst + 58] = (byte) r;
   802:                 sndByteBlock[dst + 59] = (byte) (r >> 8);
   803:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   804:                 l = Math.max (-32768, Math.min (32767, 45 * YM2151.opmBuffer[src +  38] + 80 * YM2151.opmBuffer[src +  40]                             + 64 >> 7));
   805:                 r = Math.max (-32768, Math.min (32767, 45 * YM2151.opmBuffer[src +  39] + 80 * YM2151.opmBuffer[src +  41]                             + 64 >> 7));
   806:                 sndByteBlock[dst + 60] = (byte) l;
   807:                 sndByteBlock[dst + 61] = (byte) (l >> 8);
   808:                 sndByteBlock[dst + 62] = (byte) r;
   809:                 sndByteBlock[dst + 63] = (byte) (r >> 8);
   810:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   811:                 l = Math.max (-32768, Math.min (32767, 16 * YM2151.opmBuffer[src +  40] + 96 * YM2151.opmBuffer[src +  42] + 13 * YM2151.opmBuffer[src +  44] + 64 >> 7));
   812:                 r = Math.max (-32768, Math.min (32767, 16 * YM2151.opmBuffer[src +  41] + 96 * YM2151.opmBuffer[src +  43] + 13 * YM2151.opmBuffer[src +  45] + 64 >> 7));
   813:                 sndByteBlock[dst + 64] = (byte) l;
   814:                 sndByteBlock[dst + 65] = (byte) (l >> 8);
   815:                 sndByteBlock[dst + 66] = (byte) r;
   816:                 sndByteBlock[dst + 67] = (byte) (r >> 8);
   817:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   818:                 l = Math.max (-32768, Math.min (32767,                             83 * YM2151.opmBuffer[src +  44] + 42 * YM2151.opmBuffer[src +  46] + 64 >> 7));
   819:                 r = Math.max (-32768, Math.min (32767,                             83 * YM2151.opmBuffer[src +  45] + 42 * YM2151.opmBuffer[src +  47] + 64 >> 7));
   820:                 sndByteBlock[dst + 68] = (byte) l;
   821:                 sndByteBlock[dst + 69] = (byte) (l >> 8);
   822:                 sndByteBlock[dst + 70] = (byte) r;
   823:                 sndByteBlock[dst + 71] = (byte) (r >> 8);
   824:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   825:                 l = Math.max (-32768, Math.min (32767, 54 * YM2151.opmBuffer[src +  46] + 71 * YM2151.opmBuffer[src +  48]                             + 64 >> 7));
   826:                 r = Math.max (-32768, Math.min (32767, 54 * YM2151.opmBuffer[src +  47] + 71 * YM2151.opmBuffer[src +  49]                             + 64 >> 7));
   827:                 sndByteBlock[dst + 72] = (byte) l;
   828:                 sndByteBlock[dst + 73] = (byte) (l >> 8);
   829:                 sndByteBlock[dst + 74] = (byte) r;
   830:                 sndByteBlock[dst + 75] = (byte) (r >> 8);
   831:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   832:                 l = Math.max (-32768, Math.min (32767, 25 * YM2151.opmBuffer[src +  48] + 96 * YM2151.opmBuffer[src +  50] +  4 * YM2151.opmBuffer[src +  52] + 64 >> 7));
   833:                 r = Math.max (-32768, Math.min (32767, 25 * YM2151.opmBuffer[src +  49] + 96 * YM2151.opmBuffer[src +  51] +  4 * YM2151.opmBuffer[src +  53] + 64 >> 7));
   834:                 sndByteBlock[dst + 76] = (byte) l;
   835:                 sndByteBlock[dst + 77] = (byte) (l >> 8);
   836:                 sndByteBlock[dst + 78] = (byte) r;
   837:                 sndByteBlock[dst + 79] = (byte) (r >> 8);
   838:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   839:                 l = Math.max (-32768, Math.min (32767,                             92 * YM2151.opmBuffer[src +  52] + 33 * YM2151.opmBuffer[src +  54] + 64 >> 7));
   840:                 r = Math.max (-32768, Math.min (32767,                             92 * YM2151.opmBuffer[src +  53] + 33 * YM2151.opmBuffer[src +  55] + 64 >> 7));
   841:                 sndByteBlock[dst + 80] = (byte) l;
   842:                 sndByteBlock[dst + 81] = (byte) (l >> 8);
   843:                 sndByteBlock[dst + 82] = (byte) r;
   844:                 sndByteBlock[dst + 83] = (byte) (r >> 8);
   845:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   846:                 l = Math.max (-32768, Math.min (32767,                             63 * YM2151.opmBuffer[src +  54] + 62 * YM2151.opmBuffer[src +  56] + 64 >> 7));
   847:                 r = Math.max (-32768, Math.min (32767,                             63 * YM2151.opmBuffer[src +  55] + 62 * YM2151.opmBuffer[src +  57] + 64 >> 7));
   848:                 sndByteBlock[dst + 84] = (byte) l;
   849:                 sndByteBlock[dst + 85] = (byte) (l >> 8);
   850:                 sndByteBlock[dst + 86] = (byte) r;
   851:                 sndByteBlock[dst + 87] = (byte) (r >> 8);
   852:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   853:                 l = Math.max (-32768, Math.min (32767, 34 * YM2151.opmBuffer[src +  56] + 91 * YM2151.opmBuffer[src +  58]                             + 64 >> 7));
   854:                 r = Math.max (-32768, Math.min (32767, 34 * YM2151.opmBuffer[src +  57] + 91 * YM2151.opmBuffer[src +  59]                             + 64 >> 7));
   855:                 sndByteBlock[dst + 88] = (byte) l;
   856:                 sndByteBlock[dst + 89] = (byte) (l >> 8);
   857:                 sndByteBlock[dst + 90] = (byte) r;
   858:                 sndByteBlock[dst + 91] = (byte) (r >> 8);
   859:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   860:                 l = Math.max (-32768, Math.min (32767,  5 * YM2151.opmBuffer[src +  58] + 96 * YM2151.opmBuffer[src +  60] + 24 * YM2151.opmBuffer[src +  62] + 64 >> 7));
   861:                 r = Math.max (-32768, Math.min (32767,  5 * YM2151.opmBuffer[src +  59] + 96 * YM2151.opmBuffer[src +  61] + 24 * YM2151.opmBuffer[src +  63] + 64 >> 7));
   862:                 sndByteBlock[dst + 92] = (byte) l;
   863:                 sndByteBlock[dst + 93] = (byte) (l >> 8);
   864:                 sndByteBlock[dst + 94] = (byte) r;
   865:                 sndByteBlock[dst + 95] = (byte) (r >> 8);
   866:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   867:                 l = Math.max (-32768, Math.min (32767,                             72 * YM2151.opmBuffer[src +  62] + 53 * YM2151.opmBuffer[src +  64] + 64 >> 7));
   868:                 r = Math.max (-32768, Math.min (32767,                             72 * YM2151.opmBuffer[src +  63] + 53 * YM2151.opmBuffer[src +  65] + 64 >> 7));
   869:                 sndByteBlock[dst + 96] = (byte) l;
   870:                 sndByteBlock[dst + 97] = (byte) (l >> 8);
   871:                 sndByteBlock[dst + 98] = (byte) r;
   872:                 sndByteBlock[dst + 99] = (byte) (r >> 8);
   873:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   874:                 l = Math.max (-32768, Math.min (32767, 43 * YM2151.opmBuffer[src +  64] + 82 * YM2151.opmBuffer[src +  66]                             + 64 >> 7));
   875:                 r = Math.max (-32768, Math.min (32767, 43 * YM2151.opmBuffer[src +  65] + 82 * YM2151.opmBuffer[src +  67]                             + 64 >> 7));
   876:                 sndByteBlock[dst + 100] = (byte) l;
   877:                 sndByteBlock[dst + 101] = (byte) (l >> 8);
   878:                 sndByteBlock[dst + 102] = (byte) r;
   879:                 sndByteBlock[dst + 103] = (byte) (r >> 8);
   880:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   881:                 l = Math.max (-32768, Math.min (32767, 14 * YM2151.opmBuffer[src +  66] + 96 * YM2151.opmBuffer[src +  68] + 15 * YM2151.opmBuffer[src +  70] + 64 >> 7));
   882:                 r = Math.max (-32768, Math.min (32767, 14 * YM2151.opmBuffer[src +  67] + 96 * YM2151.opmBuffer[src +  69] + 15 * YM2151.opmBuffer[src +  71] + 64 >> 7));
   883:                 sndByteBlock[dst + 104] = (byte) l;
   884:                 sndByteBlock[dst + 105] = (byte) (l >> 8);
   885:                 sndByteBlock[dst + 106] = (byte) r;
   886:                 sndByteBlock[dst + 107] = (byte) (r >> 8);
   887:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   888:                 l = Math.max (-32768, Math.min (32767,                             81 * YM2151.opmBuffer[src +  70] + 44 * YM2151.opmBuffer[src +  72] + 64 >> 7));
   889:                 r = Math.max (-32768, Math.min (32767,                             81 * YM2151.opmBuffer[src +  71] + 44 * YM2151.opmBuffer[src +  73] + 64 >> 7));
   890:                 sndByteBlock[dst + 108] = (byte) l;
   891:                 sndByteBlock[dst + 109] = (byte) (l >> 8);
   892:                 sndByteBlock[dst + 110] = (byte) r;
   893:                 sndByteBlock[dst + 111] = (byte) (r >> 8);
   894:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   895:                 l = Math.max (-32768, Math.min (32767, 52 * YM2151.opmBuffer[src +  72] + 73 * YM2151.opmBuffer[src +  74]                             + 64 >> 7));
   896:                 r = Math.max (-32768, Math.min (32767, 52 * YM2151.opmBuffer[src +  73] + 73 * YM2151.opmBuffer[src +  75]                             + 64 >> 7));
   897:                 sndByteBlock[dst + 112] = (byte) l;
   898:                 sndByteBlock[dst + 113] = (byte) (l >> 8);
   899:                 sndByteBlock[dst + 114] = (byte) r;
   900:                 sndByteBlock[dst + 115] = (byte) (r >> 8);
   901:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   902:                 l = Math.max (-32768, Math.min (32767, 23 * YM2151.opmBuffer[src +  74] + 96 * YM2151.opmBuffer[src +  76] +  6 * YM2151.opmBuffer[src +  78] + 64 >> 7));
   903:                 r = Math.max (-32768, Math.min (32767, 23 * YM2151.opmBuffer[src +  75] + 96 * YM2151.opmBuffer[src +  77] +  6 * YM2151.opmBuffer[src +  79] + 64 >> 7));
   904:                 sndByteBlock[dst + 116] = (byte) l;
   905:                 sndByteBlock[dst + 117] = (byte) (l >> 8);
   906:                 sndByteBlock[dst + 118] = (byte) r;
   907:                 sndByteBlock[dst + 119] = (byte) (r >> 8);
   908:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   909:                 l = Math.max (-32768, Math.min (32767,                             90 * YM2151.opmBuffer[src +  78] + 35 * YM2151.opmBuffer[src +  80] + 64 >> 7));
   910:                 r = Math.max (-32768, Math.min (32767,                             90 * YM2151.opmBuffer[src +  79] + 35 * YM2151.opmBuffer[src +  81] + 64 >> 7));
   911:                 sndByteBlock[dst + 120] = (byte) l;
   912:                 sndByteBlock[dst + 121] = (byte) (l >> 8);
   913:                 sndByteBlock[dst + 122] = (byte) r;
   914:                 sndByteBlock[dst + 123] = (byte) (r >> 8);
   915:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   916:                 l = Math.max (-32768, Math.min (32767, 61 * YM2151.opmBuffer[src +  80] + 64 * YM2151.opmBuffer[src +  82]                             + 64 >> 7));
   917:                 r = Math.max (-32768, Math.min (32767, 61 * YM2151.opmBuffer[src +  81] + 64 * YM2151.opmBuffer[src +  83]                             + 64 >> 7));
   918:                 sndByteBlock[dst + 124] = (byte) l;
   919:                 sndByteBlock[dst + 125] = (byte) (l >> 8);
   920:                 sndByteBlock[dst + 126] = (byte) r;
   921:                 sndByteBlock[dst + 127] = (byte) (r >> 8);
   922:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   923:                 l = Math.max (-32768, Math.min (32767, 32 * YM2151.opmBuffer[src +  82] + 93 * YM2151.opmBuffer[src +  84]                             + 64 >> 7));
   924:                 r = Math.max (-32768, Math.min (32767, 32 * YM2151.opmBuffer[src +  83] + 93 * YM2151.opmBuffer[src +  85]                             + 64 >> 7));
   925:                 sndByteBlock[dst + 128] = (byte) l;
   926:                 sndByteBlock[dst + 129] = (byte) (l >> 8);
   927:                 sndByteBlock[dst + 130] = (byte) r;
   928:                 sndByteBlock[dst + 131] = (byte) (r >> 8);
   929:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   930:                 l = Math.max (-32768, Math.min (32767,  3 * YM2151.opmBuffer[src +  84] + 96 * YM2151.opmBuffer[src +  86] + 26 * YM2151.opmBuffer[src +  88] + 64 >> 7));
   931:                 r = Math.max (-32768, Math.min (32767,  3 * YM2151.opmBuffer[src +  85] + 96 * YM2151.opmBuffer[src +  87] + 26 * YM2151.opmBuffer[src +  89] + 64 >> 7));
   932:                 sndByteBlock[dst + 132] = (byte) l;
   933:                 sndByteBlock[dst + 133] = (byte) (l >> 8);
   934:                 sndByteBlock[dst + 134] = (byte) r;
   935:                 sndByteBlock[dst + 135] = (byte) (r >> 8);
   936:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   937:                 l = Math.max (-32768, Math.min (32767,                             70 * YM2151.opmBuffer[src +  88] + 55 * YM2151.opmBuffer[src +  90] + 64 >> 7));
   938:                 r = Math.max (-32768, Math.min (32767,                             70 * YM2151.opmBuffer[src +  89] + 55 * YM2151.opmBuffer[src +  91] + 64 >> 7));
   939:                 sndByteBlock[dst + 136] = (byte) l;
   940:                 sndByteBlock[dst + 137] = (byte) (l >> 8);
   941:                 sndByteBlock[dst + 138] = (byte) r;
   942:                 sndByteBlock[dst + 139] = (byte) (r >> 8);
   943:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   944:                 l = Math.max (-32768, Math.min (32767, 41 * YM2151.opmBuffer[src +  90] + 84 * YM2151.opmBuffer[src +  92]                             + 64 >> 7));
   945:                 r = Math.max (-32768, Math.min (32767, 41 * YM2151.opmBuffer[src +  91] + 84 * YM2151.opmBuffer[src +  93]                             + 64 >> 7));
   946:                 sndByteBlock[dst + 140] = (byte) l;
   947:                 sndByteBlock[dst + 141] = (byte) (l >> 8);
   948:                 sndByteBlock[dst + 142] = (byte) r;
   949:                 sndByteBlock[dst + 143] = (byte) (r >> 8);
   950:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   951:                 l = Math.max (-32768, Math.min (32767, 12 * YM2151.opmBuffer[src +  92] + 96 * YM2151.opmBuffer[src +  94] + 17 * YM2151.opmBuffer[src +  96] + 64 >> 7));
   952:                 r = Math.max (-32768, Math.min (32767, 12 * YM2151.opmBuffer[src +  93] + 96 * YM2151.opmBuffer[src +  95] + 17 * YM2151.opmBuffer[src +  97] + 64 >> 7));
   953:                 sndByteBlock[dst + 144] = (byte) l;
   954:                 sndByteBlock[dst + 145] = (byte) (l >> 8);
   955:                 sndByteBlock[dst + 146] = (byte) r;
   956:                 sndByteBlock[dst + 147] = (byte) (r >> 8);
   957:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   958:                 l = Math.max (-32768, Math.min (32767,                             79 * YM2151.opmBuffer[src +  96] + 46 * YM2151.opmBuffer[src +  98] + 64 >> 7));
   959:                 r = Math.max (-32768, Math.min (32767,                             79 * YM2151.opmBuffer[src +  97] + 46 * YM2151.opmBuffer[src +  99] + 64 >> 7));
   960:                 sndByteBlock[dst + 148] = (byte) l;
   961:                 sndByteBlock[dst + 149] = (byte) (l >> 8);
   962:                 sndByteBlock[dst + 150] = (byte) r;
   963:                 sndByteBlock[dst + 151] = (byte) (r >> 8);
   964:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   965:                 l = Math.max (-32768, Math.min (32767, 50 * YM2151.opmBuffer[src +  98] + 75 * YM2151.opmBuffer[src + 100]                             + 64 >> 7));
   966:                 r = Math.max (-32768, Math.min (32767, 50 * YM2151.opmBuffer[src +  99] + 75 * YM2151.opmBuffer[src + 101]                             + 64 >> 7));
   967:                 sndByteBlock[dst + 152] = (byte) l;
   968:                 sndByteBlock[dst + 153] = (byte) (l >> 8);
   969:                 sndByteBlock[dst + 154] = (byte) r;
   970:                 sndByteBlock[dst + 155] = (byte) (r >> 8);
   971:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   972:                 l = Math.max (-32768, Math.min (32767, 21 * YM2151.opmBuffer[src + 100] + 96 * YM2151.opmBuffer[src + 102] +  8 * YM2151.opmBuffer[src + 104] + 64 >> 7));
   973:                 r = Math.max (-32768, Math.min (32767, 21 * YM2151.opmBuffer[src + 101] + 96 * YM2151.opmBuffer[src + 103] +  8 * YM2151.opmBuffer[src + 105] + 64 >> 7));
   974:                 sndByteBlock[dst + 156] = (byte) l;
   975:                 sndByteBlock[dst + 157] = (byte) (l >> 8);
   976:                 sndByteBlock[dst + 158] = (byte) r;
   977:                 sndByteBlock[dst + 159] = (byte) (r >> 8);
   978:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   979:                 l = Math.max (-32768, Math.min (32767,                             88 * YM2151.opmBuffer[src + 104] + 37 * YM2151.opmBuffer[src + 106] + 64 >> 7));
   980:                 r = Math.max (-32768, Math.min (32767,                             88 * YM2151.opmBuffer[src + 105] + 37 * YM2151.opmBuffer[src + 107] + 64 >> 7));
   981:                 sndByteBlock[dst + 160] = (byte) l;
   982:                 sndByteBlock[dst + 161] = (byte) (l >> 8);
   983:                 sndByteBlock[dst + 162] = (byte) r;
   984:                 sndByteBlock[dst + 163] = (byte) (r >> 8);
   985:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   986:                 l = Math.max (-32768, Math.min (32767, 59 * YM2151.opmBuffer[src + 106] + 66 * YM2151.opmBuffer[src + 108]                             + 64 >> 7));
   987:                 r = Math.max (-32768, Math.min (32767, 59 * YM2151.opmBuffer[src + 107] + 66 * YM2151.opmBuffer[src + 109]                             + 64 >> 7));
   988:                 sndByteBlock[dst + 164] = (byte) l;
   989:                 sndByteBlock[dst + 165] = (byte) (l >> 8);
   990:                 sndByteBlock[dst + 166] = (byte) r;
   991:                 sndByteBlock[dst + 167] = (byte) (r >> 8);
   992:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
   993:                 l = Math.max (-32768, Math.min (32767, 30 * YM2151.opmBuffer[src + 108] + 95 * YM2151.opmBuffer[src + 110]                             + 64 >> 7));
   994:                 r = Math.max (-32768, Math.min (32767, 30 * YM2151.opmBuffer[src + 109] + 95 * YM2151.opmBuffer[src + 111]                             + 64 >> 7));
   995:                 sndByteBlock[dst + 168] = (byte) l;
   996:                 sndByteBlock[dst + 169] = (byte) (l >> 8);
   997:                 sndByteBlock[dst + 170] = (byte) r;
   998:                 sndByteBlock[dst + 171] = (byte) (r >> 8);
   999:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1000:                 l = Math.max (-32768, Math.min (32767,      YM2151.opmBuffer[src + 110] + 96 * YM2151.opmBuffer[src + 112] + 28 * YM2151.opmBuffer[src + 114] + 64 >> 7));
  1001:                 r = Math.max (-32768, Math.min (32767,      YM2151.opmBuffer[src + 111] + 96 * YM2151.opmBuffer[src + 113] + 28 * YM2151.opmBuffer[src + 115] + 64 >> 7));
  1002:                 sndByteBlock[dst + 172] = (byte) l;
  1003:                 sndByteBlock[dst + 173] = (byte) (l >> 8);
  1004:                 sndByteBlock[dst + 174] = (byte) r;
  1005:                 sndByteBlock[dst + 175] = (byte) (r >> 8);
  1006:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1007:                 l = Math.max (-32768, Math.min (32767,                             68 * YM2151.opmBuffer[src + 114] + 57 * YM2151.opmBuffer[src + 116] + 64 >> 7));
  1008:                 r = Math.max (-32768, Math.min (32767,                             68 * YM2151.opmBuffer[src + 115] + 57 * YM2151.opmBuffer[src + 117] + 64 >> 7));
  1009:                 sndByteBlock[dst + 176] = (byte) l;
  1010:                 sndByteBlock[dst + 177] = (byte) (l >> 8);
  1011:                 sndByteBlock[dst + 178] = (byte) r;
  1012:                 sndByteBlock[dst + 179] = (byte) (r >> 8);
  1013:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1014:                 l = Math.max (-32768, Math.min (32767, 39 * YM2151.opmBuffer[src + 116] + 86 * YM2151.opmBuffer[src + 118]                             + 64 >> 7));
  1015:                 r = Math.max (-32768, Math.min (32767, 39 * YM2151.opmBuffer[src + 117] + 86 * YM2151.opmBuffer[src + 119]                             + 64 >> 7));
  1016:                 sndByteBlock[dst + 180] = (byte) l;
  1017:                 sndByteBlock[dst + 181] = (byte) (l >> 8);
  1018:                 sndByteBlock[dst + 182] = (byte) r;
  1019:                 sndByteBlock[dst + 183] = (byte) (r >> 8);
  1020:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1021:                 l = Math.max (-32768, Math.min (32767, 10 * YM2151.opmBuffer[src + 118] + 96 * YM2151.opmBuffer[src + 120] + 19 * YM2151.opmBuffer[src + 122] + 64 >> 7));
  1022:                 r = Math.max (-32768, Math.min (32767, 10 * YM2151.opmBuffer[src + 119] + 96 * YM2151.opmBuffer[src + 121] + 19 * YM2151.opmBuffer[src + 123] + 64 >> 7));
  1023:                 sndByteBlock[dst + 184] = (byte) l;
  1024:                 sndByteBlock[dst + 185] = (byte) (l >> 8);
  1025:                 sndByteBlock[dst + 186] = (byte) r;
  1026:                 sndByteBlock[dst + 187] = (byte) (r >> 8);
  1027:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1028:                 l = Math.max (-32768, Math.min (32767,                             77 * YM2151.opmBuffer[src + 122] + 48 * YM2151.opmBuffer[src + 124] + 64 >> 7));
  1029:                 r = Math.max (-32768, Math.min (32767,                             77 * YM2151.opmBuffer[src + 123] + 48 * YM2151.opmBuffer[src + 125] + 64 >> 7));
  1030:                 sndByteBlock[dst + 188] = (byte) l;
  1031:                 sndByteBlock[dst + 189] = (byte) (l >> 8);
  1032:                 sndByteBlock[dst + 190] = (byte) r;
  1033:                 sndByteBlock[dst + 191] = (byte) (r >> 8);
  1034:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1035:                 l = Math.max (-32768, Math.min (32767, 48 * YM2151.opmBuffer[src + 124] + 77 * YM2151.opmBuffer[src + 126]                             + 64 >> 7));
  1036:                 r = Math.max (-32768, Math.min (32767, 48 * YM2151.opmBuffer[src + 125] + 77 * YM2151.opmBuffer[src + 127]                             + 64 >> 7));
  1037:                 sndByteBlock[dst + 192] = (byte) l;
  1038:                 sndByteBlock[dst + 193] = (byte) (l >> 8);
  1039:                 sndByteBlock[dst + 194] = (byte) r;
  1040:                 sndByteBlock[dst + 195] = (byte) (r >> 8);
  1041:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1042:                 l = Math.max (-32768, Math.min (32767, 19 * YM2151.opmBuffer[src + 126] + 96 * YM2151.opmBuffer[src + 128] + 10 * YM2151.opmBuffer[src + 130] + 64 >> 7));
  1043:                 r = Math.max (-32768, Math.min (32767, 19 * YM2151.opmBuffer[src + 127] + 96 * YM2151.opmBuffer[src + 129] + 10 * YM2151.opmBuffer[src + 131] + 64 >> 7));
  1044:                 sndByteBlock[dst + 196] = (byte) l;
  1045:                 sndByteBlock[dst + 197] = (byte) (l >> 8);
  1046:                 sndByteBlock[dst + 198] = (byte) r;
  1047:                 sndByteBlock[dst + 199] = (byte) (r >> 8);
  1048:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1049:                 l = Math.max (-32768, Math.min (32767,                             86 * YM2151.opmBuffer[src + 130] + 39 * YM2151.opmBuffer[src + 132] + 64 >> 7));
  1050:                 r = Math.max (-32768, Math.min (32767,                             86 * YM2151.opmBuffer[src + 131] + 39 * YM2151.opmBuffer[src + 133] + 64 >> 7));
  1051:                 sndByteBlock[dst + 200] = (byte) l;
  1052:                 sndByteBlock[dst + 201] = (byte) (l >> 8);
  1053:                 sndByteBlock[dst + 202] = (byte) r;
  1054:                 sndByteBlock[dst + 203] = (byte) (r >> 8);
  1055:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1056:                 l = Math.max (-32768, Math.min (32767, 57 * YM2151.opmBuffer[src + 132] + 68 * YM2151.opmBuffer[src + 134]                             + 64 >> 7));
  1057:                 r = Math.max (-32768, Math.min (32767, 57 * YM2151.opmBuffer[src + 133] + 68 * YM2151.opmBuffer[src + 135]                             + 64 >> 7));
  1058:                 sndByteBlock[dst + 204] = (byte) l;
  1059:                 sndByteBlock[dst + 205] = (byte) (l >> 8);
  1060:                 sndByteBlock[dst + 206] = (byte) r;
  1061:                 sndByteBlock[dst + 207] = (byte) (r >> 8);
  1062:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1063:                 l = Math.max (-32768, Math.min (32767, 28 * YM2151.opmBuffer[src + 134] + 96 * YM2151.opmBuffer[src + 136] +      YM2151.opmBuffer[src + 138] + 64 >> 7));
  1064:                 r = Math.max (-32768, Math.min (32767, 28 * YM2151.opmBuffer[src + 135] + 96 * YM2151.opmBuffer[src + 137] +      YM2151.opmBuffer[src + 139] + 64 >> 7));
  1065:                 sndByteBlock[dst + 208] = (byte) l;
  1066:                 sndByteBlock[dst + 209] = (byte) (l >> 8);
  1067:                 sndByteBlock[dst + 210] = (byte) r;
  1068:                 sndByteBlock[dst + 211] = (byte) (r >> 8);
  1069:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1070:                 l = Math.max (-32768, Math.min (32767,                             95 * YM2151.opmBuffer[src + 138] + 30 * YM2151.opmBuffer[src + 140] + 64 >> 7));
  1071:                 r = Math.max (-32768, Math.min (32767,                             95 * YM2151.opmBuffer[src + 139] + 30 * YM2151.opmBuffer[src + 141] + 64 >> 7));
  1072:                 sndByteBlock[dst + 212] = (byte) l;
  1073:                 sndByteBlock[dst + 213] = (byte) (l >> 8);
  1074:                 sndByteBlock[dst + 214] = (byte) r;
  1075:                 sndByteBlock[dst + 215] = (byte) (r >> 8);
  1076:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1077:                 l = Math.max (-32768, Math.min (32767,                             66 * YM2151.opmBuffer[src + 140] + 59 * YM2151.opmBuffer[src + 142] + 64 >> 7));
  1078:                 r = Math.max (-32768, Math.min (32767,                             66 * YM2151.opmBuffer[src + 141] + 59 * YM2151.opmBuffer[src + 143] + 64 >> 7));
  1079:                 sndByteBlock[dst + 216] = (byte) l;
  1080:                 sndByteBlock[dst + 217] = (byte) (l >> 8);
  1081:                 sndByteBlock[dst + 218] = (byte) r;
  1082:                 sndByteBlock[dst + 219] = (byte) (r >> 8);
  1083:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1084:                 l = Math.max (-32768, Math.min (32767, 37 * YM2151.opmBuffer[src + 142] + 88 * YM2151.opmBuffer[src + 144]                             + 64 >> 7));
  1085:                 r = Math.max (-32768, Math.min (32767, 37 * YM2151.opmBuffer[src + 143] + 88 * YM2151.opmBuffer[src + 145]                             + 64 >> 7));
  1086:                 sndByteBlock[dst + 220] = (byte) l;
  1087:                 sndByteBlock[dst + 221] = (byte) (l >> 8);
  1088:                 sndByteBlock[dst + 222] = (byte) r;
  1089:                 sndByteBlock[dst + 223] = (byte) (r >> 8);
  1090:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1091:                 l = Math.max (-32768, Math.min (32767,  8 * YM2151.opmBuffer[src + 144] + 96 * YM2151.opmBuffer[src + 146] + 21 * YM2151.opmBuffer[src + 148] + 64 >> 7));
  1092:                 r = Math.max (-32768, Math.min (32767,  8 * YM2151.opmBuffer[src + 145] + 96 * YM2151.opmBuffer[src + 147] + 21 * YM2151.opmBuffer[src + 149] + 64 >> 7));
  1093:                 sndByteBlock[dst + 224] = (byte) l;
  1094:                 sndByteBlock[dst + 225] = (byte) (l >> 8);
  1095:                 sndByteBlock[dst + 226] = (byte) r;
  1096:                 sndByteBlock[dst + 227] = (byte) (r >> 8);
  1097:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1098:                 l = Math.max (-32768, Math.min (32767,                             75 * YM2151.opmBuffer[src + 148] + 50 * YM2151.opmBuffer[src + 150] + 64 >> 7));
  1099:                 r = Math.max (-32768, Math.min (32767,                             75 * YM2151.opmBuffer[src + 149] + 50 * YM2151.opmBuffer[src + 151] + 64 >> 7));
  1100:                 sndByteBlock[dst + 228] = (byte) l;
  1101:                 sndByteBlock[dst + 229] = (byte) (l >> 8);
  1102:                 sndByteBlock[dst + 230] = (byte) r;
  1103:                 sndByteBlock[dst + 231] = (byte) (r >> 8);
  1104:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1105:                 l = Math.max (-32768, Math.min (32767, 46 * YM2151.opmBuffer[src + 150] + 79 * YM2151.opmBuffer[src + 152]                             + 64 >> 7));
  1106:                 r = Math.max (-32768, Math.min (32767, 46 * YM2151.opmBuffer[src + 151] + 79 * YM2151.opmBuffer[src + 153]                             + 64 >> 7));
  1107:                 sndByteBlock[dst + 232] = (byte) l;
  1108:                 sndByteBlock[dst + 233] = (byte) (l >> 8);
  1109:                 sndByteBlock[dst + 234] = (byte) r;
  1110:                 sndByteBlock[dst + 235] = (byte) (r >> 8);
  1111:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1112:                 l = Math.max (-32768, Math.min (32767, 17 * YM2151.opmBuffer[src + 152] + 96 * YM2151.opmBuffer[src + 154] + 12 * YM2151.opmBuffer[src + 156] + 64 >> 7));
  1113:                 r = Math.max (-32768, Math.min (32767, 17 * YM2151.opmBuffer[src + 153] + 96 * YM2151.opmBuffer[src + 155] + 12 * YM2151.opmBuffer[src + 157] + 64 >> 7));
  1114:                 sndByteBlock[dst + 236] = (byte) l;
  1115:                 sndByteBlock[dst + 237] = (byte) (l >> 8);
  1116:                 sndByteBlock[dst + 238] = (byte) r;
  1117:                 sndByteBlock[dst + 239] = (byte) (r >> 8);
  1118:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1119:                 l = Math.max (-32768, Math.min (32767,                             84 * YM2151.opmBuffer[src + 156] + 41 * YM2151.opmBuffer[src + 158] + 64 >> 7));
  1120:                 r = Math.max (-32768, Math.min (32767,                             84 * YM2151.opmBuffer[src + 157] + 41 * YM2151.opmBuffer[src + 159] + 64 >> 7));
  1121:                 sndByteBlock[dst + 240] = (byte) l;
  1122:                 sndByteBlock[dst + 241] = (byte) (l >> 8);
  1123:                 sndByteBlock[dst + 242] = (byte) r;
  1124:                 sndByteBlock[dst + 243] = (byte) (r >> 8);
  1125:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1126:                 l = Math.max (-32768, Math.min (32767, 55 * YM2151.opmBuffer[src + 158] + 70 * YM2151.opmBuffer[src + 160]                             + 64 >> 7));
  1127:                 r = Math.max (-32768, Math.min (32767, 55 * YM2151.opmBuffer[src + 159] + 70 * YM2151.opmBuffer[src + 161]                             + 64 >> 7));
  1128:                 sndByteBlock[dst + 244] = (byte) l;
  1129:                 sndByteBlock[dst + 245] = (byte) (l >> 8);
  1130:                 sndByteBlock[dst + 246] = (byte) r;
  1131:                 sndByteBlock[dst + 247] = (byte) (r >> 8);
  1132:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1133:                 l = Math.max (-32768, Math.min (32767, 26 * YM2151.opmBuffer[src + 160] + 96 * YM2151.opmBuffer[src + 162] +  3 * YM2151.opmBuffer[src + 164] + 64 >> 7));
  1134:                 r = Math.max (-32768, Math.min (32767, 26 * YM2151.opmBuffer[src + 161] + 96 * YM2151.opmBuffer[src + 163] +  3 * YM2151.opmBuffer[src + 165] + 64 >> 7));
  1135:                 sndByteBlock[dst + 248] = (byte) l;
  1136:                 sndByteBlock[dst + 249] = (byte) (l >> 8);
  1137:                 sndByteBlock[dst + 250] = (byte) r;
  1138:                 sndByteBlock[dst + 251] = (byte) (r >> 8);
  1139:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1140:                 l = Math.max (-32768, Math.min (32767,                             93 * YM2151.opmBuffer[src + 164] + 32 * YM2151.opmBuffer[src + 166] + 64 >> 7));
  1141:                 r = Math.max (-32768, Math.min (32767,                             93 * YM2151.opmBuffer[src + 165] + 32 * YM2151.opmBuffer[src + 167] + 64 >> 7));
  1142:                 sndByteBlock[dst + 252] = (byte) l;
  1143:                 sndByteBlock[dst + 253] = (byte) (l >> 8);
  1144:                 sndByteBlock[dst + 254] = (byte) r;
  1145:                 sndByteBlock[dst + 255] = (byte) (r >> 8);
  1146:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1147:                 l = Math.max (-32768, Math.min (32767,                             64 * YM2151.opmBuffer[src + 166] + 61 * YM2151.opmBuffer[src + 168] + 64 >> 7));
  1148:                 r = Math.max (-32768, Math.min (32767,                             64 * YM2151.opmBuffer[src + 167] + 61 * YM2151.opmBuffer[src + 169] + 64 >> 7));
  1149:                 sndByteBlock[dst + 256] = (byte) l;
  1150:                 sndByteBlock[dst + 257] = (byte) (l >> 8);
  1151:                 sndByteBlock[dst + 258] = (byte) r;
  1152:                 sndByteBlock[dst + 259] = (byte) (r >> 8);
  1153:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1154:                 l = Math.max (-32768, Math.min (32767, 35 * YM2151.opmBuffer[src + 168] + 90 * YM2151.opmBuffer[src + 170]                             + 64 >> 7));
  1155:                 r = Math.max (-32768, Math.min (32767, 35 * YM2151.opmBuffer[src + 169] + 90 * YM2151.opmBuffer[src + 171]                             + 64 >> 7));
  1156:                 sndByteBlock[dst + 260] = (byte) l;
  1157:                 sndByteBlock[dst + 261] = (byte) (l >> 8);
  1158:                 sndByteBlock[dst + 262] = (byte) r;
  1159:                 sndByteBlock[dst + 263] = (byte) (r >> 8);
  1160:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1161:                 l = Math.max (-32768, Math.min (32767,  6 * YM2151.opmBuffer[src + 170] + 96 * YM2151.opmBuffer[src + 172] + 23 * YM2151.opmBuffer[src + 174] + 64 >> 7));
  1162:                 r = Math.max (-32768, Math.min (32767,  6 * YM2151.opmBuffer[src + 171] + 96 * YM2151.opmBuffer[src + 173] + 23 * YM2151.opmBuffer[src + 175] + 64 >> 7));
  1163:                 sndByteBlock[dst + 264] = (byte) l;
  1164:                 sndByteBlock[dst + 265] = (byte) (l >> 8);
  1165:                 sndByteBlock[dst + 266] = (byte) r;
  1166:                 sndByteBlock[dst + 267] = (byte) (r >> 8);
  1167:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1168:                 l = Math.max (-32768, Math.min (32767,                             73 * YM2151.opmBuffer[src + 174] + 52 * YM2151.opmBuffer[src + 176] + 64 >> 7));
  1169:                 r = Math.max (-32768, Math.min (32767,                             73 * YM2151.opmBuffer[src + 175] + 52 * YM2151.opmBuffer[src + 177] + 64 >> 7));
  1170:                 sndByteBlock[dst + 268] = (byte) l;
  1171:                 sndByteBlock[dst + 269] = (byte) (l >> 8);
  1172:                 sndByteBlock[dst + 270] = (byte) r;
  1173:                 sndByteBlock[dst + 271] = (byte) (r >> 8);
  1174:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1175:                 l = Math.max (-32768, Math.min (32767, 44 * YM2151.opmBuffer[src + 176] + 81 * YM2151.opmBuffer[src + 178]                             + 64 >> 7));
  1176:                 r = Math.max (-32768, Math.min (32767, 44 * YM2151.opmBuffer[src + 177] + 81 * YM2151.opmBuffer[src + 179]                             + 64 >> 7));
  1177:                 sndByteBlock[dst + 272] = (byte) l;
  1178:                 sndByteBlock[dst + 273] = (byte) (l >> 8);
  1179:                 sndByteBlock[dst + 274] = (byte) r;
  1180:                 sndByteBlock[dst + 275] = (byte) (r >> 8);
  1181:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1182:                 l = Math.max (-32768, Math.min (32767, 15 * YM2151.opmBuffer[src + 178] + 96 * YM2151.opmBuffer[src + 180] + 14 * YM2151.opmBuffer[src + 182] + 64 >> 7));
  1183:                 r = Math.max (-32768, Math.min (32767, 15 * YM2151.opmBuffer[src + 179] + 96 * YM2151.opmBuffer[src + 181] + 14 * YM2151.opmBuffer[src + 183] + 64 >> 7));
  1184:                 sndByteBlock[dst + 276] = (byte) l;
  1185:                 sndByteBlock[dst + 277] = (byte) (l >> 8);
  1186:                 sndByteBlock[dst + 278] = (byte) r;
  1187:                 sndByteBlock[dst + 279] = (byte) (r >> 8);
  1188:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1189:                 l = Math.max (-32768, Math.min (32767,                             82 * YM2151.opmBuffer[src + 182] + 43 * YM2151.opmBuffer[src + 184] + 64 >> 7));
  1190:                 r = Math.max (-32768, Math.min (32767,                             82 * YM2151.opmBuffer[src + 183] + 43 * YM2151.opmBuffer[src + 185] + 64 >> 7));
  1191:                 sndByteBlock[dst + 280] = (byte) l;
  1192:                 sndByteBlock[dst + 281] = (byte) (l >> 8);
  1193:                 sndByteBlock[dst + 282] = (byte) r;
  1194:                 sndByteBlock[dst + 283] = (byte) (r >> 8);
  1195:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1196:                 l = Math.max (-32768, Math.min (32767, 53 * YM2151.opmBuffer[src + 184] + 72 * YM2151.opmBuffer[src + 186]                             + 64 >> 7));
  1197:                 r = Math.max (-32768, Math.min (32767, 53 * YM2151.opmBuffer[src + 185] + 72 * YM2151.opmBuffer[src + 187]                             + 64 >> 7));
  1198:                 sndByteBlock[dst + 284] = (byte) l;
  1199:                 sndByteBlock[dst + 285] = (byte) (l >> 8);
  1200:                 sndByteBlock[dst + 286] = (byte) r;
  1201:                 sndByteBlock[dst + 287] = (byte) (r >> 8);
  1202:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1203:                 l = Math.max (-32768, Math.min (32767, 24 * YM2151.opmBuffer[src + 186] + 96 * YM2151.opmBuffer[src + 188] +  5 * YM2151.opmBuffer[src + 190] + 64 >> 7));
  1204:                 r = Math.max (-32768, Math.min (32767, 24 * YM2151.opmBuffer[src + 187] + 96 * YM2151.opmBuffer[src + 189] +  5 * YM2151.opmBuffer[src + 191] + 64 >> 7));
  1205:                 sndByteBlock[dst + 288] = (byte) l;
  1206:                 sndByteBlock[dst + 289] = (byte) (l >> 8);
  1207:                 sndByteBlock[dst + 290] = (byte) r;
  1208:                 sndByteBlock[dst + 291] = (byte) (r >> 8);
  1209:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1210:                 l = Math.max (-32768, Math.min (32767,                             91 * YM2151.opmBuffer[src + 190] + 34 * YM2151.opmBuffer[src + 192] + 64 >> 7));
  1211:                 r = Math.max (-32768, Math.min (32767,                             91 * YM2151.opmBuffer[src + 191] + 34 * YM2151.opmBuffer[src + 193] + 64 >> 7));
  1212:                 sndByteBlock[dst + 292] = (byte) l;
  1213:                 sndByteBlock[dst + 293] = (byte) (l >> 8);
  1214:                 sndByteBlock[dst + 294] = (byte) r;
  1215:                 sndByteBlock[dst + 295] = (byte) (r >> 8);
  1216:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1217:                 l = Math.max (-32768, Math.min (32767, 62 * YM2151.opmBuffer[src + 192] + 63 * YM2151.opmBuffer[src + 194]                             + 64 >> 7));
  1218:                 r = Math.max (-32768, Math.min (32767, 62 * YM2151.opmBuffer[src + 193] + 63 * YM2151.opmBuffer[src + 195]                             + 64 >> 7));
  1219:                 sndByteBlock[dst + 296] = (byte) l;
  1220:                 sndByteBlock[dst + 297] = (byte) (l >> 8);
  1221:                 sndByteBlock[dst + 298] = (byte) r;
  1222:                 sndByteBlock[dst + 299] = (byte) (r >> 8);
  1223:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1224:                 l = Math.max (-32768, Math.min (32767, 33 * YM2151.opmBuffer[src + 194] + 92 * YM2151.opmBuffer[src + 196]                             + 64 >> 7));
  1225:                 r = Math.max (-32768, Math.min (32767, 33 * YM2151.opmBuffer[src + 195] + 92 * YM2151.opmBuffer[src + 197]                             + 64 >> 7));
  1226:                 sndByteBlock[dst + 300] = (byte) l;
  1227:                 sndByteBlock[dst + 301] = (byte) (l >> 8);
  1228:                 sndByteBlock[dst + 302] = (byte) r;
  1229:                 sndByteBlock[dst + 303] = (byte) (r >> 8);
  1230:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1231:                 l = Math.max (-32768, Math.min (32767,  4 * YM2151.opmBuffer[src + 196] + 96 * YM2151.opmBuffer[src + 198] + 25 * YM2151.opmBuffer[src + 200] + 64 >> 7));
  1232:                 r = Math.max (-32768, Math.min (32767,  4 * YM2151.opmBuffer[src + 197] + 96 * YM2151.opmBuffer[src + 199] + 25 * YM2151.opmBuffer[src + 201] + 64 >> 7));
  1233:                 sndByteBlock[dst + 304] = (byte) l;
  1234:                 sndByteBlock[dst + 305] = (byte) (l >> 8);
  1235:                 sndByteBlock[dst + 306] = (byte) r;
  1236:                 sndByteBlock[dst + 307] = (byte) (r >> 8);
  1237:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1238:                 l = Math.max (-32768, Math.min (32767,                             71 * YM2151.opmBuffer[src + 200] + 54 * YM2151.opmBuffer[src + 202] + 64 >> 7));
  1239:                 r = Math.max (-32768, Math.min (32767,                             71 * YM2151.opmBuffer[src + 201] + 54 * YM2151.opmBuffer[src + 203] + 64 >> 7));
  1240:                 sndByteBlock[dst + 308] = (byte) l;
  1241:                 sndByteBlock[dst + 309] = (byte) (l >> 8);
  1242:                 sndByteBlock[dst + 310] = (byte) r;
  1243:                 sndByteBlock[dst + 311] = (byte) (r >> 8);
  1244:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1245:                 l = Math.max (-32768, Math.min (32767, 42 * YM2151.opmBuffer[src + 202] + 83 * YM2151.opmBuffer[src + 204]                             + 64 >> 7));
  1246:                 r = Math.max (-32768, Math.min (32767, 42 * YM2151.opmBuffer[src + 203] + 83 * YM2151.opmBuffer[src + 205]                             + 64 >> 7));
  1247:                 sndByteBlock[dst + 312] = (byte) l;
  1248:                 sndByteBlock[dst + 313] = (byte) (l >> 8);
  1249:                 sndByteBlock[dst + 314] = (byte) r;
  1250:                 sndByteBlock[dst + 315] = (byte) (r >> 8);
  1251:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1252:                 l = Math.max (-32768, Math.min (32767, 13 * YM2151.opmBuffer[src + 204] + 96 * YM2151.opmBuffer[src + 206] + 16 * YM2151.opmBuffer[src + 208] + 64 >> 7));
  1253:                 r = Math.max (-32768, Math.min (32767, 13 * YM2151.opmBuffer[src + 205] + 96 * YM2151.opmBuffer[src + 207] + 16 * YM2151.opmBuffer[src + 209] + 64 >> 7));
  1254:                 sndByteBlock[dst + 316] = (byte) l;
  1255:                 sndByteBlock[dst + 317] = (byte) (l >> 8);
  1256:                 sndByteBlock[dst + 318] = (byte) r;
  1257:                 sndByteBlock[dst + 319] = (byte) (r >> 8);
  1258:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1259:                 l = Math.max (-32768, Math.min (32767,                             80 * YM2151.opmBuffer[src + 208] + 45 * YM2151.opmBuffer[src + 210] + 64 >> 7));
  1260:                 r = Math.max (-32768, Math.min (32767,                             80 * YM2151.opmBuffer[src + 209] + 45 * YM2151.opmBuffer[src + 211] + 64 >> 7));
  1261:                 sndByteBlock[dst + 320] = (byte) l;
  1262:                 sndByteBlock[dst + 321] = (byte) (l >> 8);
  1263:                 sndByteBlock[dst + 322] = (byte) r;
  1264:                 sndByteBlock[dst + 323] = (byte) (r >> 8);
  1265:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1266:                 l = Math.max (-32768, Math.min (32767, 51 * YM2151.opmBuffer[src + 210] + 74 * YM2151.opmBuffer[src + 212]                             + 64 >> 7));
  1267:                 r = Math.max (-32768, Math.min (32767, 51 * YM2151.opmBuffer[src + 211] + 74 * YM2151.opmBuffer[src + 213]                             + 64 >> 7));
  1268:                 sndByteBlock[dst + 324] = (byte) l;
  1269:                 sndByteBlock[dst + 325] = (byte) (l >> 8);
  1270:                 sndByteBlock[dst + 326] = (byte) r;
  1271:                 sndByteBlock[dst + 327] = (byte) (r >> 8);
  1272:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1273:                 l = Math.max (-32768, Math.min (32767, 22 * YM2151.opmBuffer[src + 212] + 96 * YM2151.opmBuffer[src + 214] +  7 * YM2151.opmBuffer[src + 216] + 64 >> 7));
  1274:                 r = Math.max (-32768, Math.min (32767, 22 * YM2151.opmBuffer[src + 213] + 96 * YM2151.opmBuffer[src + 215] +  7 * YM2151.opmBuffer[src + 217] + 64 >> 7));
  1275:                 sndByteBlock[dst + 328] = (byte) l;
  1276:                 sndByteBlock[dst + 329] = (byte) (l >> 8);
  1277:                 sndByteBlock[dst + 330] = (byte) r;
  1278:                 sndByteBlock[dst + 331] = (byte) (r >> 8);
  1279:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1280:                 l = Math.max (-32768, Math.min (32767,                             89 * YM2151.opmBuffer[src + 216] + 36 * YM2151.opmBuffer[src + 218] + 64 >> 7));
  1281:                 r = Math.max (-32768, Math.min (32767,                             89 * YM2151.opmBuffer[src + 217] + 36 * YM2151.opmBuffer[src + 219] + 64 >> 7));
  1282:                 sndByteBlock[dst + 332] = (byte) l;
  1283:                 sndByteBlock[dst + 333] = (byte) (l >> 8);
  1284:                 sndByteBlock[dst + 334] = (byte) r;
  1285:                 sndByteBlock[dst + 335] = (byte) (r >> 8);
  1286:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1287:                 l = Math.max (-32768, Math.min (32767, 60 * YM2151.opmBuffer[src + 218] + 65 * YM2151.opmBuffer[src + 220]                             + 64 >> 7));
  1288:                 r = Math.max (-32768, Math.min (32767, 60 * YM2151.opmBuffer[src + 219] + 65 * YM2151.opmBuffer[src + 221]                             + 64 >> 7));
  1289:                 sndByteBlock[dst + 336] = (byte) l;
  1290:                 sndByteBlock[dst + 337] = (byte) (l >> 8);
  1291:                 sndByteBlock[dst + 338] = (byte) r;
  1292:                 sndByteBlock[dst + 339] = (byte) (r >> 8);
  1293:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1294:                 l = Math.max (-32768, Math.min (32767, 31 * YM2151.opmBuffer[src + 220] + 94 * YM2151.opmBuffer[src + 222]                             + 64 >> 7));
  1295:                 r = Math.max (-32768, Math.min (32767, 31 * YM2151.opmBuffer[src + 221] + 94 * YM2151.opmBuffer[src + 223]                             + 64 >> 7));
  1296:                 sndByteBlock[dst + 340] = (byte) l;
  1297:                 sndByteBlock[dst + 341] = (byte) (l >> 8);
  1298:                 sndByteBlock[dst + 342] = (byte) r;
  1299:                 sndByteBlock[dst + 343] = (byte) (r >> 8);
  1300:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1301:                 l = Math.max (-32768, Math.min (32767,  2 * YM2151.opmBuffer[src + 222] + 96 * YM2151.opmBuffer[src + 224] + 27 * YM2151.opmBuffer[src + 226] + 64 >> 7));
  1302:                 r = Math.max (-32768, Math.min (32767,  2 * YM2151.opmBuffer[src + 223] + 96 * YM2151.opmBuffer[src + 225] + 27 * YM2151.opmBuffer[src + 227] + 64 >> 7));
  1303:                 sndByteBlock[dst + 344] = (byte) l;
  1304:                 sndByteBlock[dst + 345] = (byte) (l >> 8);
  1305:                 sndByteBlock[dst + 346] = (byte) r;
  1306:                 sndByteBlock[dst + 347] = (byte) (r >> 8);
  1307:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1308:                 l = Math.max (-32768, Math.min (32767,                             69 * YM2151.opmBuffer[src + 226] + 56 * YM2151.opmBuffer[src + 228] + 64 >> 7));
  1309:                 r = Math.max (-32768, Math.min (32767,                             69 * YM2151.opmBuffer[src + 227] + 56 * YM2151.opmBuffer[src + 229] + 64 >> 7));
  1310:                 sndByteBlock[dst + 348] = (byte) l;
  1311:                 sndByteBlock[dst + 349] = (byte) (l >> 8);
  1312:                 sndByteBlock[dst + 350] = (byte) r;
  1313:                 sndByteBlock[dst + 351] = (byte) (r >> 8);
  1314:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1315:                 l = Math.max (-32768, Math.min (32767, 40 * YM2151.opmBuffer[src + 228] + 85 * YM2151.opmBuffer[src + 230]                             + 64 >> 7));
  1316:                 r = Math.max (-32768, Math.min (32767, 40 * YM2151.opmBuffer[src + 229] + 85 * YM2151.opmBuffer[src + 231]                             + 64 >> 7));
  1317:                 sndByteBlock[dst + 352] = (byte) l;
  1318:                 sndByteBlock[dst + 353] = (byte) (l >> 8);
  1319:                 sndByteBlock[dst + 354] = (byte) r;
  1320:                 sndByteBlock[dst + 355] = (byte) (r >> 8);
  1321:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1322:                 l = Math.max (-32768, Math.min (32767, 11 * YM2151.opmBuffer[src + 230] + 96 * YM2151.opmBuffer[src + 232] + 18 * YM2151.opmBuffer[src + 234] + 64 >> 7));
  1323:                 r = Math.max (-32768, Math.min (32767, 11 * YM2151.opmBuffer[src + 231] + 96 * YM2151.opmBuffer[src + 233] + 18 * YM2151.opmBuffer[src + 235] + 64 >> 7));
  1324:                 sndByteBlock[dst + 356] = (byte) l;
  1325:                 sndByteBlock[dst + 357] = (byte) (l >> 8);
  1326:                 sndByteBlock[dst + 358] = (byte) r;
  1327:                 sndByteBlock[dst + 359] = (byte) (r >> 8);
  1328:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1329:                 l = Math.max (-32768, Math.min (32767,                             78 * YM2151.opmBuffer[src + 234] + 47 * YM2151.opmBuffer[src + 236] + 64 >> 7));
  1330:                 r = Math.max (-32768, Math.min (32767,                             78 * YM2151.opmBuffer[src + 235] + 47 * YM2151.opmBuffer[src + 237] + 64 >> 7));
  1331:                 sndByteBlock[dst + 360] = (byte) l;
  1332:                 sndByteBlock[dst + 361] = (byte) (l >> 8);
  1333:                 sndByteBlock[dst + 362] = (byte) r;
  1334:                 sndByteBlock[dst + 363] = (byte) (r >> 8);
  1335:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1336:                 l = Math.max (-32768, Math.min (32767, 49 * YM2151.opmBuffer[src + 236] + 76 * YM2151.opmBuffer[src + 238]                             + 64 >> 7));
  1337:                 r = Math.max (-32768, Math.min (32767, 49 * YM2151.opmBuffer[src + 237] + 76 * YM2151.opmBuffer[src + 239]                             + 64 >> 7));
  1338:                 sndByteBlock[dst + 364] = (byte) l;
  1339:                 sndByteBlock[dst + 365] = (byte) (l >> 8);
  1340:                 sndByteBlock[dst + 366] = (byte) r;
  1341:                 sndByteBlock[dst + 367] = (byte) (r >> 8);
  1342:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1343:                 l = Math.max (-32768, Math.min (32767, 20 * YM2151.opmBuffer[src + 238] + 96 * YM2151.opmBuffer[src + 240] +  9 * YM2151.opmBuffer[src + 242] + 64 >> 7));
  1344:                 r = Math.max (-32768, Math.min (32767, 20 * YM2151.opmBuffer[src + 239] + 96 * YM2151.opmBuffer[src + 241] +  9 * YM2151.opmBuffer[src + 243] + 64 >> 7));
  1345:                 sndByteBlock[dst + 368] = (byte) l;
  1346:                 sndByteBlock[dst + 369] = (byte) (l >> 8);
  1347:                 sndByteBlock[dst + 370] = (byte) r;
  1348:                 sndByteBlock[dst + 371] = (byte) (r >> 8);
  1349:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1350:                 l = Math.max (-32768, Math.min (32767,                             87 * YM2151.opmBuffer[src + 242] + 38 * YM2151.opmBuffer[src + 244] + 64 >> 7));
  1351:                 r = Math.max (-32768, Math.min (32767,                             87 * YM2151.opmBuffer[src + 243] + 38 * YM2151.opmBuffer[src + 245] + 64 >> 7));
  1352:                 sndByteBlock[dst + 372] = (byte) l;
  1353:                 sndByteBlock[dst + 373] = (byte) (l >> 8);
  1354:                 sndByteBlock[dst + 374] = (byte) r;
  1355:                 sndByteBlock[dst + 375] = (byte) (r >> 8);
  1356:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1357:                 l = Math.max (-32768, Math.min (32767, 58 * YM2151.opmBuffer[src + 244] + 67 * YM2151.opmBuffer[src + 246]                             + 64 >> 7));
  1358:                 r = Math.max (-32768, Math.min (32767, 58 * YM2151.opmBuffer[src + 245] + 67 * YM2151.opmBuffer[src + 247]                             + 64 >> 7));
  1359:                 sndByteBlock[dst + 376] = (byte) l;
  1360:                 sndByteBlock[dst + 377] = (byte) (l >> 8);
  1361:                 sndByteBlock[dst + 378] = (byte) r;
  1362:                 sndByteBlock[dst + 379] = (byte) (r >> 8);
  1363:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1364:                 l = Math.max (-32768, Math.min (32767, 29 * YM2151.opmBuffer[src + 246] + 96 * YM2151.opmBuffer[src + 248]                             + 64 >> 7));
  1365:                 r = Math.max (-32768, Math.min (32767, 29 * YM2151.opmBuffer[src + 247] + 96 * YM2151.opmBuffer[src + 249]                             + 64 >> 7));
  1366:                 sndByteBlock[dst + 380] = (byte) l;
  1367:                 sndByteBlock[dst + 381] = (byte) (l >> 8);
  1368:                 sndByteBlock[dst + 382] = (byte) r;
  1369:                 sndByteBlock[dst + 383] = (byte) (r >> 8);
  1370:                 sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1371:         }  //for src,dst
  1372:       }  //convert(int)
  1373:     },  //SNDRateConverter.CONSTANT_AREA_STEREO_48000
  1374: 
  1375:     //線形面積補間
  1376:     //  S44PLAY.Xの-sqの方法
  1377:     //    S44PLAY.Xで-hqよりも-sqのほうが綺麗に聞こえた(ような気がした)のは線形補間よりも面積補間の方がローパスフィルタとしての性能が高かったからかも知れない
  1378:     //  入力データを線形補間した波形を出力サンプリング間隔で刻み、各断片の平均の変位(断片の面積に比例する)を出力データとする
  1379:     //  入力サンプリング位置における入力データと出力サンプリング位置における線形補間された入力データを台形の上辺または下辺と見なすと、
  1380:     //  線形補間された入力データを出力サンプリング間隔で刻んだ各断片は複数の台形を繋ぎ合わせた形になる
  1381:     //  台形の面積は(上辺+下辺)×高さ÷2であるから、断片の面積は近隣の入力データの線形結合で表現できる
  1382:     //  出力周波数が入力周波数の1/2倍~1倍のとき、1個の出力データを求めるために3個または4個の入力データが必要になる
  1383:     //  末尾のデータを作るために次のブロックの先頭のデータが必要になるが、代わりに前のブロックの末尾のデータをブロックの先頭に加える
  1384:     //  OPMとPCMを合成するときにずらせばオーバーヘッドは最小限で済む
  1385:     //  7Hz→5Hzの場合
  1386:     //    a....b....c....d....e....f....g....h
  1387:     //    AAAAAAABBBBBBBCCCCCCCDDDDDDDEEEEEEE
  1388:     //      A=(( a + b )* 5 /2+( b + (3*b+2*c)/5 )* 2 /2)/7                           = 5/14*a + 41/70*b + 2/35*c
  1389:     //      B=(( (3*b+2*c)/5 + c )* 3 /2+( c + (1*c+4*d)/5 )* 4 /2)/7                 = 9/70*b + 9/14*c + 8/35*d
  1390:     //      C=(( (1*c+4*d)/5 + d )* 1 /2+( d + e )* 5 /2+( e + (4*e+1*f)/5 )* 1 /2)/7 = 1/70*c + 17/35*d + 17/35*e + 1/70*f
  1391:     //      D=(( (4*e+1*f)/5 + f )* 4 /2+( f + (2*f+3*g)/5 )* 3 /2)/7                 = 8/35*e + 9/14*f + 9/70*g
  1392:     //      E=(( (2*f+3*g)/5 + g )* 2 /2+( g + h )* 5 /2)/7                           = 2/35*f + 41/70*g + 5/14*h
  1393:     //    perl -e "$m=7;$n=5;@w=();for$i(0..$m){$k=$n*$i;push@w,[$k,'s['.$i.']']}for$j(0..$n-1){$k=$m*$j;$r=$k%$n;$r or next;$q=($k-$r)/$n;push@w,[$k,'('.($n-$r).'*s['.$q.']+'.$r.'*s['.($q+1).'])/'.$n]}@w=sort{$a->[0]<=>$b->[0]}@w;for$j(0..$n-1){$k=$m*$j;@v=grep{$k<=$_->[0]&&$_->[0]<=$k+$m}@w;@d=();for$i(0..@v-2){push@d,'('.$v[$i]->[1].'+'.$v[$i+1]->[1].')*'.($v[$i+1]->[0]-$v[$i]->[0]).'/2'}printf'    //      d[%d]=(%s)/%d;%c',$j,join('+',@d),$m,10}"
  1394:     //      d[0]=((s[0]+s[1])*5/2+(s[1]+(3*s[1]+2*s[2])/5)*2/2)/7;
  1395:     //      d[1]=(((3*s[1]+2*s[2])/5+s[2])*3/2+(s[2]+(1*s[2]+4*s[3])/5)*4/2)/7;
  1396:     //      d[2]=(((1*s[2]+4*s[3])/5+s[3])*1/2+(s[3]+s[4])*5/2+(s[4]+(4*s[4]+1*s[5])/5)*1/2)/7;
  1397:     //      d[3]=(((4*s[4]+1*s[5])/5+s[5])*4/2+(s[5]+(2*s[5]+3*s[6])/5)*3/2)/7;
  1398:     //      d[4]=(((2*s[5]+3*s[6])/5+s[6])*2/2+(s[6]+s[7])*5/2)/7;
  1399:     //    perl -e "$m=7;$n=5;sub str{my($t)=@_;my@s=();for my$k(sort{$a<=>$b}keys%$t){push@s,$t->{$k}.'*s['.$k.']'}join'+',@s}sub mul{my($t,$m)=@_;my$p={};for my$k(keys%$t){$p->{$k}=$t->{$k}*$m}$p}sub add{my($t,$u)=@_;my$s={};for my$k(keys%$t){$s->{$k}=$t->{$k}};for my$k(keys%$u){$s->{$k}=($s->{$k}//0)+$u->{$k}}$s}@w=();for$i(0..$m){$k=$n*$i;$t={};$t->{$i}=1;push@w,[$k,$t]}for$j(0..$n-1){$k=$m*$j;$r=$k%$n;$r or next;$q=($k-$r)/$n;$t={};$t->{$q}=($n-$r)/$n;$t->{$q+1}=$r/$n;push@w,[$k,$t];}@w=sort{$a->[0]<=>$b->[0]}@w;for$j(0..$n-1){$k=$m*$j;@v=grep{$k<=$_->[0]&&$_->[0]<=$k+$m}@w;$d={};for$i(0..@v-2){$d=add($d,mul(add($v[$i]->[1],$v[$i+1]->[1]),($v[$i+1]->[0]-$v[$i]->[0])))}$d=mul($d,1/(2*$m));printf'    //      d[%d]=%s;%c',$j,str($d),10}"
  1400:     //      d[0]=0.357142857142857*s[0]+0.585714285714286*s[1]+0.0571428571428571*s[2];
  1401:     //      d[1]=0.128571428571429*s[1]+0.642857142857143*s[2]+0.228571428571429*s[3];
  1402:     //      d[2]=0.0142857142857143*s[2]+0.485714285714286*s[3]+0.485714285714286*s[4]+0.0142857142857143*s[5];
  1403:     //      d[3]=0.228571428571429*s[4]+0.642857142857143*s[5]+0.128571428571429*s[6];
  1404:     //      d[4]=0.0571428571428571*s[5]+0.585714285714286*s[6]+0.357142857142857*s[7];
  1405: 
  1406:     //線形面積補間,ステレオ,48kHz
  1407:     LINEAR_AREA_STEREO_48000 {
  1408:       @Override public void convert (int outputSamples) {
  1409:         if (false) {  //long
  1410:           //OPMとPCMを合わせてボリュームを掛ける。ついでに後ろに1サンプルずらす
  1411:           int l = YM2151.opmBuffer[2 * YM2151.OPM_BLOCK_SAMPLES    ];  //前回の最後のデータ
  1412:           int r = YM2151.opmBuffer[2 * YM2151.OPM_BLOCK_SAMPLES + 1];
  1413:           for (int src = 0; src < 2 * YM2151.OPM_BLOCK_SAMPLES; src += 2) {
  1414:             int t;
  1415:             t = (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src    ] + ADPCM.pcmBuffer[src    ] :
  1416:                  YM2151.OPM_ON           ? YM2151.opmBuffer[src    ]                      :
  1417:                  ADPCM.PCM_ON           ?                      ADPCM.pcmBuffer[src    ] :
  1418:                  0) * sndCurrentScale >> 12;
  1419:             YM2151.opmBuffer[src    ] = l;
  1420:             l = t;
  1421:             t = (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src + 1] + ADPCM.pcmBuffer[src + 1] :
  1422:                  YM2151.OPM_ON           ? YM2151.opmBuffer[src + 1]                      :
  1423:                  ADPCM.PCM_ON           ?                      ADPCM.pcmBuffer[src + 1] :
  1424:                  0) * sndCurrentScale >> 12;
  1425:             YM2151.opmBuffer[src + 1] = r;
  1426:             r = t;
  1427:             sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  1428:           }
  1429:           YM2151.opmBuffer[2 * YM2151.OPM_BLOCK_SAMPLES    ] = l;  //今回の最後のデータ
  1430:           YM2151.opmBuffer[2 * YM2151.OPM_BLOCK_SAMPLES + 1] = r;
  1431:           //線形面積補間(long)
  1432:           //  通分したときの分母は2*125*96=24000だが、24000*11=264000≒262144=1<<18なので、
  1433:           //  24000で割る代わりに係数を11倍して除算を右18bitシフトで済ませている
  1434:           //  本来の値よりもわずかに大きい値(264000/242144倍)が出力される
  1435:           for (int src = 0, dst = 0; src < 2 * YM2151.OPM_BLOCK_SAMPLES; src += 2 * 125, dst += 4 * 96) {
  1436:             int t;
  1437:             long u, v;
  1438:             //  perl -e "$m=125;$n=96;$CH=2;$I=12;sub str{my($t,$lr)=@_;my@s=();for my$k(sort{$a<=>$b}keys%$t){push@s,$t->{$k}.'L * YM2151.opmBuffer[src'.($CH*$k+$lr?' + '.($CH*$k+$lr):'').']'}join' + ',@s}sub mul{my($t,$m)=@_;my$p={};for my$k(keys%$t){$p->{$k}=$t->{$k}*$m}$p}sub add{my($t,$u)=@_;my$s={};for my$k(keys%$t){$s->{$k}=$t->{$k}};for my$k(keys%$u){$s->{$k}=($s->{$k}//0)+$u->{$k}}$s}@out=();@w=();for$i(0..$m){$k=$n*$i;$t={};$t->{$i}=1;push@w,[$k,$t]}for$j(0..$n-1){$k=$m*$j;$r=$k%$n;$r or next;$q=($k-$r)/$n;$t={};$t->{$q}=($n-$r)/$n;$t->{$q+1}=$r/$n;push@w,[$k,$t];}@w=sort{$a->[0]<=>$b->[0]}@w;for$lr(0..$CH-1){push@out,sprintf'%*s//%s%c',$I,'',$CH==1?'mid':$lr?'right':'left',10;for$j(0..$n-1){$k=$m*$j;@v=grep{$k<=$_->[0]&&$_->[0]<=$k+$m}@w;$d={};for$i(0..@v-2){$d=add($d,mul(add($v[$i]->[1],$v[$i+1]->[1]),($v[$i+1]->[0]-$v[$i]->[0])))}$d=mul($d,11*$n);push@out,sprintf'%*st = Math.max (-32768, Math.min (32767, (int) (%s + 131072L >> 18)));%c',$I,'',str($d,$lr),10;push@out,sprintf'%*ssndByteBlock[dst'.(2*($CH*$j+$lr)+0?' + '.(2*($CH*$j+$lr)+0):'').'] = (byte) t;%c',$I,'',10;push@out,sprintf'%*ssndByteBlock[dst + '.(2*($CH*$j+$lr)+1).'] = (byte) (t >> 8);%c',$I,'',10;}}$out=join'',@out;$out2='';%flag=();while($out=~/YM2151.opmBuffer\[src(?: \+ (\d+))?\]/){$out2.=$`;$out=$';$s=$&;$i=int(($1//0)/$CH);if($i==0||$i==$m){$out2.='(long) '.$s}else{$uv=$i%2?'v':'u';if(exists$flag{$s}){$out2.=$uv}else{$flag{$s}=1;$out2.='('.$uv.' = (long) '.$s.')'}}}$out2.=$out;print$out2"
  1439:             //left
  1440:             t = Math.max (-32768, Math.min (32767, (int) (101376L * (long) YM2151.opmBuffer[src] + 153373L * (v = (long) YM2151.opmBuffer[src + 2]) + 9251L * (u = (long) YM2151.opmBuffer[src + 4]) + 131072L >> 18)));
  1441:             sndByteBlock[dst] = (byte) t;
  1442:             sndByteBlock[dst + 1] = (byte) (t >> 8);
  1443:             t = Math.max (-32768, Math.min (32767, (int) (49379L * v + 177617L * u + 37004L * (v = (long) YM2151.opmBuffer[src + 6]) + 131072L >> 18)));
  1444:             sndByteBlock[dst + 4] = (byte) t;
  1445:             sndByteBlock[dst + 5] = (byte) (t >> 8);
  1446:             t = Math.max (-32768, Math.min (32767, (int) (15884L * u + 164857L * v + 83259L * (u = (long) YM2151.opmBuffer[src + 8]) + 131072L >> 18)));
  1447:             sndByteBlock[dst + 8] = (byte) t;
  1448:             sndByteBlock[dst + 9] = (byte) (t >> 8);
  1449:             t = Math.max (-32768, Math.min (32767, (int) (891L * v + 119493L * u + 139216L * (v = (long) YM2151.opmBuffer[src + 10]) + 4400L * (u = (long) YM2151.opmBuffer[src + 12]) + 131072L >> 18)));
  1450:             sndByteBlock[dst + 12] = (byte) t;
  1451:             sndByteBlock[dst + 13] = (byte) (t >> 8);
  1452:             t = Math.max (-32768, Math.min (32767, (int) (63536L * v + 174053L * u + 26411L * (v = (long) YM2151.opmBuffer[src + 14]) + 131072L >> 18)));
  1453:             sndByteBlock[dst + 16] = (byte) t;
  1454:             sndByteBlock[dst + 17] = (byte) (t >> 8);
  1455:             t = Math.max (-32768, Math.min (32767, (int) (24299L * u + 172777L * v + 66924L * (u = (long) YM2151.opmBuffer[src + 16]) + 131072L >> 18)));
  1456:             sndByteBlock[dst + 20] = (byte) t;
  1457:             sndByteBlock[dst + 21] = (byte) (t >> 8);
  1458:             t = Math.max (-32768, Math.min (32767, (int) (3564L * v + 135828L * u + 123277L * (v = (long) YM2151.opmBuffer[src + 18]) + 1331L * (u = (long) YM2151.opmBuffer[src + 20]) + 131072L >> 18)));
  1459:             sndByteBlock[dst + 24] = (byte) t;
  1460:             sndByteBlock[dst + 25] = (byte) (t >> 8);
  1461:             t = Math.max (-32768, Math.min (32767, (int) (79475L * v + 166925L * u + 17600L * (v = (long) YM2151.opmBuffer[src + 22]) + 131072L >> 18)));
  1462:             sndByteBlock[dst + 28] = (byte) t;
  1463:             sndByteBlock[dst + 29] = (byte) (t >> 8);
  1464:             t = Math.max (-32768, Math.min (32767, (int) (34496L * u + 177133L * v + 52371L * (u = (long) YM2151.opmBuffer[src + 24]) + 131072L >> 18)));
  1465:             sndByteBlock[dst + 32] = (byte) t;
  1466:             sndByteBlock[dst + 33] = (byte) (t >> 8);
  1467:             t = Math.max (-32768, Math.min (32767, (int) (8019L * v + 150381L * u + 105556L * (v = (long) YM2151.opmBuffer[src + 26]) + 44L * (u = (long) YM2151.opmBuffer[src + 28]) + 131072L >> 18)));
  1468:             sndByteBlock[dst + 36] = (byte) t;
  1469:             sndByteBlock[dst + 37] = (byte) (t >> 8);
  1470:             t = Math.max (-32768, Math.min (32767, (int) (97196L * v + 156233L * u + 10571L * (v = (long) YM2151.opmBuffer[src + 30]) + 131072L >> 18)));
  1471:             sndByteBlock[dst + 40] = (byte) t;
  1472:             sndByteBlock[dst + 41] = (byte) (t >> 8);
  1473:             t = Math.max (-32768, Math.min (32767, (int) (46475L * u + 177925L * v + 39600L * (u = (long) YM2151.opmBuffer[src + 32]) + 131072L >> 18)));
  1474:             sndByteBlock[dst + 44] = (byte) t;
  1475:             sndByteBlock[dst + 45] = (byte) (t >> 8);
  1476:             t = Math.max (-32768, Math.min (32767, (int) (14256L * v + 162613L * u + 87131L * (v = (long) YM2151.opmBuffer[src + 34]) + 131072L >> 18)));
  1477:             sndByteBlock[dst + 48] = (byte) t;
  1478:             sndByteBlock[dst + 49] = (byte) (t >> 8);
  1479:             t = Math.max (-32768, Math.min (32767, (int) (539L * u + 115621L * v + 142516L * (u = (long) YM2151.opmBuffer[src + 36]) + 5324L * (v = (long) YM2151.opmBuffer[src + 38]) + 131072L >> 18)));
  1480:             sndByteBlock[dst + 52] = (byte) t;
  1481:             sndByteBlock[dst + 53] = (byte) (t >> 8);
  1482:             t = Math.max (-32768, Math.min (32767, (int) (60236L * u + 175153L * v + 28611L * (u = (long) YM2151.opmBuffer[src + 40]) + 131072L >> 18)));
  1483:             sndByteBlock[dst + 56] = (byte) t;
  1484:             sndByteBlock[dst + 57] = (byte) (t >> 8);
  1485:             t = Math.max (-32768, Math.min (32767, (int) (22275L * v + 171325L * u + 70400L * (v = (long) YM2151.opmBuffer[src + 42]) + 131072L >> 18)));
  1486:             sndByteBlock[dst + 60] = (byte) t;
  1487:             sndByteBlock[dst + 61] = (byte) (t >> 8);
  1488:             t = Math.max (-32768, Math.min (32767, (int) (2816L * u + 132352L * v + 126973L * (u = (long) YM2151.opmBuffer[src + 44]) + 1859L * (v = (long) YM2151.opmBuffer[src + 46]) + 131072L >> 18)));
  1489:             sndByteBlock[dst + 64] = (byte) t;
  1490:             sndByteBlock[dst + 65] = (byte) (t >> 8);
  1491:             t = Math.max (-32768, Math.min (32767, (int) (75779L * u + 168817L * v + 19404L * (u = (long) YM2151.opmBuffer[src + 48]) + 131072L >> 18)));
  1492:             sndByteBlock[dst + 68] = (byte) t;
  1493:             sndByteBlock[dst + 69] = (byte) (t >> 8);
  1494:             t = Math.max (-32768, Math.min (32767, (int) (32076L * v + 176473L * u + 55451L * (v = (long) YM2151.opmBuffer[src + 50]) + 131072L >> 18)));
  1495:             sndByteBlock[dst + 72] = (byte) t;
  1496:             sndByteBlock[dst + 73] = (byte) (t >> 8);
  1497:             t = Math.max (-32768, Math.min (32767, (int) (6875L * u + 147301L * v + 109648L * (u = (long) YM2151.opmBuffer[src + 52]) + 176L * (v = (long) YM2151.opmBuffer[src + 54]) + 131072L >> 18)));
  1498:             sndByteBlock[dst + 76] = (byte) t;
  1499:             sndByteBlock[dst + 77] = (byte) (t >> 8);
  1500:             t = Math.max (-32768, Math.min (32767, (int) (93104L * u + 158917L * v + 11979L * (u = (long) YM2151.opmBuffer[src + 56]) + 131072L >> 18)));
  1501:             sndByteBlock[dst + 80] = (byte) t;
  1502:             sndByteBlock[dst + 81] = (byte) (t >> 8);
  1503:             t = Math.max (-32768, Math.min (32767, (int) (43659L * v + 178057L * u + 42284L * (v = (long) YM2151.opmBuffer[src + 58]) + 131072L >> 18)));
  1504:             sndByteBlock[dst + 84] = (byte) t;
  1505:             sndByteBlock[dst + 85] = (byte) (t >> 8);
  1506:             t = Math.max (-32768, Math.min (32767, (int) (12716L * u + 160193L * v + 91091L * (u = (long) YM2151.opmBuffer[src + 60]) + 131072L >> 18)));
  1507:             sndByteBlock[dst + 88] = (byte) t;
  1508:             sndByteBlock[dst + 89] = (byte) (t >> 8);
  1509:             t = Math.max (-32768, Math.min (32767, (int) (275L * v + 111661L * u + 145728L * (v = (long) YM2151.opmBuffer[src + 62]) + 6336L * (u = (long) YM2151.opmBuffer[src + 64]) + 131072L >> 18)));
  1510:             sndByteBlock[dst + 92] = (byte) t;
  1511:             sndByteBlock[dst + 93] = (byte) (t >> 8);
  1512:             t = Math.max (-32768, Math.min (32767, (int) (57024L * v + 176077L * u + 30899L * (v = (long) YM2151.opmBuffer[src + 66]) + 131072L >> 18)));
  1513:             sndByteBlock[dst + 96] = (byte) t;
  1514:             sndByteBlock[dst + 97] = (byte) (t >> 8);
  1515:             t = Math.max (-32768, Math.min (32767, (int) (20339L * u + 169697L * v + 73964L * (u = (long) YM2151.opmBuffer[src + 68]) + 131072L >> 18)));
  1516:             sndByteBlock[dst + 100] = (byte) t;
  1517:             sndByteBlock[dst + 101] = (byte) (t >> 8);
  1518:             t = Math.max (-32768, Math.min (32767, (int) (2156L * v + 128788L * u + 130581L * (v = (long) YM2151.opmBuffer[src + 70]) + 2475L * (u = (long) YM2151.opmBuffer[src + 72]) + 131072L >> 18)));
  1519:             sndByteBlock[dst + 104] = (byte) t;
  1520:             sndByteBlock[dst + 105] = (byte) (t >> 8);
  1521:             t = Math.max (-32768, Math.min (32767, (int) (72171L * v + 170533L * u + 21296L * (v = (long) YM2151.opmBuffer[src + 74]) + 131072L >> 18)));
  1522:             sndByteBlock[dst + 108] = (byte) t;
  1523:             sndByteBlock[dst + 109] = (byte) (t >> 8);
  1524:             t = Math.max (-32768, Math.min (32767, (int) (29744L * u + 175637L * v + 58619L * (u = (long) YM2151.opmBuffer[src + 76]) + 131072L >> 18)));
  1525:             sndByteBlock[dst + 112] = (byte) t;
  1526:             sndByteBlock[dst + 113] = (byte) (t >> 8);
  1527:             t = Math.max (-32768, Math.min (32767, (int) (5819L * v + 144133L * u + 113652L * (v = (long) YM2151.opmBuffer[src + 78]) + 396L * (u = (long) YM2151.opmBuffer[src + 80]) + 131072L >> 18)));
  1528:             sndByteBlock[dst + 116] = (byte) t;
  1529:             sndByteBlock[dst + 117] = (byte) (t >> 8);
  1530:             t = Math.max (-32768, Math.min (32767, (int) (89100L * v + 161425L * u + 13475L * (v = (long) YM2151.opmBuffer[src + 82]) + 131072L >> 18)));
  1531:             sndByteBlock[dst + 120] = (byte) t;
  1532:             sndByteBlock[dst + 121] = (byte) (t >> 8);
  1533:             t = Math.max (-32768, Math.min (32767, (int) (40931L * u + 178013L * v + 45056L * (u = (long) YM2151.opmBuffer[src + 84]) + 131072L >> 18)));
  1534:             sndByteBlock[dst + 124] = (byte) t;
  1535:             sndByteBlock[dst + 125] = (byte) (t >> 8);
  1536:             t = Math.max (-32768, Math.min (32767, (int) (11264L * v + 157597L * u + 95139L * (v = (long) YM2151.opmBuffer[src + 86]) + 131072L >> 18)));
  1537:             sndByteBlock[dst + 128] = (byte) t;
  1538:             sndByteBlock[dst + 129] = (byte) (t >> 8);
  1539:             t = Math.max (-32768, Math.min (32767, (int) (99L * u + 107613L * v + 148852L * (u = (long) YM2151.opmBuffer[src + 88]) + 7436L * (v = (long) YM2151.opmBuffer[src + 90]) + 131072L >> 18)));
  1540:             sndByteBlock[dst + 132] = (byte) t;
  1541:             sndByteBlock[dst + 133] = (byte) (t >> 8);
  1542:             t = Math.max (-32768, Math.min (32767, (int) (53900L * u + 176825L * v + 33275L * (u = (long) YM2151.opmBuffer[src + 92]) + 131072L >> 18)));
  1543:             sndByteBlock[dst + 136] = (byte) t;
  1544:             sndByteBlock[dst + 137] = (byte) (t >> 8);
  1545:             t = Math.max (-32768, Math.min (32767, (int) (18491L * v + 167893L * u + 77616L * (v = (long) YM2151.opmBuffer[src + 94]) + 131072L >> 18)));
  1546:             sndByteBlock[dst + 140] = (byte) t;
  1547:             sndByteBlock[dst + 141] = (byte) (t >> 8);
  1548:             t = Math.max (-32768, Math.min (32767, (int) (1584L * u + 125136L * v + 134101L * (u = (long) YM2151.opmBuffer[src + 96]) + 3179L * (v = (long) YM2151.opmBuffer[src + 98]) + 131072L >> 18)));
  1549:             sndByteBlock[dst + 144] = (byte) t;
  1550:             sndByteBlock[dst + 145] = (byte) (t >> 8);
  1551:             t = Math.max (-32768, Math.min (32767, (int) (68651L * u + 172073L * v + 23276L * (u = (long) YM2151.opmBuffer[src + 100]) + 131072L >> 18)));
  1552:             sndByteBlock[dst + 148] = (byte) t;
  1553:             sndByteBlock[dst + 149] = (byte) (t >> 8);
  1554:             t = Math.max (-32768, Math.min (32767, (int) (27500L * v + 174625L * u + 61875L * (v = (long) YM2151.opmBuffer[src + 102]) + 131072L >> 18)));
  1555:             sndByteBlock[dst + 152] = (byte) t;
  1556:             sndByteBlock[dst + 153] = (byte) (t >> 8);
  1557:             t = Math.max (-32768, Math.min (32767, (int) (4851L * u + 140877L * v + 117568L * (u = (long) YM2151.opmBuffer[src + 104]) + 704L * (v = (long) YM2151.opmBuffer[src + 106]) + 131072L >> 18)));
  1558:             sndByteBlock[dst + 156] = (byte) t;
  1559:             sndByteBlock[dst + 157] = (byte) (t >> 8);
  1560:             t = Math.max (-32768, Math.min (32767, (int) (85184L * u + 163757L * v + 15059L * (u = (long) YM2151.opmBuffer[src + 108]) + 131072L >> 18)));
  1561:             sndByteBlock[dst + 160] = (byte) t;
  1562:             sndByteBlock[dst + 161] = (byte) (t >> 8);
  1563:             t = Math.max (-32768, Math.min (32767, (int) (38291L * v + 177793L * u + 47916L * (v = (long) YM2151.opmBuffer[src + 110]) + 131072L >> 18)));
  1564:             sndByteBlock[dst + 164] = (byte) t;
  1565:             sndByteBlock[dst + 165] = (byte) (t >> 8);
  1566:             t = Math.max (-32768, Math.min (32767, (int) (9900L * u + 154825L * v + 99275L * (u = (long) YM2151.opmBuffer[src + 112]) + 131072L >> 18)));
  1567:             sndByteBlock[dst + 168] = (byte) t;
  1568:             sndByteBlock[dst + 169] = (byte) (t >> 8);
  1569:             t = Math.max (-32768, Math.min (32767, (int) (11L * v + 103477L * u + 151888L * (v = (long) YM2151.opmBuffer[src + 114]) + 8624L * (u = (long) YM2151.opmBuffer[src + 116]) + 131072L >> 18)));
  1570:             sndByteBlock[dst + 172] = (byte) t;
  1571:             sndByteBlock[dst + 173] = (byte) (t >> 8);
  1572:             t = Math.max (-32768, Math.min (32767, (int) (50864L * v + 177397L * u + 35739L * (v = (long) YM2151.opmBuffer[src + 118]) + 131072L >> 18)));
  1573:             sndByteBlock[dst + 176] = (byte) t;
  1574:             sndByteBlock[dst + 177] = (byte) (t >> 8);
  1575:             t = Math.max (-32768, Math.min (32767, (int) (16731L * u + 165913L * v + 81356L * (u = (long) YM2151.opmBuffer[src + 120]) + 131072L >> 18)));
  1576:             sndByteBlock[dst + 180] = (byte) t;
  1577:             sndByteBlock[dst + 181] = (byte) (t >> 8);
  1578:             t = Math.max (-32768, Math.min (32767, (int) (1100L * v + 121396L * u + 137533L * (v = (long) YM2151.opmBuffer[src + 122]) + 3971L * (u = (long) YM2151.opmBuffer[src + 124]) + 131072L >> 18)));
  1579:             sndByteBlock[dst + 184] = (byte) t;
  1580:             sndByteBlock[dst + 185] = (byte) (t >> 8);
  1581:             t = Math.max (-32768, Math.min (32767, (int) (65219L * v + 173437L * u + 25344L * (v = (long) YM2151.opmBuffer[src + 126]) + 131072L >> 18)));
  1582:             sndByteBlock[dst + 188] = (byte) t;
  1583:             sndByteBlock[dst + 189] = (byte) (t >> 8);
  1584:             t = Math.max (-32768, Math.min (32767, (int) (25344L * u + 173437L * v + 65219L * (u = (long) YM2151.opmBuffer[src + 128]) + 131072L >> 18)));
  1585:             sndByteBlock[dst + 192] = (byte) t;
  1586:             sndByteBlock[dst + 193] = (byte) (t >> 8);
  1587:             t = Math.max (-32768, Math.min (32767, (int) (3971L * v + 137533L * u + 121396L * (v = (long) YM2151.opmBuffer[src + 130]) + 1100L * (u = (long) YM2151.opmBuffer[src + 132]) + 131072L >> 18)));
  1588:             sndByteBlock[dst + 196] = (byte) t;
  1589:             sndByteBlock[dst + 197] = (byte) (t >> 8);
  1590:             t = Math.max (-32768, Math.min (32767, (int) (81356L * v + 165913L * u + 16731L * (v = (long) YM2151.opmBuffer[src + 134]) + 131072L >> 18)));
  1591:             sndByteBlock[dst + 200] = (byte) t;
  1592:             sndByteBlock[dst + 201] = (byte) (t >> 8);
  1593:             t = Math.max (-32768, Math.min (32767, (int) (35739L * u + 177397L * v + 50864L * (u = (long) YM2151.opmBuffer[src + 136]) + 131072L >> 18)));
  1594:             sndByteBlock[dst + 204] = (byte) t;
  1595:             sndByteBlock[dst + 205] = (byte) (t >> 8);
  1596:             t = Math.max (-32768, Math.min (32767, (int) (8624L * v + 151888L * u + 103477L * (v = (long) YM2151.opmBuffer[src + 138]) + 11L * (u = (long) YM2151.opmBuffer[src + 140]) + 131072L >> 18)));
  1597:             sndByteBlock[dst + 208] = (byte) t;
  1598:             sndByteBlock[dst + 209] = (byte) (t >> 8);
  1599:             t = Math.max (-32768, Math.min (32767, (int) (99275L * v + 154825L * u + 9900L * (v = (long) YM2151.opmBuffer[src + 142]) + 131072L >> 18)));
  1600:             sndByteBlock[dst + 212] = (byte) t;
  1601:             sndByteBlock[dst + 213] = (byte) (t >> 8);
  1602:             t = Math.max (-32768, Math.min (32767, (int) (47916L * u + 177793L * v + 38291L * (u = (long) YM2151.opmBuffer[src + 144]) + 131072L >> 18)));
  1603:             sndByteBlock[dst + 216] = (byte) t;
  1604:             sndByteBlock[dst + 217] = (byte) (t >> 8);
  1605:             t = Math.max (-32768, Math.min (32767, (int) (15059L * v + 163757L * u + 85184L * (v = (long) YM2151.opmBuffer[src + 146]) + 131072L >> 18)));
  1606:             sndByteBlock[dst + 220] = (byte) t;
  1607:             sndByteBlock[dst + 221] = (byte) (t >> 8);
  1608:             t = Math.max (-32768, Math.min (32767, (int) (704L * u + 117568L * v + 140877L * (u = (long) YM2151.opmBuffer[src + 148]) + 4851L * (v = (long) YM2151.opmBuffer[src + 150]) + 131072L >> 18)));
  1609:             sndByteBlock[dst + 224] = (byte) t;
  1610:             sndByteBlock[dst + 225] = (byte) (t >> 8);
  1611:             t = Math.max (-32768, Math.min (32767, (int) (61875L * u + 174625L * v + 27500L * (u = (long) YM2151.opmBuffer[src + 152]) + 131072L >> 18)));
  1612:             sndByteBlock[dst + 228] = (byte) t;
  1613:             sndByteBlock[dst + 229] = (byte) (t >> 8);
  1614:             t = Math.max (-32768, Math.min (32767, (int) (23276L * v + 172073L * u + 68651L * (v = (long) YM2151.opmBuffer[src + 154]) + 131072L >> 18)));
  1615:             sndByteBlock[dst + 232] = (byte) t;
  1616:             sndByteBlock[dst + 233] = (byte) (t >> 8);
  1617:             t = Math.max (-32768, Math.min (32767, (int) (3179L * u + 134101L * v + 125136L * (u = (long) YM2151.opmBuffer[src + 156]) + 1584L * (v = (long) YM2151.opmBuffer[src + 158]) + 131072L >> 18)));
  1618:             sndByteBlock[dst + 236] = (byte) t;
  1619:             sndByteBlock[dst + 237] = (byte) (t >> 8);
  1620:             t = Math.max (-32768, Math.min (32767, (int) (77616L * u + 167893L * v + 18491L * (u = (long) YM2151.opmBuffer[src + 160]) + 131072L >> 18)));
  1621:             sndByteBlock[dst + 240] = (byte) t;
  1622:             sndByteBlock[dst + 241] = (byte) (t >> 8);
  1623:             t = Math.max (-32768, Math.min (32767, (int) (33275L * v + 176825L * u + 53900L * (v = (long) YM2151.opmBuffer[src + 162]) + 131072L >> 18)));
  1624:             sndByteBlock[dst + 244] = (byte) t;
  1625:             sndByteBlock[dst + 245] = (byte) (t >> 8);
  1626:             t = Math.max (-32768, Math.min (32767, (int) (7436L * u + 148852L * v + 107613L * (u = (long) YM2151.opmBuffer[src + 164]) + 99L * (v = (long) YM2151.opmBuffer[src + 166]) + 131072L >> 18)));
  1627:             sndByteBlock[dst + 248] = (byte) t;
  1628:             sndByteBlock[dst + 249] = (byte) (t >> 8);
  1629:             t = Math.max (-32768, Math.min (32767, (int) (95139L * u + 157597L * v + 11264L * (u = (long) YM2151.opmBuffer[src + 168]) + 131072L >> 18)));
  1630:             sndByteBlock[dst + 252] = (byte) t;
  1631:             sndByteBlock[dst + 253] = (byte) (t >> 8);
  1632:             t = Math.max (-32768, Math.min (32767, (int) (45056L * v + 178013L * u + 40931L * (v = (long) YM2151.opmBuffer[src + 170]) + 131072L >> 18)));
  1633:             sndByteBlock[dst + 256] = (byte) t;
  1634:             sndByteBlock[dst + 257] = (byte) (t >> 8);
  1635:             t = Math.max (-32768, Math.min (32767, (int) (13475L * u + 161425L * v + 89100L * (u = (long) YM2151.opmBuffer[src + 172]) + 131072L >> 18)));
  1636:             sndByteBlock[dst + 260] = (byte) t;
  1637:             sndByteBlock[dst + 261] = (byte) (t >> 8);
  1638:             t = Math.max (-32768, Math.min (32767, (int) (396L * v + 113652L * u + 144133L * (v = (long) YM2151.opmBuffer[src + 174]) + 5819L * (u = (long) YM2151.opmBuffer[src + 176]) + 131072L >> 18)));
  1639:             sndByteBlock[dst + 264] = (byte) t;
  1640:             sndByteBlock[dst + 265] = (byte) (t >> 8);
  1641:             t = Math.max (-32768, Math.min (32767, (int) (58619L * v + 175637L * u + 29744L * (v = (long) YM2151.opmBuffer[src + 178]) + 131072L >> 18)));
  1642:             sndByteBlock[dst + 268] = (byte) t;
  1643:             sndByteBlock[dst + 269] = (byte) (t >> 8);
  1644:             t = Math.max (-32768, Math.min (32767, (int) (21296L * u + 170533L * v + 72171L * (u = (long) YM2151.opmBuffer[src + 180]) + 131072L >> 18)));
  1645:             sndByteBlock[dst + 272] = (byte) t;
  1646:             sndByteBlock[dst + 273] = (byte) (t >> 8);
  1647:             t = Math.max (-32768, Math.min (32767, (int) (2475L * v + 130581L * u + 128788L * (v = (long) YM2151.opmBuffer[src + 182]) + 2156L * (u = (long) YM2151.opmBuffer[src + 184]) + 131072L >> 18)));
  1648:             sndByteBlock[dst + 276] = (byte) t;
  1649:             sndByteBlock[dst + 277] = (byte) (t >> 8);
  1650:             t = Math.max (-32768, Math.min (32767, (int) (73964L * v + 169697L * u + 20339L * (v = (long) YM2151.opmBuffer[src + 186]) + 131072L >> 18)));
  1651:             sndByteBlock[dst + 280] = (byte) t;
  1652:             sndByteBlock[dst + 281] = (byte) (t >> 8);
  1653:             t = Math.max (-32768, Math.min (32767, (int) (30899L * u + 176077L * v + 57024L * (u = (long) YM2151.opmBuffer[src + 188]) + 131072L >> 18)));
  1654:             sndByteBlock[dst + 284] = (byte) t;
  1655:             sndByteBlock[dst + 285] = (byte) (t >> 8);
  1656:             t = Math.max (-32768, Math.min (32767, (int) (6336L * v + 145728L * u + 111661L * (v = (long) YM2151.opmBuffer[src + 190]) + 275L * (u = (long) YM2151.opmBuffer[src + 192]) + 131072L >> 18)));
  1657:             sndByteBlock[dst + 288] = (byte) t;
  1658:             sndByteBlock[dst + 289] = (byte) (t >> 8);
  1659:             t = Math.max (-32768, Math.min (32767, (int) (91091L * v + 160193L * u + 12716L * (v = (long) YM2151.opmBuffer[src + 194]) + 131072L >> 18)));
  1660:             sndByteBlock[dst + 292] = (byte) t;
  1661:             sndByteBlock[dst + 293] = (byte) (t >> 8);
  1662:             t = Math.max (-32768, Math.min (32767, (int) (42284L * u + 178057L * v + 43659L * (u = (long) YM2151.opmBuffer[src + 196]) + 131072L >> 18)));
  1663:             sndByteBlock[dst + 296] = (byte) t;
  1664:             sndByteBlock[dst + 297] = (byte) (t >> 8);
  1665:             t = Math.max (-32768, Math.min (32767, (int) (11979L * v + 158917L * u + 93104L * (v = (long) YM2151.opmBuffer[src + 198]) + 131072L >> 18)));
  1666:             sndByteBlock[dst + 300] = (byte) t;
  1667:             sndByteBlock[dst + 301] = (byte) (t >> 8);
  1668:             t = Math.max (-32768, Math.min (32767, (int) (176L * u + 109648L * v + 147301L * (u = (long) YM2151.opmBuffer[src + 200]) + 6875L * (v = (long) YM2151.opmBuffer[src + 202]) + 131072L >> 18)));
  1669:             sndByteBlock[dst + 304] = (byte) t;
  1670:             sndByteBlock[dst + 305] = (byte) (t >> 8);
  1671:             t = Math.max (-32768, Math.min (32767, (int) (55451L * u + 176473L * v + 32076L * (u = (long) YM2151.opmBuffer[src + 204]) + 131072L >> 18)));
  1672:             sndByteBlock[dst + 308] = (byte) t;
  1673:             sndByteBlock[dst + 309] = (byte) (t >> 8);
  1674:             t = Math.max (-32768, Math.min (32767, (int) (19404L * v + 168817L * u + 75779L * (v = (long) YM2151.opmBuffer[src + 206]) + 131072L >> 18)));
  1675:             sndByteBlock[dst + 312] = (byte) t;
  1676:             sndByteBlock[dst + 313] = (byte) (t >> 8);
  1677:             t = Math.max (-32768, Math.min (32767, (int) (1859L * u + 126973L * v + 132352L * (u = (long) YM2151.opmBuffer[src + 208]) + 2816L * (v = (long) YM2151.opmBuffer[src + 210]) + 131072L >> 18)));
  1678:             sndByteBlock[dst + 316] = (byte) t;
  1679:             sndByteBlock[dst + 317] = (byte) (t >> 8);
  1680:             t = Math.max (-32768, Math.min (32767, (int) (70400L * u + 171325L * v + 22275L * (u = (long) YM2151.opmBuffer[src + 212]) + 131072L >> 18)));
  1681:             sndByteBlock[dst + 320] = (byte) t;
  1682:             sndByteBlock[dst + 321] = (byte) (t >> 8);
  1683:             t = Math.max (-32768, Math.min (32767, (int) (28611L * v + 175153L * u + 60236L * (v = (long) YM2151.opmBuffer[src + 214]) + 131072L >> 18)));
  1684:             sndByteBlock[dst + 324] = (byte) t;
  1685:             sndByteBlock[dst + 325] = (byte) (t >> 8);
  1686:             t = Math.max (-32768, Math.min (32767, (int) (5324L * u + 142516L * v + 115621L * (u = (long) YM2151.opmBuffer[src + 216]) + 539L * (v = (long) YM2151.opmBuffer[src + 218]) + 131072L >> 18)));
  1687:             sndByteBlock[dst + 328] = (byte) t;
  1688:             sndByteBlock[dst + 329] = (byte) (t >> 8);
  1689:             t = Math.max (-32768, Math.min (32767, (int) (87131L * u + 162613L * v + 14256L * (u = (long) YM2151.opmBuffer[src + 220]) + 131072L >> 18)));
  1690:             sndByteBlock[dst + 332] = (byte) t;
  1691:             sndByteBlock[dst + 333] = (byte) (t >> 8);
  1692:             t = Math.max (-32768, Math.min (32767, (int) (39600L * v + 177925L * u + 46475L * (v = (long) YM2151.opmBuffer[src + 222]) + 131072L >> 18)));
  1693:             sndByteBlock[dst + 336] = (byte) t;
  1694:             sndByteBlock[dst + 337] = (byte) (t >> 8);
  1695:             t = Math.max (-32768, Math.min (32767, (int) (10571L * u + 156233L * v + 97196L * (u = (long) YM2151.opmBuffer[src + 224]) + 131072L >> 18)));
  1696:             sndByteBlock[dst + 340] = (byte) t;
  1697:             sndByteBlock[dst + 341] = (byte) (t >> 8);
  1698:             t = Math.max (-32768, Math.min (32767, (int) (44L * v + 105556L * u + 150381L * (v = (long) YM2151.opmBuffer[src + 226]) + 8019L * (u = (long) YM2151.opmBuffer[src + 228]) + 131072L >> 18)));
  1699:             sndByteBlock[dst + 344] = (byte) t;
  1700:             sndByteBlock[dst + 345] = (byte) (t >> 8);
  1701:             t = Math.max (-32768, Math.min (32767, (int) (52371L * v + 177133L * u + 34496L * (v = (long) YM2151.opmBuffer[src + 230]) + 131072L >> 18)));
  1702:             sndByteBlock[dst + 348] = (byte) t;
  1703:             sndByteBlock[dst + 349] = (byte) (t >> 8);
  1704:             t = Math.max (-32768, Math.min (32767, (int) (17600L * u + 166925L * v + 79475L * (u = (long) YM2151.opmBuffer[src + 232]) + 131072L >> 18)));
  1705:             sndByteBlock[dst + 352] = (byte) t;
  1706:             sndByteBlock[dst + 353] = (byte) (t >> 8);
  1707:             t = Math.max (-32768, Math.min (32767, (int) (1331L * v + 123277L * u + 135828L * (v = (long) YM2151.opmBuffer[src + 234]) + 3564L * (u = (long) YM2151.opmBuffer[src + 236]) + 131072L >> 18)));
  1708:             sndByteBlock[dst + 356] = (byte) t;
  1709:             sndByteBlock[dst + 357] = (byte) (t >> 8);
  1710:             t = Math.max (-32768, Math.min (32767, (int) (66924L * v + 172777L * u + 24299L * (v = (long) YM2151.opmBuffer[src + 238]) + 131072L >> 18)));
  1711:             sndByteBlock[dst + 360] = (byte) t;
  1712:             sndByteBlock[dst + 361] = (byte) (t >> 8);
  1713:             t = Math.max (-32768, Math.min (32767, (int) (26411L * u + 174053L * v + 63536L * (u = (long) YM2151.opmBuffer[src + 240]) + 131072L >> 18)));
  1714:             sndByteBlock[dst + 364] = (byte) t;
  1715:             sndByteBlock[dst + 365] = (byte) (t >> 8);
  1716:             t = Math.max (-32768, Math.min (32767, (int) (4400L * v + 139216L * u + 119493L * (v = (long) YM2151.opmBuffer[src + 242]) + 891L * (u = (long) YM2151.opmBuffer[src + 244]) + 131072L >> 18)));
  1717:             sndByteBlock[dst + 368] = (byte) t;
  1718:             sndByteBlock[dst + 369] = (byte) (t >> 8);
  1719:             t = Math.max (-32768, Math.min (32767, (int) (83259L * v + 164857L * u + 15884L * (v = (long) YM2151.opmBuffer[src + 246]) + 131072L >> 18)));
  1720:             sndByteBlock[dst + 372] = (byte) t;
  1721:             sndByteBlock[dst + 373] = (byte) (t >> 8);
  1722:             t = Math.max (-32768, Math.min (32767, (int) (37004L * u + 177617L * v + 49379L * (u = (long) YM2151.opmBuffer[src + 248]) + 131072L >> 18)));
  1723:             sndByteBlock[dst + 376] = (byte) t;
  1724:             sndByteBlock[dst + 377] = (byte) (t >> 8);
  1725:             t = Math.max (-32768, Math.min (32767, (int) (9251L * v + 153373L * u + 101376L * (long) YM2151.opmBuffer[src + 250] + 131072L >> 18)));
  1726:             sndByteBlock[dst + 380] = (byte) t;
  1727:             sndByteBlock[dst + 381] = (byte) (t >> 8);
  1728:             //right
  1729:             t = Math.max (-32768, Math.min (32767, (int) (101376L * (long) YM2151.opmBuffer[src + 1] + 153373L * (v = (long) YM2151.opmBuffer[src + 3]) + 9251L * (u = (long) YM2151.opmBuffer[src + 5]) + 131072L >> 18)));
  1730:             sndByteBlock[dst + 2] = (byte) t;
  1731:             sndByteBlock[dst + 3] = (byte) (t >> 8);
  1732:             t = Math.max (-32768, Math.min (32767, (int) (49379L * v + 177617L * u + 37004L * (v = (long) YM2151.opmBuffer[src + 7]) + 131072L >> 18)));
  1733:             sndByteBlock[dst + 6] = (byte) t;
  1734:             sndByteBlock[dst + 7] = (byte) (t >> 8);
  1735:             t = Math.max (-32768, Math.min (32767, (int) (15884L * u + 164857L * v + 83259L * (u = (long) YM2151.opmBuffer[src + 9]) + 131072L >> 18)));
  1736:             sndByteBlock[dst + 10] = (byte) t;
  1737:             sndByteBlock[dst + 11] = (byte) (t >> 8);
  1738:             t = Math.max (-32768, Math.min (32767, (int) (891L * v + 119493L * u + 139216L * (v = (long) YM2151.opmBuffer[src + 11]) + 4400L * (u = (long) YM2151.opmBuffer[src + 13]) + 131072L >> 18)));
  1739:             sndByteBlock[dst + 14] = (byte) t;
  1740:             sndByteBlock[dst + 15] = (byte) (t >> 8);
  1741:             t = Math.max (-32768, Math.min (32767, (int) (63536L * v + 174053L * u + 26411L * (v = (long) YM2151.opmBuffer[src + 15]) + 131072L >> 18)));
  1742:             sndByteBlock[dst + 18] = (byte) t;
  1743:             sndByteBlock[dst + 19] = (byte) (t >> 8);
  1744:             t = Math.max (-32768, Math.min (32767, (int) (24299L * u + 172777L * v + 66924L * (u = (long) YM2151.opmBuffer[src + 17]) + 131072L >> 18)));
  1745:             sndByteBlock[dst + 22] = (byte) t;
  1746:             sndByteBlock[dst + 23] = (byte) (t >> 8);
  1747:             t = Math.max (-32768, Math.min (32767, (int) (3564L * v + 135828L * u + 123277L * (v = (long) YM2151.opmBuffer[src + 19]) + 1331L * (u = (long) YM2151.opmBuffer[src + 21]) + 131072L >> 18)));
  1748:             sndByteBlock[dst + 26] = (byte) t;
  1749:             sndByteBlock[dst + 27] = (byte) (t >> 8);
  1750:             t = Math.max (-32768, Math.min (32767, (int) (79475L * v + 166925L * u + 17600L * (v = (long) YM2151.opmBuffer[src + 23]) + 131072L >> 18)));
  1751:             sndByteBlock[dst + 30] = (byte) t;
  1752:             sndByteBlock[dst + 31] = (byte) (t >> 8);
  1753:             t = Math.max (-32768, Math.min (32767, (int) (34496L * u + 177133L * v + 52371L * (u = (long) YM2151.opmBuffer[src + 25]) + 131072L >> 18)));
  1754:             sndByteBlock[dst + 34] = (byte) t;
  1755:             sndByteBlock[dst + 35] = (byte) (t >> 8);
  1756:             t = Math.max (-32768, Math.min (32767, (int) (8019L * v + 150381L * u + 105556L * (v = (long) YM2151.opmBuffer[src + 27]) + 44L * (u = (long) YM2151.opmBuffer[src + 29]) + 131072L >> 18)));
  1757:             sndByteBlock[dst + 38] = (byte) t;
  1758:             sndByteBlock[dst + 39] = (byte) (t >> 8);
  1759:             t = Math.max (-32768, Math.min (32767, (int) (97196L * v + 156233L * u + 10571L * (v = (long) YM2151.opmBuffer[src + 31]) + 131072L >> 18)));
  1760:             sndByteBlock[dst + 42] = (byte) t;
  1761:             sndByteBlock[dst + 43] = (byte) (t >> 8);
  1762:             t = Math.max (-32768, Math.min (32767, (int) (46475L * u + 177925L * v + 39600L * (u = (long) YM2151.opmBuffer[src + 33]) + 131072L >> 18)));
  1763:             sndByteBlock[dst + 46] = (byte) t;
  1764:             sndByteBlock[dst + 47] = (byte) (t >> 8);
  1765:             t = Math.max (-32768, Math.min (32767, (int) (14256L * v + 162613L * u + 87131L * (v = (long) YM2151.opmBuffer[src + 35]) + 131072L >> 18)));
  1766:             sndByteBlock[dst + 50] = (byte) t;
  1767:             sndByteBlock[dst + 51] = (byte) (t >> 8);
  1768:             t = Math.max (-32768, Math.min (32767, (int) (539L * u + 115621L * v + 142516L * (u = (long) YM2151.opmBuffer[src + 37]) + 5324L * (v = (long) YM2151.opmBuffer[src + 39]) + 131072L >> 18)));
  1769:             sndByteBlock[dst + 54] = (byte) t;
  1770:             sndByteBlock[dst + 55] = (byte) (t >> 8);
  1771:             t = Math.max (-32768, Math.min (32767, (int) (60236L * u + 175153L * v + 28611L * (u = (long) YM2151.opmBuffer[src + 41]) + 131072L >> 18)));
  1772:             sndByteBlock[dst + 58] = (byte) t;
  1773:             sndByteBlock[dst + 59] = (byte) (t >> 8);
  1774:             t = Math.max (-32768, Math.min (32767, (int) (22275L * v + 171325L * u + 70400L * (v = (long) YM2151.opmBuffer[src + 43]) + 131072L >> 18)));
  1775:             sndByteBlock[dst + 62] = (byte) t;
  1776:             sndByteBlock[dst + 63] = (byte) (t >> 8);
  1777:             t = Math.max (-32768, Math.min (32767, (int) (2816L * u + 132352L * v + 126973L * (u = (long) YM2151.opmBuffer[src + 45]) + 1859L * (v = (long) YM2151.opmBuffer[src + 47]) + 131072L >> 18)));
  1778:             sndByteBlock[dst + 66] = (byte) t;
  1779:             sndByteBlock[dst + 67] = (byte) (t >> 8);
  1780:             t = Math.max (-32768, Math.min (32767, (int) (75779L * u + 168817L * v + 19404L * (u = (long) YM2151.opmBuffer[src + 49]) + 131072L >> 18)));
  1781:             sndByteBlock[dst + 70] = (byte) t;
  1782:             sndByteBlock[dst + 71] = (byte) (t >> 8);
  1783:             t = Math.max (-32768, Math.min (32767, (int) (32076L * v + 176473L * u + 55451L * (v = (long) YM2151.opmBuffer[src + 51]) + 131072L >> 18)));
  1784:             sndByteBlock[dst + 74] = (byte) t;
  1785:             sndByteBlock[dst + 75] = (byte) (t >> 8);
  1786:             t = Math.max (-32768, Math.min (32767, (int) (6875L * u + 147301L * v + 109648L * (u = (long) YM2151.opmBuffer[src + 53]) + 176L * (v = (long) YM2151.opmBuffer[src + 55]) + 131072L >> 18)));
  1787:             sndByteBlock[dst + 78] = (byte) t;
  1788:             sndByteBlock[dst + 79] = (byte) (t >> 8);
  1789:             t = Math.max (-32768, Math.min (32767, (int) (93104L * u + 158917L * v + 11979L * (u = (long) YM2151.opmBuffer[src + 57]) + 131072L >> 18)));
  1790:             sndByteBlock[dst + 82] = (byte) t;
  1791:             sndByteBlock[dst + 83] = (byte) (t >> 8);
  1792:             t = Math.max (-32768, Math.min (32767, (int) (43659L * v + 178057L * u + 42284L * (v = (long) YM2151.opmBuffer[src + 59]) + 131072L >> 18)));
  1793:             sndByteBlock[dst + 86] = (byte) t;
  1794:             sndByteBlock[dst + 87] = (byte) (t >> 8);
  1795:             t = Math.max (-32768, Math.min (32767, (int) (12716L * u + 160193L * v + 91091L * (u = (long) YM2151.opmBuffer[src + 61]) + 131072L >> 18)));
  1796:             sndByteBlock[dst + 90] = (byte) t;
  1797:             sndByteBlock[dst + 91] = (byte) (t >> 8);
  1798:             t = Math.max (-32768, Math.min (32767, (int) (275L * v + 111661L * u + 145728L * (v = (long) YM2151.opmBuffer[src + 63]) + 6336L * (u = (long) YM2151.opmBuffer[src + 65]) + 131072L >> 18)));
  1799:             sndByteBlock[dst + 94] = (byte) t;
  1800:             sndByteBlock[dst + 95] = (byte) (t >> 8);
  1801:             t = Math.max (-32768, Math.min (32767, (int) (57024L * v + 176077L * u + 30899L * (v = (long) YM2151.opmBuffer[src + 67]) + 131072L >> 18)));
  1802:             sndByteBlock[dst + 98] = (byte) t;
  1803:             sndByteBlock[dst + 99] = (byte) (t >> 8);
  1804:             t = Math.max (-32768, Math.min (32767, (int) (20339L * u + 169697L * v + 73964L * (u = (long) YM2151.opmBuffer[src + 69]) + 131072L >> 18)));
  1805:             sndByteBlock[dst + 102] = (byte) t;
  1806:             sndByteBlock[dst + 103] = (byte) (t >> 8);
  1807:             t = Math.max (-32768, Math.min (32767, (int) (2156L * v + 128788L * u + 130581L * (v = (long) YM2151.opmBuffer[src + 71]) + 2475L * (u = (long) YM2151.opmBuffer[src + 73]) + 131072L >> 18)));
  1808:             sndByteBlock[dst + 106] = (byte) t;
  1809:             sndByteBlock[dst + 107] = (byte) (t >> 8);
  1810:             t = Math.max (-32768, Math.min (32767, (int) (72171L * v + 170533L * u + 21296L * (v = (long) YM2151.opmBuffer[src + 75]) + 131072L >> 18)));
  1811:             sndByteBlock[dst + 110] = (byte) t;
  1812:             sndByteBlock[dst + 111] = (byte) (t >> 8);
  1813:             t = Math.max (-32768, Math.min (32767, (int) (29744L * u + 175637L * v + 58619L * (u = (long) YM2151.opmBuffer[src + 77]) + 131072L >> 18)));
  1814:             sndByteBlock[dst + 114] = (byte) t;
  1815:             sndByteBlock[dst + 115] = (byte) (t >> 8);
  1816:             t = Math.max (-32768, Math.min (32767, (int) (5819L * v + 144133L * u + 113652L * (v = (long) YM2151.opmBuffer[src + 79]) + 396L * (u = (long) YM2151.opmBuffer[src + 81]) + 131072L >> 18)));
  1817:             sndByteBlock[dst + 118] = (byte) t;
  1818:             sndByteBlock[dst + 119] = (byte) (t >> 8);
  1819:             t = Math.max (-32768, Math.min (32767, (int) (89100L * v + 161425L * u + 13475L * (v = (long) YM2151.opmBuffer[src + 83]) + 131072L >> 18)));
  1820:             sndByteBlock[dst + 122] = (byte) t;
  1821:             sndByteBlock[dst + 123] = (byte) (t >> 8);
  1822:             t = Math.max (-32768, Math.min (32767, (int) (40931L * u + 178013L * v + 45056L * (u = (long) YM2151.opmBuffer[src + 85]) + 131072L >> 18)));
  1823:             sndByteBlock[dst + 126] = (byte) t;
  1824:             sndByteBlock[dst + 127] = (byte) (t >> 8);
  1825:             t = Math.max (-32768, Math.min (32767, (int) (11264L * v + 157597L * u + 95139L * (v = (long) YM2151.opmBuffer[src + 87]) + 131072L >> 18)));
  1826:             sndByteBlock[dst + 130] = (byte) t;
  1827:             sndByteBlock[dst + 131] = (byte) (t >> 8);
  1828:             t = Math.max (-32768, Math.min (32767, (int) (99L * u + 107613L * v + 148852L * (u = (long) YM2151.opmBuffer[src + 89]) + 7436L * (v = (long) YM2151.opmBuffer[src + 91]) + 131072L >> 18)));
  1829:             sndByteBlock[dst + 134] = (byte) t;
  1830:             sndByteBlock[dst + 135] = (byte) (t >> 8);
  1831:             t = Math.max (-32768, Math.min (32767, (int) (53900L * u + 176825L * v + 33275L * (u = (long) YM2151.opmBuffer[src + 93]) + 131072L >> 18)));
  1832:             sndByteBlock[dst + 138] = (byte) t;
  1833:             sndByteBlock[dst + 139] = (byte) (t >> 8);
  1834:             t = Math.max (-32768, Math.min (32767, (int) (18491L * v + 167893L * u + 77616L * (v = (long) YM2151.opmBuffer[src + 95]) + 131072L >> 18)));
  1835:             sndByteBlock[dst + 142] = (byte) t;
  1836:             sndByteBlock[dst + 143] = (byte) (t >> 8);
  1837:             t = Math.max (-32768, Math.min (32767, (int) (1584L * u + 125136L * v + 134101L * (u = (long) YM2151.opmBuffer[src + 97]) + 3179L * (v = (long) YM2151.opmBuffer[src + 99]) + 131072L >> 18)));
  1838:             sndByteBlock[dst + 146] = (byte) t;
  1839:             sndByteBlock[dst + 147] = (byte) (t >> 8);
  1840:             t = Math.max (-32768, Math.min (32767, (int) (68651L * u + 172073L * v + 23276L * (u = (long) YM2151.opmBuffer[src + 101]) + 131072L >> 18)));
  1841:             sndByteBlock[dst + 150] = (byte) t;
  1842:             sndByteBlock[dst + 151] = (byte) (t >> 8);
  1843:             t = Math.max (-32768, Math.min (32767, (int) (27500L * v + 174625L * u + 61875L * (v = (long) YM2151.opmBuffer[src + 103]) + 131072L >> 18)));
  1844:             sndByteBlock[dst + 154] = (byte) t;
  1845:             sndByteBlock[dst + 155] = (byte) (t >> 8);
  1846:             t = Math.max (-32768, Math.min (32767, (int) (4851L * u + 140877L * v + 117568L * (u = (long) YM2151.opmBuffer[src + 105]) + 704L * (v = (long) YM2151.opmBuffer[src + 107]) + 131072L >> 18)));
  1847:             sndByteBlock[dst + 158] = (byte) t;
  1848:             sndByteBlock[dst + 159] = (byte) (t >> 8);
  1849:             t = Math.max (-32768, Math.min (32767, (int) (85184L * u + 163757L * v + 15059L * (u = (long) YM2151.opmBuffer[src + 109]) + 131072L >> 18)));
  1850:             sndByteBlock[dst + 162] = (byte) t;
  1851:             sndByteBlock[dst + 163] = (byte) (t >> 8);
  1852:             t = Math.max (-32768, Math.min (32767, (int) (38291L * v + 177793L * u + 47916L * (v = (long) YM2151.opmBuffer[src + 111]) + 131072L >> 18)));
  1853:             sndByteBlock[dst + 166] = (byte) t;
  1854:             sndByteBlock[dst + 167] = (byte) (t >> 8);
  1855:             t = Math.max (-32768, Math.min (32767, (int) (9900L * u + 154825L * v + 99275L * (u = (long) YM2151.opmBuffer[src + 113]) + 131072L >> 18)));
  1856:             sndByteBlock[dst + 170] = (byte) t;
  1857:             sndByteBlock[dst + 171] = (byte) (t >> 8);
  1858:             t = Math.max (-32768, Math.min (32767, (int) (11L * v + 103477L * u + 151888L * (v = (long) YM2151.opmBuffer[src + 115]) + 8624L * (u = (long) YM2151.opmBuffer[src + 117]) + 131072L >> 18)));
  1859:             sndByteBlock[dst + 174] = (byte) t;
  1860:             sndByteBlock[dst + 175] = (byte) (t >> 8);
  1861:             t = Math.max (-32768, Math.min (32767, (int) (50864L * v + 177397L * u + 35739L * (v = (long) YM2151.opmBuffer[src + 119]) + 131072L >> 18)));
  1862:             sndByteBlock[dst + 178] = (byte) t;
  1863:             sndByteBlock[dst + 179] = (byte) (t >> 8);
  1864:             t = Math.max (-32768, Math.min (32767, (int) (16731L * u + 165913L * v + 81356L * (u = (long) YM2151.opmBuffer[src + 121]) + 131072L >> 18)));
  1865:             sndByteBlock[dst + 182] = (byte) t;
  1866:             sndByteBlock[dst + 183] = (byte) (t >> 8);
  1867:             t = Math.max (-32768, Math.min (32767, (int) (1100L * v + 121396L * u + 137533L * (v = (long) YM2151.opmBuffer[src + 123]) + 3971L * (u = (long) YM2151.opmBuffer[src + 125]) + 131072L >> 18)));
  1868:             sndByteBlock[dst + 186] = (byte) t;
  1869:             sndByteBlock[dst + 187] = (byte) (t >> 8);
  1870:             t = Math.max (-32768, Math.min (32767, (int) (65219L * v + 173437L * u + 25344L * (v = (long) YM2151.opmBuffer[src + 127]) + 131072L >> 18)));
  1871:             sndByteBlock[dst + 190] = (byte) t;
  1872:             sndByteBlock[dst + 191] = (byte) (t >> 8);
  1873:             t = Math.max (-32768, Math.min (32767, (int) (25344L * u + 173437L * v + 65219L * (u = (long) YM2151.opmBuffer[src + 129]) + 131072L >> 18)));
  1874:             sndByteBlock[dst + 194] = (byte) t;
  1875:             sndByteBlock[dst + 195] = (byte) (t >> 8);
  1876:             t = Math.max (-32768, Math.min (32767, (int) (3971L * v + 137533L * u + 121396L * (v = (long) YM2151.opmBuffer[src + 131]) + 1100L * (u = (long) YM2151.opmBuffer[src + 133]) + 131072L >> 18)));
  1877:             sndByteBlock[dst + 198] = (byte) t;
  1878:             sndByteBlock[dst + 199] = (byte) (t >> 8);
  1879:             t = Math.max (-32768, Math.min (32767, (int) (81356L * v + 165913L * u + 16731L * (v = (long) YM2151.opmBuffer[src + 135]) + 131072L >> 18)));
  1880:             sndByteBlock[dst + 202] = (byte) t;
  1881:             sndByteBlock[dst + 203] = (byte) (t >> 8);
  1882:             t = Math.max (-32768, Math.min (32767, (int) (35739L * u + 177397L * v + 50864L * (u = (long) YM2151.opmBuffer[src + 137]) + 131072L >> 18)));
  1883:             sndByteBlock[dst + 206] = (byte) t;
  1884:             sndByteBlock[dst + 207] = (byte) (t >> 8);
  1885:             t = Math.max (-32768, Math.min (32767, (int) (8624L * v + 151888L * u + 103477L * (v = (long) YM2151.opmBuffer[src + 139]) + 11L * (u = (long) YM2151.opmBuffer[src + 141]) + 131072L >> 18)));
  1886:             sndByteBlock[dst + 210] = (byte) t;
  1887:             sndByteBlock[dst + 211] = (byte) (t >> 8);
  1888:             t = Math.max (-32768, Math.min (32767, (int) (99275L * v + 154825L * u + 9900L * (v = (long) YM2151.opmBuffer[src + 143]) + 131072L >> 18)));
  1889:             sndByteBlock[dst + 214] = (byte) t;
  1890:             sndByteBlock[dst + 215] = (byte) (t >> 8);
  1891:             t = Math.max (-32768, Math.min (32767, (int) (47916L * u + 177793L * v + 38291L * (u = (long) YM2151.opmBuffer[src + 145]) + 131072L >> 18)));
  1892:             sndByteBlock[dst + 218] = (byte) t;
  1893:             sndByteBlock[dst + 219] = (byte) (t >> 8);
  1894:             t = Math.max (-32768, Math.min (32767, (int) (15059L * v + 163757L * u + 85184L * (v = (long) YM2151.opmBuffer[src + 147]) + 131072L >> 18)));
  1895:             sndByteBlock[dst + 222] = (byte) t;
  1896:             sndByteBlock[dst + 223] = (byte) (t >> 8);
  1897:             t = Math.max (-32768, Math.min (32767, (int) (704L * u + 117568L * v + 140877L * (u = (long) YM2151.opmBuffer[src + 149]) + 4851L * (v = (long) YM2151.opmBuffer[src + 151]) + 131072L >> 18)));
  1898:             sndByteBlock[dst + 226] = (byte) t;
  1899:             sndByteBlock[dst + 227] = (byte) (t >> 8);
  1900:             t = Math.max (-32768, Math.min (32767, (int) (61875L * u + 174625L * v + 27500L * (u = (long) YM2151.opmBuffer[src + 153]) + 131072L >> 18)));
  1901:             sndByteBlock[dst + 230] = (byte) t;
  1902:             sndByteBlock[dst + 231] = (byte) (t >> 8);
  1903:             t = Math.max (-32768, Math.min (32767, (int) (23276L * v + 172073L * u + 68651L * (v = (long) YM2151.opmBuffer[src + 155]) + 131072L >> 18)));
  1904:             sndByteBlock[dst + 234] = (byte) t;
  1905:             sndByteBlock[dst + 235] = (byte) (t >> 8);
  1906:             t = Math.max (-32768, Math.min (32767, (int) (3179L * u + 134101L * v + 125136L * (u = (long) YM2151.opmBuffer[src + 157]) + 1584L * (v = (long) YM2151.opmBuffer[src + 159]) + 131072L >> 18)));
  1907:             sndByteBlock[dst + 238] = (byte) t;
  1908:             sndByteBlock[dst + 239] = (byte) (t >> 8);
  1909:             t = Math.max (-32768, Math.min (32767, (int) (77616L * u + 167893L * v + 18491L * (u = (long) YM2151.opmBuffer[src + 161]) + 131072L >> 18)));
  1910:             sndByteBlock[dst + 242] = (byte) t;
  1911:             sndByteBlock[dst + 243] = (byte) (t >> 8);
  1912:             t = Math.max (-32768, Math.min (32767, (int) (33275L * v + 176825L * u + 53900L * (v = (long) YM2151.opmBuffer[src + 163]) + 131072L >> 18)));
  1913:             sndByteBlock[dst + 246] = (byte) t;
  1914:             sndByteBlock[dst + 247] = (byte) (t >> 8);
  1915:             t = Math.max (-32768, Math.min (32767, (int) (7436L * u + 148852L * v + 107613L * (u = (long) YM2151.opmBuffer[src + 165]) + 99L * (v = (long) YM2151.opmBuffer[src + 167]) + 131072L >> 18)));
  1916:             sndByteBlock[dst + 250] = (byte) t;
  1917:             sndByteBlock[dst + 251] = (byte) (t >> 8);
  1918:             t = Math.max (-32768, Math.min (32767, (int) (95139L * u + 157597L * v + 11264L * (u = (long) YM2151.opmBuffer[src + 169]) + 131072L >> 18)));
  1919:             sndByteBlock[dst + 254] = (byte) t;
  1920:             sndByteBlock[dst + 255] = (byte) (t >> 8);
  1921:             t = Math.max (-32768, Math.min (32767, (int) (45056L * v + 178013L * u + 40931L * (v = (long) YM2151.opmBuffer[src + 171]) + 131072L >> 18)));
  1922:             sndByteBlock[dst + 258] = (byte) t;
  1923:             sndByteBlock[dst + 259] = (byte) (t >> 8);
  1924:             t = Math.max (-32768, Math.min (32767, (int) (13475L * u + 161425L * v + 89100L * (u = (long) YM2151.opmBuffer[src + 173]) + 131072L >> 18)));
  1925:             sndByteBlock[dst + 262] = (byte) t;
  1926:             sndByteBlock[dst + 263] = (byte) (t >> 8);
  1927:             t = Math.max (-32768, Math.min (32767, (int) (396L * v + 113652L * u + 144133L * (v = (long) YM2151.opmBuffer[src + 175]) + 5819L * (u = (long) YM2151.opmBuffer[src + 177]) + 131072L >> 18)));
  1928:             sndByteBlock[dst + 266] = (byte) t;
  1929:             sndByteBlock[dst + 267] = (byte) (t >> 8);
  1930:             t = Math.max (-32768, Math.min (32767, (int) (58619L * v + 175637L * u + 29744L * (v = (long) YM2151.opmBuffer[src + 179]) + 131072L >> 18)));
  1931:             sndByteBlock[dst + 270] = (byte) t;
  1932:             sndByteBlock[dst + 271] = (byte) (t >> 8);
  1933:             t = Math.max (-32768, Math.min (32767, (int) (21296L * u + 170533L * v + 72171L * (u = (long) YM2151.opmBuffer[src + 181]) + 131072L >> 18)));
  1934:             sndByteBlock[dst + 274] = (byte) t;
  1935:             sndByteBlock[dst + 275] = (byte) (t >> 8);
  1936:             t = Math.max (-32768, Math.min (32767, (int) (2475L * v + 130581L * u + 128788L * (v = (long) YM2151.opmBuffer[src + 183]) + 2156L * (u = (long) YM2151.opmBuffer[src + 185]) + 131072L >> 18)));
  1937:             sndByteBlock[dst + 278] = (byte) t;
  1938:             sndByteBlock[dst + 279] = (byte) (t >> 8);
  1939:             t = Math.max (-32768, Math.min (32767, (int) (73964L * v + 169697L * u + 20339L * (v = (long) YM2151.opmBuffer[src + 187]) + 131072L >> 18)));
  1940:             sndByteBlock[dst + 282] = (byte) t;
  1941:             sndByteBlock[dst + 283] = (byte) (t >> 8);
  1942:             t = Math.max (-32768, Math.min (32767, (int) (30899L * u + 176077L * v + 57024L * (u = (long) YM2151.opmBuffer[src + 189]) + 131072L >> 18)));
  1943:             sndByteBlock[dst + 286] = (byte) t;
  1944:             sndByteBlock[dst + 287] = (byte) (t >> 8);
  1945:             t = Math.max (-32768, Math.min (32767, (int) (6336L * v + 145728L * u + 111661L * (v = (long) YM2151.opmBuffer[src + 191]) + 275L * (u = (long) YM2151.opmBuffer[src + 193]) + 131072L >> 18)));
  1946:             sndByteBlock[dst + 290] = (byte) t;
  1947:             sndByteBlock[dst + 291] = (byte) (t >> 8);
  1948:             t = Math.max (-32768, Math.min (32767, (int) (91091L * v + 160193L * u + 12716L * (v = (long) YM2151.opmBuffer[src + 195]) + 131072L >> 18)));
  1949:             sndByteBlock[dst + 294] = (byte) t;
  1950:             sndByteBlock[dst + 295] = (byte) (t >> 8);
  1951:             t = Math.max (-32768, Math.min (32767, (int) (42284L * u + 178057L * v + 43659L * (u = (long) YM2151.opmBuffer[src + 197]) + 131072L >> 18)));
  1952:             sndByteBlock[dst + 298] = (byte) t;
  1953:             sndByteBlock[dst + 299] = (byte) (t >> 8);
  1954:             t = Math.max (-32768, Math.min (32767, (int) (11979L * v + 158917L * u + 93104L * (v = (long) YM2151.opmBuffer[src + 199]) + 131072L >> 18)));
  1955:             sndByteBlock[dst + 302] = (byte) t;
  1956:             sndByteBlock[dst + 303] = (byte) (t >> 8);
  1957:             t = Math.max (-32768, Math.min (32767, (int) (176L * u + 109648L * v + 147301L * (u = (long) YM2151.opmBuffer[src + 201]) + 6875L * (v = (long) YM2151.opmBuffer[src + 203]) + 131072L >> 18)));
  1958:             sndByteBlock[dst + 306] = (byte) t;
  1959:             sndByteBlock[dst + 307] = (byte) (t >> 8);
  1960:             t = Math.max (-32768, Math.min (32767, (int) (55451L * u + 176473L * v + 32076L * (u = (long) YM2151.opmBuffer[src + 205]) + 131072L >> 18)));
  1961:             sndByteBlock[dst + 310] = (byte) t;
  1962:             sndByteBlock[dst + 311] = (byte) (t >> 8);
  1963:             t = Math.max (-32768, Math.min (32767, (int) (19404L * v + 168817L * u + 75779L * (v = (long) YM2151.opmBuffer[src + 207]) + 131072L >> 18)));
  1964:             sndByteBlock[dst + 314] = (byte) t;
  1965:             sndByteBlock[dst + 315] = (byte) (t >> 8);
  1966:             t = Math.max (-32768, Math.min (32767, (int) (1859L * u + 126973L * v + 132352L * (u = (long) YM2151.opmBuffer[src + 209]) + 2816L * (v = (long) YM2151.opmBuffer[src + 211]) + 131072L >> 18)));
  1967:             sndByteBlock[dst + 318] = (byte) t;
  1968:             sndByteBlock[dst + 319] = (byte) (t >> 8);
  1969:             t = Math.max (-32768, Math.min (32767, (int) (70400L * u + 171325L * v + 22275L * (u = (long) YM2151.opmBuffer[src + 213]) + 131072L >> 18)));
  1970:             sndByteBlock[dst + 322] = (byte) t;
  1971:             sndByteBlock[dst + 323] = (byte) (t >> 8);
  1972:             t = Math.max (-32768, Math.min (32767, (int) (28611L * v + 175153L * u + 60236L * (v = (long) YM2151.opmBuffer[src + 215]) + 131072L >> 18)));
  1973:             sndByteBlock[dst + 326] = (byte) t;
  1974:             sndByteBlock[dst + 327] = (byte) (t >> 8);
  1975:             t = Math.max (-32768, Math.min (32767, (int) (5324L * u + 142516L * v + 115621L * (u = (long) YM2151.opmBuffer[src + 217]) + 539L * (v = (long) YM2151.opmBuffer[src + 219]) + 131072L >> 18)));
  1976:             sndByteBlock[dst + 330] = (byte) t;
  1977:             sndByteBlock[dst + 331] = (byte) (t >> 8);
  1978:             t = Math.max (-32768, Math.min (32767, (int) (87131L * u + 162613L * v + 14256L * (u = (long) YM2151.opmBuffer[src + 221]) + 131072L >> 18)));
  1979:             sndByteBlock[dst + 334] = (byte) t;
  1980:             sndByteBlock[dst + 335] = (byte) (t >> 8);
  1981:             t = Math.max (-32768, Math.min (32767, (int) (39600L * v + 177925L * u + 46475L * (v = (long) YM2151.opmBuffer[src + 223]) + 131072L >> 18)));
  1982:             sndByteBlock[dst + 338] = (byte) t;
  1983:             sndByteBlock[dst + 339] = (byte) (t >> 8);
  1984:             t = Math.max (-32768, Math.min (32767, (int) (10571L * u + 156233L * v + 97196L * (u = (long) YM2151.opmBuffer[src + 225]) + 131072L >> 18)));
  1985:             sndByteBlock[dst + 342] = (byte) t;
  1986:             sndByteBlock[dst + 343] = (byte) (t >> 8);
  1987:             t = Math.max (-32768, Math.min (32767, (int) (44L * v + 105556L * u + 150381L * (v = (long) YM2151.opmBuffer[src + 227]) + 8019L * (u = (long) YM2151.opmBuffer[src + 229]) + 131072L >> 18)));
  1988:             sndByteBlock[dst + 346] = (byte) t;
  1989:             sndByteBlock[dst + 347] = (byte) (t >> 8);
  1990:             t = Math.max (-32768, Math.min (32767, (int) (52371L * v + 177133L * u + 34496L * (v = (long) YM2151.opmBuffer[src + 231]) + 131072L >> 18)));
  1991:             sndByteBlock[dst + 350] = (byte) t;
  1992:             sndByteBlock[dst + 351] = (byte) (t >> 8);
  1993:             t = Math.max (-32768, Math.min (32767, (int) (17600L * u + 166925L * v + 79475L * (u = (long) YM2151.opmBuffer[src + 233]) + 131072L >> 18)));
  1994:             sndByteBlock[dst + 354] = (byte) t;
  1995:             sndByteBlock[dst + 355] = (byte) (t >> 8);
  1996:             t = Math.max (-32768, Math.min (32767, (int) (1331L * v + 123277L * u + 135828L * (v = (long) YM2151.opmBuffer[src + 235]) + 3564L * (u = (long) YM2151.opmBuffer[src + 237]) + 131072L >> 18)));
  1997:             sndByteBlock[dst + 358] = (byte) t;
  1998:             sndByteBlock[dst + 359] = (byte) (t >> 8);
  1999:             t = Math.max (-32768, Math.min (32767, (int) (66924L * v + 172777L * u + 24299L * (v = (long) YM2151.opmBuffer[src + 239]) + 131072L >> 18)));
  2000:             sndByteBlock[dst + 362] = (byte) t;
  2001:             sndByteBlock[dst + 363] = (byte) (t >> 8);
  2002:             t = Math.max (-32768, Math.min (32767, (int) (26411L * u + 174053L * v + 63536L * (u = (long) YM2151.opmBuffer[src + 241]) + 131072L >> 18)));
  2003:             sndByteBlock[dst + 366] = (byte) t;
  2004:             sndByteBlock[dst + 367] = (byte) (t >> 8);
  2005:             t = Math.max (-32768, Math.min (32767, (int) (4400L * v + 139216L * u + 119493L * (v = (long) YM2151.opmBuffer[src + 243]) + 891L * (u = (long) YM2151.opmBuffer[src + 245]) + 131072L >> 18)));
  2006:             sndByteBlock[dst + 370] = (byte) t;
  2007:             sndByteBlock[dst + 371] = (byte) (t >> 8);
  2008:             t = Math.max (-32768, Math.min (32767, (int) (83259L * v + 164857L * u + 15884L * (v = (long) YM2151.opmBuffer[src + 247]) + 131072L >> 18)));
  2009:             sndByteBlock[dst + 374] = (byte) t;
  2010:             sndByteBlock[dst + 375] = (byte) (t >> 8);
  2011:             t = Math.max (-32768, Math.min (32767, (int) (37004L * u + 177617L * v + 49379L * (u = (long) YM2151.opmBuffer[src + 249]) + 131072L >> 18)));
  2012:             sndByteBlock[dst + 378] = (byte) t;
  2013:             sndByteBlock[dst + 379] = (byte) (t >> 8);
  2014:             t = Math.max (-32768, Math.min (32767, (int) (9251L * v + 153373L * u + 101376L * (long) YM2151.opmBuffer[src + 251] + 131072L >> 18)));
  2015:             sndByteBlock[dst + 382] = (byte) t;
  2016:             sndByteBlock[dst + 383] = (byte) (t >> 8);
  2017:           }  //for src,dst
  2018:         } else {  //float
  2019:           //OPMとPCMを合わせてボリュームを掛ける。ついでに後ろに1サンプルずらす
  2020:           int l = YM2151.opmBuffer[2 * YM2151.OPM_BLOCK_SAMPLES    ];  //前回の最後のデータ
  2021:           int r = YM2151.opmBuffer[2 * YM2151.OPM_BLOCK_SAMPLES + 1];
  2022:           for (int src = 0; src < 2 * YM2151.OPM_BLOCK_SAMPLES; src += 2) {
  2023:             int t;
  2024:             t = (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src    ] + ADPCM.pcmBuffer[src    ] :
  2025:                  YM2151.OPM_ON           ? YM2151.opmBuffer[src    ]                      :
  2026:                  ADPCM.PCM_ON           ?                      ADPCM.pcmBuffer[src    ] :
  2027:                  0) * sndCurrentScale >> 12;
  2028:             YM2151.opmBuffer[src    ] = l;
  2029:             l = t;
  2030:             t = (YM2151.OPM_ON && ADPCM.PCM_ON ? YM2151.opmBuffer[src + 1] + ADPCM.pcmBuffer[src + 1] :
  2031:                  YM2151.OPM_ON           ? YM2151.opmBuffer[src + 1]                      :
  2032:                  ADPCM.PCM_ON           ?                      ADPCM.pcmBuffer[src + 1] :
  2033:                  0) * sndCurrentScale >> 12;
  2034:             YM2151.opmBuffer[src + 1] = r;
  2035:             r = t;
  2036:             sndCurrentScale += (sndCurrentScale - sndTargetScale >>> 31) - (sndTargetScale - sndCurrentScale >>> 31);
  2037:           }
  2038:           YM2151.opmBuffer[2 * YM2151.OPM_BLOCK_SAMPLES    ] = l;  //今回の最後のデータ
  2039:           YM2151.opmBuffer[2 * YM2151.OPM_BLOCK_SAMPLES + 1] = r;
  2040:           //線形面積補間
  2041:           //  float→intのキャストに飽和処理をさせている
  2042:           for (int src = 0, dst = 0; src < 2 * YM2151.OPM_BLOCK_SAMPLES; src += 2 * 125, dst += 4 * 96) {
  2043:             int t;
  2044:             float u, v;
  2045:             //  perl -e "$m=125;$n=96;$CH=2;$I=12;sub str{my($t,$lr)=@_;my@s=();for my$k(sort{$a<=>$b}keys%$t){push@s,$t->{$k}.'F * YM2151.opmBuffer[src'.($CH*$k+$lr?' + '.($CH*$k+$lr):'').']'}join' + ',@s}sub mul{my($t,$m)=@_;my$p={};for my$k(keys%$t){$p->{$k}=$t->{$k}*$m}$p}sub add{my($t,$u)=@_;my$s={};for my$k(keys%$t){$s->{$k}=$t->{$k}};for my$k(keys%$u){$s->{$k}=($s->{$k}//0)+$u->{$k}}$s}@out=();@w=();for$i(0..$m){$k=$n*$i;$t={};$t->{$i}=1;push@w,[$k,$t]}for$j(0..$n-1){$k=$m*$j;$r=$k%$n;$r or next;$q=($k-$r)/$n;$t={};$t->{$q}=($n-$r)/$n;$t->{$q+1}=$r/$n;push@w,[$k,$t];}@w=sort{$a->[0]<=>$b->[0]}@w;for$lr(0..$CH-1){push@out,sprintf'%*s//%s%c',$I,'',$CH==1?'mid':$lr?'right':'left',10;for$j(0..$n-1){$k=$m*$j;@v=grep{$k<=$_->[0]&&$_->[0]<=$k+$m}@w;$d={};for$i(0..@v-2){$d=add($d,mul(add($v[$i]->[1],$v[$i+1]->[1]),($v[$i+1]->[0]-$v[$i]->[0])))}$d=mul($d,65536/(2*$m));push@out,sprintf'%*st = (int) (%s + 32768F) >> 16;%c',$I,'',str($d,$lr),10;push@out,sprintf'%*ssndByteBlock[dst'.(2*($CH*$j+$lr)+0?' + '.(2*($CH*$j+$lr)+0):'').'] = (byte) t;%c',$I,'',10;push@out,sprintf'%*ssndByteBlock[dst + '.(2*($CH*$j+$lr)+1).'] = (byte) (t >> 8);%c',$I,'',10;}}$out=join'',@out;$out2='';%flag=();while($out=~/YM2151.opmBuffer\[src(?: \+ (\d+))?\]/){$out2.=$`;$out=$';$s=$&;$i=int(($1//0)/$CH);if($i==0||$i==$m){$out2.='(float) '.$s}else{$uv=$i%2?'v':'u';if(exists$flag{$s}){$out2.=$uv}else{$flag{$s}=1;$out2.='('.$uv.' = (float) '.$s.')'}}}$out2.=$out;print$out2"
  2046:             //left
  2047:             t = (int) (25165.824F * (float) YM2151.opmBuffer[src] + 38073.6853333333F * (v = (float) YM2151.opmBuffer[src + 2]) + 2296.49066666667F * (u = (float) YM2151.opmBuffer[src + 4]) + 32768F) >> 16;
  2048:             sndByteBlock[dst] = (byte) t;
  2049:             sndByteBlock[dst + 1] = (byte) (t >> 8);
  2050:             t = (int) (12257.9626666667F * v + 44092.0746666667F * u + 9185.96266666667F * (v = (float) YM2151.opmBuffer[src + 6]) + 32768F) >> 16;
  2051:             sndByteBlock[dst + 4] = (byte) t;
  2052:             sndByteBlock[dst + 5] = (byte) (t >> 8);
  2053:             t = (int) (3943.08266666667F * u + 40924.5013333333F * v + 20668.416F * (u = (float) YM2151.opmBuffer[src + 8]) + 32768F) >> 16;
  2054:             sndByteBlock[dst + 8] = (byte) t;
  2055:             sndByteBlock[dst + 9] = (byte) (t >> 8);
  2056:             t = (int) (221.184F * v + 29663.232F * u + 34559.3173333333F * (v = (float) YM2151.opmBuffer[src + 10]) + 1092.26666666667F * (u = (float) YM2151.opmBuffer[src + 12]) + 32768F) >> 16;
  2057:             sndByteBlock[dst + 12] = (byte) t;
  2058:             sndByteBlock[dst + 13] = (byte) (t >> 8);
  2059:             t = (int) (15772.3306666667F * v + 43207.3386666667F * u + 6556.33066666667F * (v = (float) YM2151.opmBuffer[src + 14]) + 32768F) >> 16;
  2060:             sndByteBlock[dst + 16] = (byte) t;
  2061:             sndByteBlock[dst + 17] = (byte) (t >> 8);
  2062:             t = (int) (6032.04266666667F * u + 42890.5813333333F * v + 16613.376F * (u = (float) YM2151.opmBuffer[src + 16]) + 32768F) >> 16;
  2063:             sndByteBlock[dst + 20] = (byte) t;
  2064:             sndByteBlock[dst + 21] = (byte) (t >> 8);
  2065:             t = (int) (884.736F * v + 33718.272F * u + 30602.5813333333F * (v = (float) YM2151.opmBuffer[src + 18]) + 330.410666666667F * (u = (float) YM2151.opmBuffer[src + 20]) + 32768F) >> 16;
  2066:             sndByteBlock[dst + 24] = (byte) t;
  2067:             sndByteBlock[dst + 25] = (byte) (t >> 8);
  2068:             t = (int) (19729.0666666667F * v + 41437.8666666667F * u + 4369.06666666667F * (v = (float) YM2151.opmBuffer[src + 22]) + 32768F) >> 16;
  2069:             sndByteBlock[dst + 28] = (byte) t;
  2070:             sndByteBlock[dst + 29] = (byte) (t >> 8);
  2071:             t = (int) (8563.37066666667F * u + 43971.9253333333F * v + 13000.704F * (u = (float) YM2151.opmBuffer[src + 24]) + 32768F) >> 16;
  2072:             sndByteBlock[dst + 32] = (byte) t;
  2073:             sndByteBlock[dst + 33] = (byte) (t >> 8);
  2074:             t = (int) (1990.656F * v + 37330.944F * u + 26203.4773333333F * (v = (float) YM2151.opmBuffer[src + 26]) + 10.9226666666667F * (u = (float) YM2151.opmBuffer[src + 28]) + 32768F) >> 16;
  2075:             sndByteBlock[dst + 36] = (byte) t;
  2076:             sndByteBlock[dst + 37] = (byte) (t >> 8);
  2077:             t = (int) (24128.1706666667F * v + 38783.6586666667F * u + 2624.17066666667F * (v = (float) YM2151.opmBuffer[src + 30]) + 32768F) >> 16;
  2078:             sndByteBlock[dst + 40] = (byte) t;
  2079:             sndByteBlock[dst + 41] = (byte) (t >> 8);
  2080:             t = (int) (11537.0666666667F * u + 44168.5333333333F * v + 9830.4F * (u = (float) YM2151.opmBuffer[src + 32]) + 32768F) >> 16;
  2081:             sndByteBlock[dst + 44] = (byte) t;
  2082:             sndByteBlock[dst + 45] = (byte) (t >> 8);
  2083:             t = (int) (3538.944F * v + 40367.4453333333F * u + 21629.6106666667F * (v = (float) YM2151.opmBuffer[src + 34]) + 32768F) >> 16;
  2084:             sndByteBlock[dst + 48] = (byte) t;
  2085:             sndByteBlock[dst + 49] = (byte) (t >> 8);
  2086:             t = (int) (133.802666666667F * u + 28702.0373333333F * v + 35378.5173333333F * (u = (float) YM2151.opmBuffer[src + 36]) + 1321.64266666667F * (v = (float) YM2151.opmBuffer[src + 38]) + 32768F) >> 16;
  2087:             sndByteBlock[dst + 52] = (byte) t;
  2088:             sndByteBlock[dst + 53] = (byte) (t >> 8);
  2089:             t = (int) (14953.1306666667F * u + 43480.4053333333F * v + 7102.464F * (u = (float) YM2151.opmBuffer[src + 40]) + 32768F) >> 16;
  2090:             sndByteBlock[dst + 56] = (byte) t;
  2091:             sndByteBlock[dst + 57] = (byte) (t >> 8);
  2092:             t = (int) (5529.6F * v + 42530.1333333333F * u + 17476.2666666667F * (v = (float) YM2151.opmBuffer[src + 42]) + 32768F) >> 16;
  2093:             sndByteBlock[dst + 60] = (byte) t;
  2094:             sndByteBlock[dst + 61] = (byte) (t >> 8);
  2095:             t = (int) (699.050666666667F * u + 32855.3813333333F * v + 31520.0853333333F * (u = (float) YM2151.opmBuffer[src + 44]) + 461.482666666667F * (v = (float) YM2151.opmBuffer[src + 46]) + 32768F) >> 16;
  2096:             sndByteBlock[dst + 64] = (byte) t;
  2097:             sndByteBlock[dst + 65] = (byte) (t >> 8);
  2098:             t = (int) (18811.5626666667F * u + 41907.5413333333F * v + 4816.896F * (u = (float) YM2151.opmBuffer[src + 48]) + 32768F) >> 16;
  2099:             sndByteBlock[dst + 68] = (byte) t;
  2100:             sndByteBlock[dst + 69] = (byte) (t >> 8);
  2101:             t = (int) (7962.624F * v + 43808.0853333333F * u + 13765.2906666667F * (v = (float) YM2151.opmBuffer[src + 50]) + 32768F) >> 16;
  2102:             sndByteBlock[dst + 72] = (byte) t;
  2103:             sndByteBlock[dst + 73] = (byte) (t >> 8);
  2104:             t = (int) (1706.66666666667F * u + 36566.3573333333F * v + 27219.2853333333F * (u = (float) YM2151.opmBuffer[src + 52]) + 43.6906666666667F * (v = (float) YM2151.opmBuffer[src + 54]) + 32768F) >> 16;
  2105:             sndByteBlock[dst + 76] = (byte) t;
  2106:             sndByteBlock[dst + 77] = (byte) (t >> 8);
  2107:             t = (int) (23112.3626666667F * u + 39449.9413333333F * v + 2973.696F * (u = (float) YM2151.opmBuffer[src + 56]) + 32768F) >> 16;
  2108:             sndByteBlock[dst + 80] = (byte) t;
  2109:             sndByteBlock[dst + 81] = (byte) (t >> 8);
  2110:             t = (int) (10838.016F * v + 44201.3013333333F * u + 10496.6826666667F * (v = (float) YM2151.opmBuffer[src + 58]) + 32768F) >> 16;
  2111:             sndByteBlock[dst + 84] = (byte) t;
  2112:             sndByteBlock[dst + 85] = (byte) (t >> 8);
  2113:             t = (int) (3156.65066666667F * u + 39766.6986666667F * v + 22612.6506666667F * (u = (float) YM2151.opmBuffer[src + 60]) + 32768F) >> 16;
  2114:             sndByteBlock[dst + 88] = (byte) t;
  2115:             sndByteBlock[dst + 89] = (byte) (t >> 8);
  2116:             t = (int) (68.2666666666667F * v + 27718.9973333333F * u + 36175.872F * (v = (float) YM2151.opmBuffer[src + 62]) + 1572.864F * (u = (float) YM2151.opmBuffer[src + 64]) + 32768F) >> 16;
  2117:             sndByteBlock[dst + 92] = (byte) t;
  2118:             sndByteBlock[dst + 93] = (byte) (t >> 8);
  2119:             t = (int) (14155.776F * v + 43709.7813333333F * u + 7670.44266666667F * (v = (float) YM2151.opmBuffer[src + 66]) + 32768F) >> 16;
  2120:             sndByteBlock[dst + 96] = (byte) t;
  2121:             sndByteBlock[dst + 97] = (byte) (t >> 8);
  2122:             t = (int) (5049.00266666667F * u + 42125.9946666667F * v + 18361.0026666667F * (u = (float) YM2151.opmBuffer[src + 68]) + 32768F) >> 16;
  2123:             sndByteBlock[dst + 100] = (byte) t;
  2124:             sndByteBlock[dst + 101] = (byte) (t >> 8);
  2125:             t = (int) (535.210666666667F * v + 31970.6453333333F * u + 32415.744F * (v = (float) YM2151.opmBuffer[src + 70]) + 614.4F * (u = (float) YM2151.opmBuffer[src + 72]) + 32768F) >> 16;
  2126:             sndByteBlock[dst + 104] = (byte) t;
  2127:             sndByteBlock[dst + 105] = (byte) (t >> 8);
  2128:             t = (int) (17915.904F * v + 42333.5253333333F * u + 5286.57066666667F * (v = (float) YM2151.opmBuffer[src + 74]) + 32768F) >> 16;
  2129:             sndByteBlock[dst + 108] = (byte) t;
  2130:             sndByteBlock[dst + 109] = (byte) (t >> 8);
  2131:             t = (int) (7383.72266666667F * u + 43600.5546666667F * v + 14551.7226666667F * (u = (float) YM2151.opmBuffer[src + 76]) + 32768F) >> 16;
  2132:             sndByteBlock[dst + 112] = (byte) t;
  2133:             sndByteBlock[dst + 113] = (byte) (t >> 8);
  2134:             t = (int) (1444.52266666667F * v + 35779.9253333333F * u + 28213.248F * (v = (float) YM2151.opmBuffer[src + 78]) + 98.304F * (u = (float) YM2151.opmBuffer[src + 80]) + 32768F) >> 16;
  2135:             sndByteBlock[dst + 116] = (byte) t;
  2136:             sndByteBlock[dst + 117] = (byte) (t >> 8);
  2137:             t = (int) (22118.4F * v + 40072.5333333333F * u + 3345.06666666667F * (v = (float) YM2151.opmBuffer[src + 82]) + 32768F) >> 16;
  2138:             sndByteBlock[dst + 120] = (byte) t;
  2139:             sndByteBlock[dst + 121] = (byte) (t >> 8);
  2140:             t = (int) (10160.8106666667F * u + 44190.3786666667F * v + 11184.8106666667F * (u = (float) YM2151.opmBuffer[src + 84]) + 32768F) >> 16;
  2141:             sndByteBlock[dst + 124] = (byte) t;
  2142:             sndByteBlock[dst + 125] = (byte) (t >> 8);
  2143:             t = (int) (2796.20266666667F * v + 39122.2613333333F * u + 23617.536F * (v = (float) YM2151.opmBuffer[src + 86]) + 32768F) >> 16;
  2144:             sndByteBlock[dst + 128] = (byte) t;
  2145:             sndByteBlock[dst + 129] = (byte) (t >> 8);
  2146:             t = (int) (24.576F * u + 26714.112F * v + 36951.3813333333F * (u = (float) YM2151.opmBuffer[src + 88]) + 1845.93066666667F * (v = (float) YM2151.opmBuffer[src + 90]) + 32768F) >> 16;
  2147:             sndByteBlock[dst + 132] = (byte) t;
  2148:             sndByteBlock[dst + 133] = (byte) (t >> 8);
  2149:             t = (int) (13380.2666666667F * u + 43895.4666666667F * v + 8260.26666666667F * (u = (float) YM2151.opmBuffer[src + 92]) + 32768F) >> 16;
  2150:             sndByteBlock[dst + 136] = (byte) t;
  2151:             sndByteBlock[dst + 137] = (byte) (t >> 8);
  2152:             t = (int) (4590.25066666667F * v + 41678.1653333333F * u + 19267.584F * (v = (float) YM2151.opmBuffer[src + 94]) + 32768F) >> 16;
  2153:             sndByteBlock[dst + 140] = (byte) t;
  2154:             sndByteBlock[dst + 141] = (byte) (t >> 8);
  2155:             t = (int) (393.216F * u + 31064.064F * v + 33289.5573333333F * (u = (float) YM2151.opmBuffer[src + 96]) + 789.162666666667F * (v = (float) YM2151.opmBuffer[src + 98]) + 32768F) >> 16;
  2156:             sndByteBlock[dst + 144] = (byte) t;
  2157:             sndByteBlock[dst + 145] = (byte) (t >> 8);
  2158:             t = (int) (17042.0906666667F * u + 42715.8186666667F * v + 5778.09066666667F * (u = (float) YM2151.opmBuffer[src + 100]) + 32768F) >> 16;
  2159:             sndByteBlock[dst + 148] = (byte) t;
  2160:             sndByteBlock[dst + 149] = (byte) (t >> 8);
  2161:             t = (int) (6826.66666666667F * v + 43349.3333333333F * u + 15360F * (v = (float) YM2151.opmBuffer[src + 102]) + 32768F) >> 16;
  2162:             sndByteBlock[dst + 152] = (byte) t;
  2163:             sndByteBlock[dst + 153] = (byte) (t >> 8);
  2164:             t = (int) (1204.224F * u + 34971.648F * v + 29185.3653333333F * (u = (float) YM2151.opmBuffer[src + 104]) + 174.762666666667F * (v = (float) YM2151.opmBuffer[src + 106]) + 32768F) >> 16;
  2165:             sndByteBlock[dst + 156] = (byte) t;
  2166:             sndByteBlock[dst + 157] = (byte) (t >> 8);
  2167:             t = (int) (21146.2826666667F * u + 40651.4346666667F * v + 3738.28266666667F * (u = (float) YM2151.opmBuffer[src + 108]) + 32768F) >> 16;
  2168:             sndByteBlock[dst + 160] = (byte) t;
  2169:             sndByteBlock[dst + 161] = (byte) (t >> 8);
  2170:             t = (int) (9505.45066666667F * v + 44135.7653333333F * u + 11894.784F * (v = (float) YM2151.opmBuffer[src + 110]) + 32768F) >> 16;
  2171:             sndByteBlock[dst + 164] = (byte) t;
  2172:             sndByteBlock[dst + 165] = (byte) (t >> 8);
  2173:             t = (int) (2457.6F * u + 38434.1333333333F * v + 24644.2666666667F * (u = (float) YM2151.opmBuffer[src + 112]) + 32768F) >> 16;
  2174:             sndByteBlock[dst + 168] = (byte) t;
  2175:             sndByteBlock[dst + 169] = (byte) (t >> 8);
  2176:             t = (int) (2.73066666666667F * v + 25687.3813333333F * u + 37705.0453333333F * (v = (float) YM2151.opmBuffer[src + 114]) + 2140.84266666667F * (u = (float) YM2151.opmBuffer[src + 116]) + 32768F) >> 16;
  2177:             sndByteBlock[dst + 172] = (byte) t;
  2178:             sndByteBlock[dst + 173] = (byte) (t >> 8);
  2179:             t = (int) (12626.6026666667F * v + 44037.4613333333F * u + 8871.936F * (v = (float) YM2151.opmBuffer[src + 118]) + 32768F) >> 16;
  2180:             sndByteBlock[dst + 176] = (byte) t;
  2181:             sndByteBlock[dst + 177] = (byte) (t >> 8);
  2182:             t = (int) (4153.344F * u + 41186.6453333333F * v + 20196.0106666667F * (u = (float) YM2151.opmBuffer[src + 120]) + 32768F) >> 16;
  2183:             sndByteBlock[dst + 180] = (byte) t;
  2184:             sndByteBlock[dst + 181] = (byte) (t >> 8);
  2185:             t = (int) (273.066666666667F * v + 30135.6373333333F * u + 34141.5253333333F * (v = (float) YM2151.opmBuffer[src + 122]) + 985.770666666667F * (u = (float) YM2151.opmBuffer[src + 124]) + 32768F) >> 16;
  2186:             sndByteBlock[dst + 184] = (byte) t;
  2187:             sndByteBlock[dst + 185] = (byte) (t >> 8);
  2188:             t = (int) (16190.1226666667F * v + 43054.4213333333F * u + 6291.456F * (v = (float) YM2151.opmBuffer[src + 126]) + 32768F) >> 16;
  2189:             sndByteBlock[dst + 188] = (byte) t;
  2190:             sndByteBlock[dst + 189] = (byte) (t >> 8);
  2191:             t = (int) (6291.456F * u + 43054.4213333333F * v + 16190.1226666667F * (u = (float) YM2151.opmBuffer[src + 128]) + 32768F) >> 16;
  2192:             sndByteBlock[dst + 192] = (byte) t;
  2193:             sndByteBlock[dst + 193] = (byte) (t >> 8);
  2194:             t = (int) (985.770666666667F * v + 34141.5253333333F * u + 30135.6373333333F * (v = (float) YM2151.opmBuffer[src + 130]) + 273.066666666667F * (u = (float) YM2151.opmBuffer[src + 132]) + 32768F) >> 16;
  2195:             sndByteBlock[dst + 196] = (byte) t;
  2196:             sndByteBlock[dst + 197] = (byte) (t >> 8);
  2197:             t = (int) (20196.0106666667F * v + 41186.6453333333F * u + 4153.344F * (v = (float) YM2151.opmBuffer[src + 134]) + 32768F) >> 16;
  2198:             sndByteBlock[dst + 200] = (byte) t;
  2199:             sndByteBlock[dst + 201] = (byte) (t >> 8);
  2200:             t = (int) (8871.936F * u + 44037.4613333333F * v + 12626.6026666667F * (u = (float) YM2151.opmBuffer[src + 136]) + 32768F) >> 16;
  2201:             sndByteBlock[dst + 204] = (byte) t;
  2202:             sndByteBlock[dst + 205] = (byte) (t >> 8);
  2203:             t = (int) (2140.84266666667F * v + 37705.0453333333F * u + 25687.3813333333F * (v = (float) YM2151.opmBuffer[src + 138]) + 2.73066666666667F * (u = (float) YM2151.opmBuffer[src + 140]) + 32768F) >> 16;
  2204:             sndByteBlock[dst + 208] = (byte) t;
  2205:             sndByteBlock[dst + 209] = (byte) (t >> 8);
  2206:             t = (int) (24644.2666666667F * v + 38434.1333333333F * u + 2457.6F * (v = (float) YM2151.opmBuffer[src + 142]) + 32768F) >> 16;
  2207:             sndByteBlock[dst + 212] = (byte) t;
  2208:             sndByteBlock[dst + 213] = (byte) (t >> 8);
  2209:             t = (int) (11894.784F * u + 44135.7653333333F * v + 9505.45066666667F * (u = (float) YM2151.opmBuffer[src + 144]) + 32768F) >> 16;
  2210:             sndByteBlock[dst + 216] = (byte) t;
  2211:             sndByteBlock[dst + 217] = (byte) (t >> 8);
  2212:             t = (int) (3738.28266666667F * v + 40651.4346666667F * u + 21146.2826666667F * (v = (float) YM2151.opmBuffer[src + 146]) + 32768F) >> 16;
  2213:             sndByteBlock[dst + 220] = (byte) t;
  2214:             sndByteBlock[dst + 221] = (byte) (t >> 8);
  2215:             t = (int) (174.762666666667F * u + 29185.3653333333F * v + 34971.648F * (u = (float) YM2151.opmBuffer[src + 148]) + 1204.224F * (v = (float) YM2151.opmBuffer[src + 150]) + 32768F) >> 16;
  2216:             sndByteBlock[dst + 224] = (byte) t;
  2217:             sndByteBlock[dst + 225] = (byte) (t >> 8);
  2218:             t = (int) (15360F * u + 43349.3333333333F * v + 6826.66666666667F * (u = (float) YM2151.opmBuffer[src + 152]) + 32768F) >> 16;
  2219:             sndByteBlock[dst + 228] = (byte) t;
  2220:             sndByteBlock[dst + 229] = (byte) (t >> 8);
  2221:             t = (int) (5778.09066666667F * v + 42715.8186666667F * u + 17042.0906666667F * (v = (float) YM2151.opmBuffer[src + 154]) + 32768F) >> 16;
  2222:             sndByteBlock[dst + 232] = (byte) t;
  2223:             sndByteBlock[dst + 233] = (byte) (t >> 8);
  2224:             t = (int) (789.162666666667F * u + 33289.5573333333F * v + 31064.064F * (u = (float) YM2151.opmBuffer[src + 156]) + 393.216F * (v = (float) YM2151.opmBuffer[src + 158]) + 32768F) >> 16;
  2225:             sndByteBlock[dst + 236] = (byte) t;
  2226:             sndByteBlock[dst + 237] = (byte) (t >> 8);
  2227:             t = (int) (19267.584F * u + 41678.1653333333F * v + 4590.25066666667F * (u = (float) YM2151.opmBuffer[src + 160]) + 32768F) >> 16;
  2228:             sndByteBlock[dst + 240] = (byte) t;
  2229:             sndByteBlock[dst + 241] = (byte) (t >> 8);
  2230:             t = (int) (8260.26666666667F * v + 43895.4666666667F * u + 13380.2666666667F * (v = (float) YM2151.opmBuffer[src + 162]) + 32768F) >> 16;
  2231:             sndByteBlock[dst + 244] = (byte) t;
  2232:             sndByteBlock[dst + 245] = (byte) (t >> 8);
  2233:             t = (int) (1845.93066666667F * u + 36951.3813333333F * v + 26714.112F * (u = (float) YM2151.opmBuffer[src + 164]) + 24.576F * (v = (float) YM2151.opmBuffer[src + 166]) + 32768F) >> 16;
  2234:             sndByteBlock[dst + 248] = (byte) t;
  2235:             sndByteBlock[dst + 249] = (byte) (t >> 8);
  2236:             t = (int) (23617.536F * u + 39122.2613333333F * v + 2796.20266666667F * (u = (float) YM2151.opmBuffer[src + 168]) + 32768F) >> 16;
  2237:             sndByteBlock[dst + 252] = (byte) t;
  2238:             sndByteBlock[dst + 253] = (byte) (t >> 8);
  2239:             t = (int) (11184.8106666667F * v + 44190.3786666667F * u + 10160.8106666667F * (v = (float) YM2151.opmBuffer[src + 170]) + 32768F) >> 16;
  2240:             sndByteBlock[dst + 256] = (byte) t;
  2241:             sndByteBlock[dst + 257] = (byte) (t >> 8);
  2242:             t = (int) (3345.06666666667F * u + 40072.5333333333F * v + 22118.4F * (u = (float) YM2151.opmBuffer[src + 172]) + 32768F) >> 16;
  2243:             sndByteBlock[dst + 260] = (byte) t;
  2244:             sndByteBlock[dst + 261] = (byte) (t >> 8);
  2245:             t = (int) (98.304F * v + 28213.248F * u + 35779.9253333333F * (v = (float) YM2151.opmBuffer[src + 174]) + 1444.52266666667F * (u = (float) YM2151.opmBuffer[src + 176]) + 32768F) >> 16;
  2246:             sndByteBlock[dst + 264] = (byte) t;
  2247:             sndByteBlock[dst + 265] = (byte) (t >> 8);
  2248:             t = (int) (14551.7226666667F * v + 43600.5546666667F * u + 7383.72266666667F * (v = (float) YM2151.opmBuffer[src + 178]) + 32768F) >> 16;
  2249:             sndByteBlock[dst + 268] = (byte) t;
  2250:             sndByteBlock[dst + 269] = (byte) (t >> 8);
  2251:             t = (int) (5286.57066666667F * u + 42333.5253333333F * v + 17915.904F * (u = (float) YM2151.opmBuffer[src + 180]) + 32768F) >> 16;
  2252:             sndByteBlock[dst + 272] = (byte) t;
  2253:             sndByteBlock[dst + 273] = (byte) (t >> 8);
  2254:             t = (int) (614.4F * v + 32415.744F * u + 31970.6453333333F * (v = (float) YM2151.opmBuffer[src + 182]) + 535.210666666667F * (u = (float) YM2151.opmBuffer[src + 184]) + 32768F) >> 16;
  2255:             sndByteBlock[dst + 276] = (byte) t;
  2256:             sndByteBlock[dst + 277] = (byte) (t >> 8);
  2257:             t = (int) (18361.0026666667F * v + 42125.9946666667F * u + 5049.00266666667F * (v = (float) YM2151.opmBuffer[src + 186]) + 32768F) >> 16;
  2258:             sndByteBlock[dst + 280] = (byte) t;
  2259:             sndByteBlock[dst + 281] = (byte) (t >> 8);
  2260:             t = (int) (7670.44266666667F * u + 43709.7813333333F * v + 14155.776F * (u = (float) YM2151.opmBuffer[src + 188]) + 32768F) >> 16;
  2261:             sndByteBlock[dst + 284] = (byte) t;
  2262:             sndByteBlock[dst + 285] = (byte) (t >> 8);
  2263:             t = (int) (1572.864F * v + 36175.872F * u + 27718.9973333333F * (v = (float) YM2151.opmBuffer[src + 190]) + 68.2666666666667F * (u = (float) YM2151.opmBuffer[src + 192]) + 32768F) >> 16;
  2264:             sndByteBlock[dst + 288] = (byte) t;
  2265:             sndByteBlock[dst + 289] = (byte) (t >> 8);
  2266:             t = (int) (22612.6506666667F * v + 39766.6986666667F * u + 3156.65066666667F * (v = (float) YM2151.opmBuffer[src + 194]) + 32768F) >> 16;
  2267:             sndByteBlock[dst + 292] = (byte) t;
  2268:             sndByteBlock[dst + 293] = (byte) (t >> 8);
  2269:             t = (int) (10496.6826666667F * u + 44201.3013333333F * v + 10838.016F * (u = (float) YM2151.opmBuffer[src + 196]) + 32768F) >> 16;
  2270:             sndByteBlock[dst + 296] = (byte) t;
  2271:             sndByteBlock[dst + 297] = (byte) (t >> 8);
  2272:             t = (int) (2973.696F * v + 39449.9413333333F * u + 23112.3626666667F * (v = (float) YM2151.opmBuffer[src + 198]) + 32768F) >> 16;
  2273:             sndByteBlock[dst + 300] = (byte) t;
  2274:             sndByteBlock[dst + 301] = (byte) (t >> 8);
  2275:             t = (int) (43.6906666666667F * u + 27219.2853333333F * v + 36566.3573333333F * (u = (float) YM2151.opmBuffer[src + 200]) + 1706.66666666667F * (v = (float) YM2151.opmBuffer[src + 202]) + 32768F) >> 16;
  2276:             sndByteBlock[dst + 304] = (byte) t;
  2277:             sndByteBlock[dst + 305] = (byte) (t >> 8);
  2278:             t = (int) (13765.2906666667F * u + 43808.0853333333F * v + 7962.624F * (u = (float) YM2151.opmBuffer[src + 204]) + 32768F) >> 16;
  2279:             sndByteBlock[dst + 308] = (byte) t;
  2280:             sndByteBlock[dst + 309] = (byte) (t >> 8);
  2281:             t = (int) (4816.896F * v + 41907.5413333333F * u + 18811.5626666667F * (v = (float) YM2151.opmBuffer[src + 206]) + 32768F) >> 16;
  2282:             sndByteBlock[dst + 312] = (byte) t;
  2283:             sndByteBlock[dst + 313] = (byte) (t >> 8);
  2284:             t = (int) (461.482666666667F * u + 31520.0853333333F * v + 32855.3813333333F * (u = (float) YM2151.opmBuffer[src + 208]) + 699.050666666667F * (v = (float) YM2151.opmBuffer[src + 210]) + 32768F) >> 16;
  2285:             sndByteBlock[dst + 316] = (byte) t;
  2286:             sndByteBlock[dst + 317] = (byte) (t >> 8);
  2287:             t = (int) (17476.2666666667F * u + 42530.1333333333F * v + 5529.6F * (u = (float) YM2151.opmBuffer[src + 212]) + 32768F) >> 16;
  2288:             sndByteBlock[dst + 320] = (byte) t;
  2289:             sndByteBlock[dst + 321] = (byte) (t >> 8);
  2290:             t = (int) (7102.464F * v + 43480.4053333333F * u + 14953.1306666667F * (v = (float) YM2151.opmBuffer[src + 214]) + 32768F) >> 16;
  2291:             sndByteBlock[dst + 324] = (byte) t;
  2292:             sndByteBlock[dst + 325] = (byte) (t >> 8);
  2293:             t = (int) (1321.64266666667F * u + 35378.5173333333F * v + 28702.0373333333F * (u = (float) YM2151.opmBuffer[src + 216]) + 133.802666666667F * (v = (float) YM2151.opmBuffer[src + 218]) + 32768F) >> 16;
  2294:             sndByteBlock[dst + 328] = (byte) t;
  2295:             sndByteBlock[dst + 329] = (byte) (t >> 8);
  2296:             t = (int) (21629.6106666667F * u + 40367.4453333333F * v + 3538.944F * (u = (float) YM2151.opmBuffer[src + 220]) + 32768F) >> 16;
  2297:             sndByteBlock[dst + 332] = (byte) t;
  2298:             sndByteBlock[dst + 333] = (byte) (t >> 8);
  2299:             t = (int) (9830.4F * v + 44168.5333333333F * u + 11537.0666666667F * (v = (float) YM2151.opmBuffer[src + 222]) + 32768F) >> 16;
  2300:             sndByteBlock[dst + 336] = (byte) t;
  2301:             sndByteBlock[dst + 337] = (byte) (t >> 8);
  2302:             t = (int) (2624.17066666667F * u + 38783.6586666667F * v + 24128.1706666667F * (u = (float) YM2151.opmBuffer[src + 224]) + 32768F) >> 16;
  2303:             sndByteBlock[dst + 340] = (byte) t;
  2304:             sndByteBlock[dst + 341] = (byte) (t >> 8);
  2305:             t = (int) (10.9226666666667F * v + 26203.4773333333F * u + 37330.944F * (v = (float) YM2151.opmBuffer[src + 226]) + 1990.656F * (u = (float) YM2151.opmBuffer[src + 228]) + 32768F) >> 16;
  2306:             sndByteBlock[dst + 344] = (byte) t;
  2307:             sndByteBlock[dst + 345] = (byte) (t >> 8);
  2308:             t = (int) (13000.704F * v + 43971.9253333333F * u + 8563.37066666667F * (v = (float) YM2151.opmBuffer[src + 230]) + 32768F) >> 16;
  2309:             sndByteBlock[dst + 348] = (byte) t;
  2310:             sndByteBlock[dst + 349] = (byte) (t >> 8);
  2311:             t = (int) (4369.06666666667F * u + 41437.8666666667F * v + 19729.0666666667F * (u = (float) YM2151.opmBuffer[src + 232]) + 32768F) >> 16;
  2312:             sndByteBlock[dst + 352] = (byte) t;
  2313:             sndByteBlock[dst + 353] = (byte) (t >> 8);
  2314:             t = (int) (330.410666666667F * v + 30602.5813333333F * u + 33718.272F * (v = (float) YM2151.opmBuffer[src + 234]) + 884.736F * (u = (float) YM2151.opmBuffer[src + 236]) + 32768F) >> 16;
  2315:             sndByteBlock[dst + 356] = (byte) t;
  2316:             sndByteBlock[dst + 357] = (byte) (t >> 8);
  2317:             t = (int) (16613.376F * v + 42890.5813333333F * u + 6032.04266666667F * (v = (float) YM2151.opmBuffer[src + 238]) + 32768F) >> 16;
  2318:             sndByteBlock[dst + 360] = (byte) t;
  2319:             sndByteBlock[dst + 361] = (byte) (t >> 8);
  2320:             t = (int) (6556.33066666667F * u + 43207.3386666667F * v + 15772.3306666667F * (u = (float) YM2151.opmBuffer[src + 240]) + 32768F) >> 16;
  2321:             sndByteBlock[dst + 364] = (byte) t;
  2322:             sndByteBlock[dst + 365] = (byte) (t >> 8);
  2323:             t = (int) (1092.26666666667F * v + 34559.3173333333F * u + 29663.232F * (v = (float) YM2151.opmBuffer[src + 242]) + 221.184F * (u = (float) YM2151.opmBuffer[src + 244]) + 32768F) >> 16;
  2324:             sndByteBlock[dst + 368] = (byte) t;
  2325:             sndByteBlock[dst + 369] = (byte) (t >> 8);
  2326:             t = (int) (20668.416F * v + 40924.5013333333F * u + 3943.08266666667F * (v = (float) YM2151.opmBuffer[src + 246]) + 32768F) >> 16;
  2327:             sndByteBlock[dst + 372] = (byte) t;
  2328:             sndByteBlock[dst + 373] = (byte) (t >> 8);
  2329:             t = (int) (9185.96266666667F * u + 44092.0746666667F * v + 12257.9626666667F * (u = (float) YM2151.opmBuffer[src + 248]) + 32768F) >> 16;
  2330:             sndByteBlock[dst + 376] = (byte) t;
  2331:             sndByteBlock[dst + 377] = (byte) (t >> 8);
  2332:             t = (int) (2296.49066666667F * v + 38073.6853333333F * u + 25165.824F * (float) YM2151.opmBuffer[src + 250] + 32768F) >> 16;
  2333:             sndByteBlock[dst + 380] = (byte) t;
  2334:             sndByteBlock[dst + 381] = (byte) (t >> 8);
  2335:             //right
  2336:             t = (int) (25165.824F * (float) YM2151.opmBuffer[src + 1] + 38073.6853333333F * (v = (float) YM2151.opmBuffer[src + 3]) + 2296.49066666667F * (u = (float) YM2151.opmBuffer[src + 5]) + 32768F) >> 16;
  2337:             sndByteBlock[dst + 2] = (byte) t;
  2338:             sndByteBlock[dst + 3] = (byte) (t >> 8);
  2339:             t = (int) (12257.9626666667F * v + 44092.0746666667F * u + 9185.96266666667F * (v = (float) YM2151.opmBuffer[src + 7]) + 32768F) >> 16;
  2340:             sndByteBlock[dst + 6] = (byte) t;
  2341:             sndByteBlock[dst + 7] = (byte) (t >> 8);
  2342:             t = (int) (3943.08266666667F * u + 40924.5013333333F * v + 20668.416F * (u = (float) YM2151.opmBuffer[src + 9]) + 32768F) >> 16;
  2343:             sndByteBlock[dst + 10] = (byte) t;
  2344:             sndByteBlock[dst + 11] = (byte) (t >> 8);
  2345:             t = (int) (221.184F * v + 29663.232F * u + 34559.3173333333F * (v = (float) YM2151.opmBuffer[src + 11]) + 1092.26666666667F * (u = (float) YM2151.opmBuffer[src + 13]) + 32768F) >> 16;
  2346:             sndByteBlock[dst + 14] = (byte) t;
  2347:             sndByteBlock[dst + 15] = (byte) (t >> 8);
  2348:             t = (int) (15772.3306666667F * v + 43207.3386666667F * u + 6556.33066666667F * (v = (float) YM2151.opmBuffer[src + 15]) + 32768F) >> 16;
  2349:             sndByteBlock[dst + 18] = (byte) t;
  2350:             sndByteBlock[dst + 19] = (byte) (t >> 8);
  2351:             t = (int) (6032.04266666667F * u + 42890.5813333333F * v + 16613.376F * (u = (float) YM2151.opmBuffer[src + 17]) + 32768F) >> 16;
  2352:             sndByteBlock[dst + 22] = (byte) t;
  2353:             sndByteBlock[dst + 23] = (byte) (t >> 8);
  2354:             t = (int) (884.736F * v + 33718.272F * u + 30602.5813333333F * (v = (float) YM2151.opmBuffer[src + 19]) + 330.410666666667F * (u = (float) YM2151.opmBuffer[src + 21]) + 32768F) >> 16;
  2355:             sndByteBlock[dst + 26] = (byte) t;
  2356:             sndByteBlock[dst + 27] = (byte) (t >> 8);
  2357:             t = (int) (19729.0666666667F * v + 41437.8666666667F * u + 4369.06666666667F * (v = (float) YM2151.opmBuffer[src + 23]) + 32768F) >> 16;
  2358:             sndByteBlock[dst + 30] = (byte) t;
  2359:             sndByteBlock[dst + 31] = (byte) (t >> 8);
  2360:             t = (int) (8563.37066666667F * u + 43971.9253333333F * v + 13000.704F * (u = (float) YM2151.opmBuffer[src + 25]) + 32768F) >> 16;
  2361:             sndByteBlock[dst + 34] = (byte) t;
  2362:             sndByteBlock[dst + 35] = (byte) (t >> 8);
  2363:             t = (int) (1990.656F * v + 37330.944F * u + 26203.4773333333F * (v = (float) YM2151.opmBuffer[src + 27]) + 10.9226666666667F * (u = (float) YM2151.opmBuffer[src + 29]) + 32768F) >> 16;
  2364:             sndByteBlock[dst + 38] = (byte) t;
  2365:             sndByteBlock[dst + 39] = (byte) (t >> 8);
  2366:             t = (int) (24128.1706666667F * v + 38783.6586666667F * u + 2624.17066666667F * (v = (float) YM2151.opmBuffer[src + 31]) + 32768F) >> 16;
  2367:             sndByteBlock[dst + 42] = (byte) t;
  2368:             sndByteBlock[dst + 43] = (byte) (t >> 8);
  2369:             t = (int) (11537.0666666667F * u + 44168.5333333333F * v + 9830.4F * (u = (float) YM2151.opmBuffer[src + 33]) + 32768F) >> 16;
  2370:             sndByteBlock[dst + 46] = (byte) t;
  2371:             sndByteBlock[dst + 47] = (byte) (t >> 8);
  2372:             t = (int) (3538.944F * v + 40367.4453333333F * u + 21629.6106666667F * (v = (float) YM2151.opmBuffer[src + 35]) + 32768F) >> 16;
  2373:             sndByteBlock[dst + 50] = (byte) t;
  2374:             sndByteBlock[dst + 51] = (byte) (t >> 8);
  2375:             t = (int) (133.802666666667F * u + 28702.0373333333F * v + 35378.5173333333F * (u = (float) YM2151.opmBuffer[src + 37]) + 1321.64266666667F * (v = (float) YM2151.opmBuffer[src + 39]) + 32768F) >> 16;
  2376:             sndByteBlock[dst + 54] = (byte) t;
  2377:             sndByteBlock[dst + 55] = (byte) (t >> 8);
  2378:             t = (int) (14953.1306666667F * u + 43480.4053333333F * v + 7102.464F * (u = (float) YM2151.opmBuffer[src + 41]) + 32768F) >> 16;
  2379:             sndByteBlock[dst + 58] = (byte) t;
  2380:             sndByteBlock[dst + 59] = (byte) (t >> 8);
  2381:             t = (int) (5529.6F * v + 42530.1333333333F * u + 17476.2666666667F * (v = (float) YM2151.opmBuffer[src + 43]) + 32768F) >> 16;
  2382:             sndByteBlock[dst + 62] = (byte) t;
  2383:             sndByteBlock[dst + 63] = (byte) (t >> 8);
  2384:             t = (int) (699.050666666667F * u + 32855.3813333333F * v + 31520.0853333333F * (u = (float) YM2151.opmBuffer[src + 45]) + 461.482666666667F * (v = (float) YM2151.opmBuffer[src + 47]) + 32768F) >> 16;
  2385:             sndByteBlock[dst + 66] = (byte) t;
  2386:             sndByteBlock[dst + 67] = (byte) (t >> 8);
  2387:             t = (int) (18811.5626666667F * u + 41907.5413333333F * v + 4816.896F * (u = (float) YM2151.opmBuffer[src + 49]) + 32768F) >> 16;
  2388:             sndByteBlock[dst + 70] = (byte) t;
  2389:             sndByteBlock[dst + 71] = (byte) (t >> 8);
  2390:             t = (int) (7962.624F * v + 43808.0853333333F * u + 13765.2906666667F * (v = (float) YM2151.opmBuffer[src + 51]) + 32768F) >> 16;
  2391:             sndByteBlock[dst + 74] = (byte) t;
  2392:             sndByteBlock[dst + 75] = (byte) (t >> 8);
  2393:             t = (int) (1706.66666666667F * u + 36566.3573333333F * v + 27219.2853333333F * (u = (float) YM2151.opmBuffer[src + 53]) + 43.6906666666667F * (v = (float) YM2151.opmBuffer[src + 55]) + 32768F) >> 16;
  2394:             sndByteBlock[dst + 78] = (byte) t;
  2395:             sndByteBlock[dst + 79] = (byte) (t >> 8);
  2396:             t = (int) (23112.3626666667F * u + 39449.9413333333F * v + 2973.696F * (u = (float) YM2151.opmBuffer[src + 57]) + 32768F) >> 16;
  2397:             sndByteBlock[dst + 82] = (byte) t;
  2398:             sndByteBlock[dst + 83] = (byte) (t >> 8);
  2399:             t = (int) (10838.016F * v + 44201.3013333333F * u + 10496.6826666667F * (v = (float) YM2151.opmBuffer[src + 59]) + 32768F) >> 16;
  2400:             sndByteBlock[dst + 86] = (byte) t;
  2401:             sndByteBlock[dst + 87] = (byte) (t >> 8);
  2402:             t = (int) (3156.65066666667F * u + 39766.6986666667F * v + 22612.6506666667F * (u = (float) YM2151.opmBuffer[src + 61]) + 32768F) >> 16;
  2403:             sndByteBlock[dst + 90] = (byte) t;
  2404:             sndByteBlock[dst + 91] = (byte) (t >> 8);
  2405:             t = (int) (68.2666666666667F * v + 27718.9973333333F * u + 36175.872F * (v = (float) YM2151.opmBuffer[src + 63]) + 1572.864F * (u = (float) YM2151.opmBuffer[src + 65]) + 32768F) >> 16;
  2406:             sndByteBlock[dst + 94] = (byte) t;
  2407:             sndByteBlock[dst + 95] = (byte) (t >> 8);
  2408:             t = (int) (14155.776F * v + 43709.7813333333F * u + 7670.44266666667F * (v = (float) YM2151.opmBuffer[src + 67]) + 32768F) >> 16;
  2409:             sndByteBlock[dst + 98] = (byte) t;
  2410:             sndByteBlock[dst + 99] = (byte) (t >> 8);
  2411:             t = (int) (5049.00266666667F * u + 42125.9946666667F * v + 18361.0026666667F * (u = (float) YM2151.opmBuffer[src + 69]) + 32768F) >> 16;
  2412:             sndByteBlock[dst + 102] = (byte) t;
  2413:             sndByteBlock[dst + 103] = (byte) (t >> 8);
  2414:             t = (int) (535.210666666667F * v + 31970.6453333333F * u + 32415.744F * (v = (float) YM2151.opmBuffer[src + 71]) + 614.4F * (u = (float) YM2151.opmBuffer[src + 73]) + 32768F) >> 16;
  2415:             sndByteBlock[dst + 106] = (byte) t;
  2416:             sndByteBlock[dst + 107] = (byte) (t >> 8);
  2417:             t = (int) (17915.904F * v + 42333.5253333333F * u + 5286.57066666667F * (v = (float) YM2151.opmBuffer[src + 75]) + 32768F) >> 16;
  2418:             sndByteBlock[dst + 110] = (byte) t;
  2419:             sndByteBlock[dst + 111] = (byte) (t >> 8);
  2420:             t = (int) (7383.72266666667F * u + 43600.5546666667F * v + 14551.7226666667F * (u = (float) YM2151.opmBuffer[src + 77]) + 32768F) >> 16;
  2421:             sndByteBlock[dst + 114] = (byte) t;
  2422:             sndByteBlock[dst + 115] = (byte) (t >> 8);
  2423:             t = (int) (1444.52266666667F * v + 35779.9253333333F * u + 28213.248F * (v = (float) YM2151.opmBuffer[src + 79]) + 98.304F * (u = (float) YM2151.opmBuffer[src + 81]) + 32768F) >> 16;
  2424:             sndByteBlock[dst + 118] = (byte) t;
  2425:             sndByteBlock[dst + 119] = (byte) (t >> 8);
  2426:             t = (int) (22118.4F * v + 40072.5333333333F * u + 3345.06666666667F * (v = (float) YM2151.opmBuffer[src + 83]) + 32768F) >> 16;
  2427:             sndByteBlock[dst + 122] = (byte) t;
  2428:             sndByteBlock[dst + 123] = (byte) (t >> 8);
  2429:             t = (int) (10160.8106666667F * u + 44190.3786666667F * v + 11184.8106666667F * (u = (float) YM2151.opmBuffer[src + 85]) + 32768F) >> 16;
  2430:             sndByteBlock[dst + 126] = (byte) t;
  2431:             sndByteBlock[dst + 127] = (byte) (t >> 8);
  2432:             t = (int) (2796.20266666667F * v + 39122.2613333333F * u + 23617.536F * (v = (float) YM2151.opmBuffer[src + 87]) + 32768F) >> 16;
  2433:             sndByteBlock[dst + 130] = (byte) t;
  2434:             sndByteBlock[dst + 131] = (byte) (t >> 8);
  2435:             t = (int) (24.576F * u + 26714.112F * v + 36951.3813333333F * (u = (float) YM2151.opmBuffer[src + 89]) + 1845.93066666667F * (v = (float) YM2151.opmBuffer[src + 91]) + 32768F) >> 16;
  2436:             sndByteBlock[dst + 134] = (byte) t;
  2437:             sndByteBlock[dst + 135] = (byte) (t >> 8);
  2438:             t = (int) (13380.2666666667F * u + 43895.4666666667F * v + 8260.26666666667F * (u = (float) YM2151.opmBuffer[src + 93]) + 32768F) >> 16;
  2439:             sndByteBlock[dst + 138] = (byte) t;
  2440:             sndByteBlock[dst + 139] = (byte) (t >> 8);
  2441:             t = (int) (4590.25066666667F * v + 41678.1653333333F * u + 19267.584F * (v = (float) YM2151.opmBuffer[src + 95]) + 32768F) >> 16;
  2442:             sndByteBlock[dst + 142] = (byte) t;
  2443:             sndByteBlock[dst + 143] = (byte) (t >> 8);
  2444:             t = (int) (393.216F * u + 31064.064F * v + 33289.5573333333F * (u = (float) YM2151.opmBuffer[src + 97]) + 789.162666666667F * (v = (float) YM2151.opmBuffer[src + 99]) + 32768F) >> 16;
  2445:             sndByteBlock[dst + 146] = (byte) t;
  2446:             sndByteBlock[dst + 147] = (byte) (t >> 8);
  2447:             t = (int) (17042.0906666667F * u + 42715.8186666667F * v + 5778.09066666667F * (u = (float) YM2151.opmBuffer[src + 101]) + 32768F) >> 16;
  2448:             sndByteBlock[dst + 150] = (byte) t;
  2449:             sndByteBlock[dst + 151] = (byte) (t >> 8);
  2450:             t = (int) (6826.66666666667F * v + 43349.3333333333F * u + 15360F * (v = (float) YM2151.opmBuffer[src + 103]) + 32768F) >> 16;
  2451:             sndByteBlock[dst + 154] = (byte) t;
  2452:             sndByteBlock[dst + 155] = (byte) (t >> 8);
  2453:             t = (int) (1204.224F * u + 34971.648F * v + 29185.3653333333F * (u = (float) YM2151.opmBuffer[src + 105]) + 174.762666666667F * (v = (float) YM2151.opmBuffer[src + 107]) + 32768F) >> 16;
  2454:             sndByteBlock[dst + 158] = (byte) t;
  2455:             sndByteBlock[dst + 159] = (byte) (t >> 8);
  2456:             t = (int) (21146.2826666667F * u + 40651.4346666667F * v + 3738.28266666667F * (u = (float) YM2151.opmBuffer[src + 109]) + 32768F) >> 16;
  2457:             sndByteBlock[dst + 162] = (byte) t;
  2458:             sndByteBlock[dst + 163] = (byte) (t >> 8);
  2459:             t = (int) (9505.45066666667F * v + 44135.7653333333F * u + 11894.784F * (v = (float) YM2151.opmBuffer[src + 111]) + 32768F) >> 16;
  2460:             sndByteBlock[dst + 166] = (byte) t;
  2461:             sndByteBlock[dst + 167] = (byte) (t >> 8);
  2462:             t = (int) (2457.6F * u + 38434.1333333333F * v + 24644.2666666667F * (u = (float) YM2151.opmBuffer[src + 113]) + 32768F) >> 16;
  2463:             sndByteBlock[dst + 170] = (byte) t;
  2464:             sndByteBlock[dst + 171] = (byte) (t >> 8);
  2465:             t = (int) (2.73066666666667F * v + 25687.3813333333F * u + 37705.0453333333F * (v = (float) YM2151.opmBuffer[src + 115]) + 2140.84266666667F * (u = (float) YM2151.opmBuffer[src + 117]) + 32768F) >> 16;
  2466:             sndByteBlock[dst + 174] = (byte) t;
  2467:             sndByteBlock[dst + 175] = (byte) (t >> 8);
  2468:             t = (int) (12626.6026666667F * v + 44037.4613333333F * u + 8871.936F * (v = (float) YM2151.opmBuffer[src + 119]) + 32768F) >> 16;
  2469:             sndByteBlock[dst + 178] = (byte) t;
  2470:             sndByteBlock[dst + 179] = (byte) (t >> 8);
  2471:             t = (int) (4153.344F * u + 41186.6453333333F * v + 20196.0106666667F * (u = (float) YM2151.opmBuffer[src + 121]) + 32768F) >> 16;
  2472:             sndByteBlock[dst + 182] = (byte) t;
  2473:             sndByteBlock[dst + 183] = (byte) (t >> 8);
  2474:             t = (int) (273.066666666667F * v + 30135.6373333333F * u + 34141.5253333333F * (v = (float) YM2151.opmBuffer[src + 123]) + 985.770666666667F * (u = (float) YM2151.opmBuffer[src + 125]) + 32768F) >> 16;
  2475:             sndByteBlock[dst + 186] = (byte) t;
  2476:             sndByteBlock[dst + 187] = (byte) (t >> 8);
  2477:             t = (int) (16190.1226666667F * v + 43054.4213333333F * u + 6291.456F * (v = (float) YM2151.opmBuffer[src + 127]) + 32768F) >> 16;
  2478:             sndByteBlock[dst + 190] = (byte) t;
  2479:             sndByteBlock[dst + 191] = (byte) (t >> 8);
  2480:             t = (int) (6291.456F * u + 43054.4213333333F * v + 16190.1226666667F * (u = (float) YM2151.opmBuffer[src + 129]) + 32768F) >> 16;
  2481:             sndByteBlock[dst + 194] = (byte) t;
  2482:             sndByteBlock[dst + 195] = (byte) (t >> 8);
  2483:             t = (int) (985.770666666667F * v + 34141.5253333333F * u + 30135.6373333333F * (v = (float) YM2151.opmBuffer[src + 131]) + 273.066666666667F * (u = (float) YM2151.opmBuffer[src + 133]) + 32768F) >> 16;
  2484:             sndByteBlock[dst + 198] = (byte) t;
  2485:             sndByteBlock[dst + 199] = (byte) (t >> 8);
  2486:             t = (int) (20196.0106666667F * v + 41186.6453333333F * u + 4153.344F * (v = (float) YM2151.opmBuffer[src + 135]) + 32768F) >> 16;
  2487:             sndByteBlock[dst + 202] = (byte) t;
  2488:             sndByteBlock[dst + 203] = (byte) (t >> 8);
  2489:             t = (int) (8871.936F * u + 44037.4613333333F * v + 12626.6026666667F * (u = (float) YM2151.opmBuffer[src + 137]) + 32768F) >> 16;
  2490:             sndByteBlock[dst + 206] = (byte) t;
  2491:             sndByteBlock[dst + 207] = (byte) (t >> 8);
  2492:             t = (int) (2140.84266666667F * v + 37705.0453333333F * u + 25687.3813333333F * (v = (float) YM2151.opmBuffer[src + 139]) + 2.73066666666667F * (u = (float) YM2151.opmBuffer[src + 141]) + 32768F) >> 16;
  2493:             sndByteBlock[dst + 210] = (byte) t;
  2494:             sndByteBlock[dst + 211] = (byte) (t >> 8);
  2495:             t = (int) (24644.2666666667F * v + 38434.1333333333F * u + 2457.6F * (v = (float) YM2151.opmBuffer[src + 143]) + 32768F) >> 16;
  2496:             sndByteBlock[dst + 214] = (byte) t;
  2497:             sndByteBlock[dst + 215] = (byte) (t >> 8);
  2498:             t = (int) (11894.784F * u + 44135.7653333333F * v + 9505.45066666667F * (u = (float) YM2151.opmBuffer[src + 145]) + 32768F) >> 16;
  2499:             sndByteBlock[dst + 218] = (byte) t;
  2500:             sndByteBlock[dst + 219] = (byte) (t >> 8);
  2501:             t = (int) (3738.28266666667F * v + 40651.4346666667F * u + 21146.2826666667F * (v = (float) YM2151.opmBuffer[src + 147]) + 32768F) >> 16;
  2502:             sndByteBlock[dst + 222] = (byte) t;
  2503:             sndByteBlock[dst + 223] = (byte) (t >> 8);
  2504:             t = (int) (174.762666666667F * u + 29185.3653333333F * v + 34971.648F * (u = (float) YM2151.opmBuffer[src + 149]) + 1204.224F * (v = (float) YM2151.opmBuffer[src + 151]) + 32768F) >> 16;
  2505:             sndByteBlock[dst + 226] = (byte) t;
  2506:             sndByteBlock[dst + 227] = (byte) (t >> 8);
  2507:             t = (int) (15360F * u + 43349.3333333333F * v + 6826.66666666667F * (u = (float) YM2151.opmBuffer[src + 153]) + 32768F) >> 16;
  2508:             sndByteBlock[dst + 230] = (byte) t;
  2509:             sndByteBlock[dst + 231] = (byte) (t >> 8);
  2510:             t = (int) (5778.09066666667F * v + 42715.8186666667F * u + 17042.0906666667F * (v = (float) YM2151.opmBuffer[src + 155]) + 32768F) >> 16;
  2511:             sndByteBlock[dst + 234] = (byte) t;
  2512:             sndByteBlock[dst + 235] = (byte) (t >> 8);
  2513:             t = (int) (789.162666666667F * u + 33289.5573333333F * v + 31064.064F * (u = (float) YM2151.opmBuffer[src + 157]) + 393.216F * (v = (float) YM2151.opmBuffer[src + 159]) + 32768F) >> 16;
  2514:             sndByteBlock[dst + 238] = (byte) t;
  2515:             sndByteBlock[dst + 239] = (byte) (t >> 8);
  2516:             t = (int) (19267.584F * u + 41678.1653333333F * v + 4590.25066666667F * (u = (float) YM2151.opmBuffer[src + 161]) + 32768F) >> 16;
  2517:             sndByteBlock[dst + 242] = (byte) t;
  2518:             sndByteBlock[dst + 243] = (byte) (t >> 8);
  2519:             t = (int) (8260.26666666667F * v + 43895.4666666667F * u + 13380.2666666667F * (v = (float) YM2151.opmBuffer[src + 163]) + 32768F) >> 16;
  2520:             sndByteBlock[dst + 246] = (byte) t;
  2521:             sndByteBlock[dst + 247] = (byte) (t >> 8);
  2522:             t = (int) (1845.93066666667F * u + 36951.3813333333F * v + 26714.112F * (u = (float) YM2151.opmBuffer[src + 165]) + 24.576F * (v = (float) YM2151.opmBuffer[src + 167]) + 32768F) >> 16;
  2523:             sndByteBlock[dst + 250] = (byte) t;
  2524:             sndByteBlock[dst + 251] = (byte) (t >> 8);
  2525:             t = (int) (23617.536F * u + 39122.2613333333F * v + 2796.20266666667F * (u = (float) YM2151.opmBuffer[src + 169]) + 32768F) >> 16;
  2526:             sndByteBlock[dst + 254] = (byte) t;
  2527:             sndByteBlock[dst + 255] = (byte) (t >> 8);
  2528:             t = (int) (11184.8106666667F * v + 44190.3786666667F * u + 10160.8106666667F * (v = (float) YM2151.opmBuffer[src + 171]) + 32768F) >> 16;
  2529:             sndByteBlock[dst + 258] = (byte) t;
  2530:             sndByteBlock[dst + 259] = (byte) (t >> 8);
  2531:             t = (int) (3345.06666666667F * u + 40072.5333333333F * v + 22118.4F * (u = (float) YM2151.opmBuffer[src + 173]) + 32768F) >> 16;
  2532:             sndByteBlock[dst + 262] = (byte) t;
  2533:             sndByteBlock[dst + 263] = (byte) (t >> 8);
  2534:             t = (int) (98.304F * v + 28213.248F * u + 35779.9253333333F * (v = (float) YM2151.opmBuffer[src + 175]) + 1444.52266666667F * (u = (float) YM2151.opmBuffer[src + 177]) + 32768F) >> 16;
  2535:             sndByteBlock[dst + 266] = (byte) t;
  2536:             sndByteBlock[dst + 267] = (byte) (t >> 8);
  2537:             t = (int) (14551.7226666667F * v + 43600.5546666667F * u + 7383.72266666667F * (v = (float) YM2151.opmBuffer[src + 179]) + 32768F) >> 16;
  2538:             sndByteBlock[dst + 270] = (byte) t;
  2539:             sndByteBlock[dst + 271] = (byte) (t >> 8);
  2540:             t = (int) (5286.57066666667F * u + 42333.5253333333F * v + 17915.904F * (u = (float) YM2151.opmBuffer[src + 181]) + 32768F) >> 16;
  2541:             sndByteBlock[dst + 274] = (byte) t;
  2542:             sndByteBlock[dst + 275] = (byte) (t >> 8);
  2543:             t = (int) (614.4F * v + 32415.744F * u + 31970.6453333333F * (v = (float) YM2151.opmBuffer[src + 183]) + 535.210666666667F * (u = (float) YM2151.opmBuffer[src + 185]) + 32768F) >> 16;
  2544:             sndByteBlock[dst + 278] = (byte) t;
  2545:             sndByteBlock[dst + 279] = (byte) (t >> 8);
  2546:             t = (int) (18361.0026666667F * v + 42125.9946666667F * u + 5049.00266666667F * (v = (float) YM2151.opmBuffer[src + 187]) + 32768F) >> 16;
  2547:             sndByteBlock[dst + 282] = (byte) t;
  2548:             sndByteBlock[dst + 283] = (byte) (t >> 8);
  2549:             t = (int) (7670.44266666667F * u + 43709.7813333333F * v + 14155.776F * (u = (float) YM2151.opmBuffer[src + 189]) + 32768F) >> 16;
  2550:             sndByteBlock[dst + 286] = (byte) t;
  2551:             sndByteBlock[dst + 287] = (byte) (t >> 8);
  2552:             t = (int) (1572.864F * v + 36175.872F * u + 27718.9973333333F * (v = (float) YM2151.opmBuffer[src + 191]) + 68.2666666666667F * (u = (float) YM2151.opmBuffer[src + 193]) + 32768F) >> 16;
  2553:             sndByteBlock[dst + 290] = (byte) t;
  2554:             sndByteBlock[dst + 291] = (byte) (t >> 8);
  2555:             t = (int) (22612.6506666667F * v + 39766.6986666667F * u + 3156.65066666667F * (v = (float) YM2151.opmBuffer[src + 195]) + 32768F) >> 16;
  2556:             sndByteBlock[dst + 294] = (byte) t;
  2557:             sndByteBlock[dst + 295] = (byte) (t >> 8);
  2558:             t = (int) (10496.6826666667F * u + 44201.3013333333F * v + 10838.016F * (u = (float) YM2151.opmBuffer[src + 197]) + 32768F) >> 16;
  2559:             sndByteBlock[dst + 298] = (byte) t;
  2560:             sndByteBlock[dst + 299] = (byte) (t >> 8);
  2561:             t = (int) (2973.696F * v + 39449.9413333333F * u + 23112.3626666667F * (v = (float) YM2151.opmBuffer[src + 199]) + 32768F) >> 16;
  2562:             sndByteBlock[dst + 302] = (byte) t;
  2563:             sndByteBlock[dst + 303] = (byte) (t >> 8);
  2564:             t = (int) (43.6906666666667F * u + 27219.2853333333F * v + 36566.3573333333F * (u = (float) YM2151.opmBuffer[src + 201]) + 1706.66666666667F * (v = (float) YM2151.opmBuffer[src + 203]) + 32768F) >> 16;
  2565:             sndByteBlock[dst + 306] = (byte) t;
  2566:             sndByteBlock[dst + 307] = (byte) (t >> 8);
  2567:             t = (int) (13765.2906666667F * u + 43808.0853333333F * v + 7962.624F * (u = (float) YM2151.opmBuffer[src + 205]) + 32768F) >> 16;
  2568:             sndByteBlock[dst + 310] = (byte) t;
  2569:             sndByteBlock[dst + 311] = (byte) (t >> 8);
  2570:             t = (int) (4816.896F * v + 41907.5413333333F * u + 18811.5626666667F * (v = (float) YM2151.opmBuffer[src + 207]) + 32768F) >> 16;
  2571:             sndByteBlock[dst + 314] = (byte) t;
  2572:             sndByteBlock[dst + 315] = (byte) (t >> 8);
  2573:             t = (int) (461.482666666667F * u + 31520.0853333333F * v + 32855.3813333333F * (u = (float) YM2151.opmBuffer[src + 209]) + 699.050666666667F * (v = (float) YM2151.opmBuffer[src + 211]) + 32768F) >> 16;
  2574:             sndByteBlock[dst + 318] = (byte) t;
  2575:             sndByteBlock[dst + 319] = (byte) (t >> 8);
  2576:             t = (int) (17476.2666666667F * u + 42530.1333333333F * v + 5529.6F * (u = (float) YM2151.opmBuffer[src + 213]) + 32768F) >> 16;
  2577:             sndByteBlock[dst + 322] = (byte) t;
  2578:             sndByteBlock[dst + 323] = (byte) (t >> 8);
  2579:             t = (int) (7102.464F * v + 43480.4053333333F * u + 14953.1306666667F * (v = (float) YM2151.opmBuffer[src + 215]) + 32768F) >> 16;
  2580:             sndByteBlock[dst + 326] = (byte) t;
  2581:             sndByteBlock[dst + 327] = (byte) (t >> 8);
  2582:             t = (int) (1321.64266666667F * u + 35378.5173333333F * v + 28702.0373333333F * (u = (float) YM2151.opmBuffer[src + 217]) + 133.802666666667F * (v = (float) YM2151.opmBuffer[src + 219]) + 32768F) >> 16;
  2583:             sndByteBlock[dst + 330] = (byte) t;
  2584:             sndByteBlock[dst + 331] = (byte) (t >> 8);
  2585:             t = (int) (21629.6106666667F * u + 40367.4453333333F * v + 3538.944F * (u = (float) YM2151.opmBuffer[src + 221]) + 32768F) >> 16;
  2586:             sndByteBlock[dst + 334] = (byte) t;
  2587:             sndByteBlock[dst + 335] = (byte) (t >> 8);
  2588:             t = (int) (9830.4F * v + 44168.5333333333F * u + 11537.0666666667F * (v = (float) YM2151.opmBuffer[src + 223]) + 32768F) >> 16;
  2589:             sndByteBlock[dst + 338] = (byte) t;
  2590:             sndByteBlock[dst + 339] = (byte) (t >> 8);
  2591:             t = (int) (2624.17066666667F * u + 38783.6586666667F * v + 24128.1706666667F * (u = (float) YM2151.opmBuffer[src + 225]) + 32768F) >> 16;
  2592:             sndByteBlock[dst + 342] = (byte) t;
  2593:             sndByteBlock[dst + 343] = (byte) (t >> 8);
  2594:             t = (int) (10.9226666666667F * v + 26203.4773333333F * u + 37330.944F * (v = (float) YM2151.opmBuffer[src + 227]) + 1990.656F * (u = (float) YM2151.opmBuffer[src + 229]) + 32768F) >> 16;
  2595:             sndByteBlock[dst + 346] = (byte) t;
  2596:             sndByteBlock[dst + 347] = (byte) (t >> 8);
  2597:             t = (int) (13000.704F * v + 43971.9253333333F * u + 8563.37066666667F * (v = (float) YM2151.opmBuffer[src + 231]) + 32768F) >> 16;
  2598:             sndByteBlock[dst + 350] = (byte) t;
  2599:             sndByteBlock[dst + 351] = (byte) (t >> 8);
  2600:             t = (int) (4369.06666666667F * u + 41437.8666666667F * v + 19729.0666666667F * (u = (float) YM2151.opmBuffer[src + 233]) + 32768F) >> 16;
  2601:             sndByteBlock[dst + 354] = (byte) t;
  2602:             sndByteBlock[dst + 355] = (byte) (t >> 8);
  2603:             t = (int) (330.410666666667F * v + 30602.5813333333F * u + 33718.272F * (v = (float) YM2151.opmBuffer[src + 235]) + 884.736F * (u = (float) YM2151.opmBuffer[src + 237]) + 32768F) >> 16;
  2604:             sndByteBlock[dst + 358] = (byte) t;
  2605:             sndByteBlock[dst + 359] = (byte) (t >> 8);
  2606:             t = (int) (16613.376F * v + 42890.5813333333F * u + 6032.04266666667F * (v = (float) YM2151.opmBuffer[src + 239]) + 32768F) >> 16;
  2607:             sndByteBlock[dst + 362] = (byte) t;
  2608:             sndByteBlock[dst + 363] = (byte) (t >> 8);
  2609:             t = (int) (6556.33066666667F * u + 43207.3386666667F * v + 15772.3306666667F * (u = (float) YM2151.opmBuffer[src + 241]) + 32768F) >> 16;
  2610:             sndByteBlock[dst + 366] = (byte) t;
  2611:             sndByteBlock[dst + 367] = (byte) (t >> 8);
  2612:             t = (int) (1092.26666666667F * v + 34559.3173333333F * u + 29663.232F * (v = (float) YM2151.opmBuffer[src + 243]) + 221.184F * (u = (float) YM2151.opmBuffer[src + 245]) + 32768F) >> 16;
  2613:             sndByteBlock[dst + 370] = (byte) t;
  2614:             sndByteBlock[dst + 371] = (byte) (t >> 8);
  2615:             t = (int) (20668.416F * v + 40924.5013333333F * u + 3943.08266666667F * (v = (float) YM2151.opmBuffer[src + 247]) + 32768F) >> 16;
  2616:             sndByteBlock[dst + 374] = (byte) t;
  2617:             sndByteBlock[dst + 375] = (byte) (t >> 8);
  2618:             t = (int) (9185.96266666667F * u + 44092.0746666667F * v + 12257.9626666667F * (u = (float) YM2151.opmBuffer[src + 249]) + 32768F) >> 16;
  2619:             sndByteBlock[dst + 378] = (byte) t;
  2620:             sndByteBlock[dst + 379] = (byte) (t >> 8);
  2621:             t = (int) (2296.49066666667F * v + 38073.6853333333F * u + 25165.824F * (float) YM2151.opmBuffer[src + 251] + 32768F) >> 16;
  2622:             sndByteBlock[dst + 382] = (byte) t;
  2623:             sndByteBlock[dst + 383] = (byte) (t >> 8);
  2624:           }  //for src,dst
  2625:         }  //if long/float
  2626:       }  //convert(int)
  2627:     };  //SNDRateConverter.LINEAR_AREA_STEREO_48000
  2628: 
  2629:     //rateConverter.initialize ()
  2630:     //  初めて選択されたときに配列の初期化などの必要な処理があれば行う
  2631:     public void initialize () {
  2632:     }
  2633: 
  2634:     //rateConverter.convert ()
  2635:     //  1ブロック分変換する。ADAPTIVE以外はoutputSamplesを使わない
  2636:     public abstract void convert (int outputSamples);
  2637: 
  2638:   }  //enum SNDRateConverter
  2639: 
  2640: 
  2641: 
  2642: }  //class SoundSource
  2643: 
  2644: 
  2645: