Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1018246 // audio_makeSampleFromSources

JavaX fragment (include)

svoid audio_makeSampleFromSources(L<VF1<double[]>> sources, double[] pair, double gain, VF1<VF1<double[]>> removeSource) {
  double l = 0, r = 0;
  int len = syncSize(sources);
  for (int i = 0; i < len; i++) { // synchro-safe, garbage-free iteration
    VF1<double[]> source = syncGet(sources, i);
    continue if source == null;
    callF(source, pair);
    if (isNaN(pair[0])) continue with callF(removeSource, source);
    l += pair[0];
    r += pair[1];
  }
  pair[0] = l*gain; pair[1] = r*gain;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1018246
Snippet name: audio_makeSampleFromSources
Eternal ID of this version: #1018246/6
Text MD5: 4912d2e890c02931982def26a34b4b09
Author: stefan
Category: javax / audio
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-12 16:20:11
Source code size: 514 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 341 / 387
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)