diff --git a/README.md b/README.md index 9d3235f..6d8e087 100644 --- a/README.md +++ b/README.md @@ -104,23 +104,46 @@ Rendering to video has not been implemented yet. | O | Enabled/disable thirds overlay | | Enter | Toggle fullscreen | | Space | Play/pause | -| V | Repeat current beat | -| B | Repeat current bar | -| N | Repeat current 4 bars | -| G | Set cue point for loop | +| V | Toggle repeat of current beat | +| B | Toggle repeat of current bar | +| N | Toggle repeat of current 4 bars | +| G | Set cue point for loop. The first time you press it, it sets the "go back here point". Second time sets "go back + once you reach this point". Third time removes the points. | | shift+J | Go back one frame | | shift+K | Go forward one frame | | shift+H | Go to start | -| L | Go forward one beat | +| L | Go forward 4 beats | | J | Go back one beat | | K | Go forward one beat | -| H | Go back one beat | +| H | Go back 4 beats | | 6 | Set playback rate to 0.25 | | 7 | Set playback rate to 0.5 | | 8 | Set playback rate to 2 | | 9 | Set playback rate to 4 | | 0 | Set playback rate to 1 | +# Debugging renin + +Typically, to debug renin, you need a demo using renin to mess around with. +Make sure that the demo referenes your local renin repo and files and not the published packages, or you will grow frustrated that none of you changes seem to take effect. +To use the repo, in your demos `package.json` file, in the `dependencises` section, make sure the `renin` entry refers to `file:./../renin/renin`. + +See this example : + +```json +{ + "...": "...", + "dependencies": { + "...": "...", + "@types/three": "*", + "renin": "file:./../renin/renin", + "seedrandom": "^3.0.5", + "three": "*", + "...": "...", + }, + "...": "...", +} +``` # Known renin demos - [Ninjadev - The Tale of the Bluebird & the Dragon](https://www.pouet.net/prod.php?which=91820) diff --git a/renin/src/renin.ts b/renin/src/renin.ts index ee3ec9a..fadf8ab 100644 --- a/renin/src/renin.ts +++ b/renin/src/renin.ts @@ -358,12 +358,15 @@ export class Renin { const quantizedStep = step - (step % this.sync.music.subdivision); if (this.cuePoints.length < 2) { this.cuePoints.push(this.sync.frameForStep(quantizedStep)); + this.cuePoints = this.cuePoints.sort(); } else { this.cuePoints = []; } } if (e.key === 'J') { - this.jumpToFrame(this.frame - 1); + if(this.frame > 0){ + this.jumpToFrame(this.frame - 1); + } } if (e.key === 'K') { this.jumpToFrame(this.frame + 1);