Tonejs / Tone.js

A Web Audio framework for making interactive music in the browser.
https://tonejs.github.io
MIT License
13.52k stars 983 forks source link

Add Pattern.index #1005

Closed yifanmai closed 2 years ago

yifanmai commented 2 years ago

Pattern.index returns the current index of the pattern. This method previously existed but was lost after the TypeScript conversion.

This changes PatternGenerator to return an index into the values array, rather than elements of the values array themselves. The index returned by PatternGenerator will be then returned by Pattern.index.

Fixes #934

codecov[bot] commented 2 years ago

Codecov Report

Merging #1005 (8949efc) into dev (aad2d8c) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #1005      +/-   ##
==========================================
+ Coverage   98.43%   98.43%   +0.01%     
==========================================
  Files         184      184              
  Lines        7691     7718      +27     
  Branches      665      673       +8     
==========================================
+ Hits         7570     7597      +27     
  Misses         36       36              
  Partials       85       85              
Impacted Files Coverage Δ
Tone/event/Pattern.ts 100.00% <100.00%> (ø)
Tone/event/PatternGenerator.ts 100.00% <100.00%> (ø)
Tone/core/clock/TickSource.ts 97.33% <0.00%> (+0.56%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update aad2d8c...8949efc. Read the comment docs.

tambien commented 2 years ago

Thanks for adding all those tests! looks great