Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent browsing to the before time #106

Merged
merged 6 commits into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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