Skip to content

Commit

Permalink
Merge pull request #106 from ninjadev/prevent-browsing-to-the-before-…
Browse files Browse the repository at this point in the history
…time

Prevent browsing to the before time
  • Loading branch information
simonra authored Jul 15, 2023
2 parents 92128e4 + ae958e1 commit 3695fe2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,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)
Expand Down
5 changes: 4 additions & 1 deletion renin/src/renin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3695fe2

Please sign in to comment.