Download Jar. Uses 11913K of libraries. Click here for Pure Java version (14739L/106K).
!7 replace MarkedImage with BWImageAndRange. static L<MarkedImage> markedImages; p-exp { L<File> files = latestFilesFirst(audioRecordingsWithSingleClip()); pnl(files); markedImages = map_printProgress(f audioFileToBWImageAndRange, files); showOriginalClips(); findBestBand(); } srecord Band(IntRange r, float threshold) {} svoid findBestBand { final int h = first(markedImages).image.getHeight(); final new Best<Band> best; final new AIStrategy_RandomWithVariation<Band> strategy; strategy.random = func -> Band { Band(randomIntRange(1, 0, h), randomFloat()) }; strategy.vary = func(Band b) -> Band { Band(varyIntRange(b.r, 5, 1, 0, h), varyFloat(b.threshold)) }; strategy.submit = func(final Band b) -> double { new Scorer scorer; for (MarkedImage img : markedImages) audio_scoreExitPoints(scorer, img, audio_exitPointsUsingBand_v1(img.image, b.r, threshold := b.threshold)); if (best.put(b, scorer!)) { print(scorer + " / Band: " + b + " of " + h); quickShowZoomedImage(mergeBWImagesVertically(map(markedImages, func(MarkedImage img) -> BWImage { new Var<BWImage> processedImage; L<Int> exitPoints = audio_exitPointsUsingBand_v1(img.image, b.r, threshold := b.threshold, +processedImage, printStreaks := true); ret markIntRangesOnTopOfBWImage( squishBWImage(processedImage!, 20), ll(intRange(img.start, img.end)), intsToSize2Ranges(map(func(int x) -> int { max(0, x-2) }, exitPoints))); }))); } ret scorer!; }; thread { while licensed { strategy.go(); } } } svoid showOriginalClips { showImage(mergeBWImagesVertically(map renderBWImageAndRange(markedImages))); }
Began life as a copy of #1018800
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1018845 |
Snippet name: | Grow auto-clip algorithm for audio recordings v4 [find best band for exit points, dev.] |
Eternal ID of this version: | #1018845/10 |
Text MD5: | 61078dce056963d989fe87779768575e |
Transpilation MD5: | 45942c276316e38e985c9f8956846446 |
Author: | stefan |
Category: | javax / audio |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-10-14 13:28:41 |
Source code size: | 1763 bytes / 46 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 514 / 1217 |
Version history: | 9 change(s) |
Referenced in: | [show references] |