Skip to content

Commit 8e31603

Browse files
authored
feat: Select region on jump to song, fixes #1 (#2)
1 parent 7ce988e commit 8e31603

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
My musical band uses an IEM setup for rehearsals and live shows.
1010
This setup is based on a [USB audio interface](https://www.behringer.com/product.html?modelCode=P0B2J) and software mixing in [REAPER](https://www.reaper.fm/).
1111

12-
In REAPER we use named regions for songs, and simple sends from input channels to personal channels with a hardware output for each band member.
12+
In REAPER we use named regions for songs and simple sends from input channels to personal channels with a hardware output for each band member.
1313

1414
To simplify mixing we use a web control feature of REAPER and each band member does mixing of their output from a phone. Fortunately, REAPER already includes an interface that allows doing just that - `more_me.html`. Unfortunately, though, this interface doesn't allow switching tracks or starting or stopping playback.
1515

@@ -69,3 +69,8 @@ The example project has some more tracks so here is a brief explanation of their
6969
- The audio group is for tracks where you would put pre-recorded WAV files, like backtracks and vocal backtracks
7070
- The input group is for tracks having a physical input source, like a guitar or a microphone. If any additional processing is needed (compression, eq, reverb), it should be put on these tracks
7171
- The output group is for tracks with physical outputs. All of these tracks have plugins for basic hearing safety - a `-10 dB` gain and a brick-wall limiter at `0 dB`. These tracks have "Receives" from input group tracks and audio group tracks.
72+
73+
74+
## Notes
75+
76+
When a specific song (region) is selected from the UI, it selects the region and sets the cursor to the beginning of the region. Selecting the region allows stopping the playback automatically when the region ends. For REAPER to stop the playback automatically you need to check `Preferences` -> `Audio` -> `Playback` -> `[x] Stop playback at end of loop if repeat is disabled.` and disable repeat in your project.

src/Data/Actions.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface StopAction {
1111
interface MoveAction {
1212
type: "Move";
1313
pos: number;
14+
end: number;
1415
}
1516

1617
interface SetTrackVolumeAction {
@@ -107,7 +108,7 @@ export function actionsToCommands(actions: Action[]): string {
107108
case "Stop":
108109
return "40667;TRANSPORT";
109110
case "Move":
110-
return `SET/POS/${action.pos};TRANSPORT`;
111+
return `SET/POS/${action.end};40626;SET/POS/${action.pos};40625;TRANSPORT`;
111112
case "SetTrackVolume":
112113
return `SET/TRACK/${action.track}/VOL/${action.volume}`;
113114
case "SetSendVolume":

src/Data/Context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export function ReaperProvider(p: ReaperProps) {
112112
client.run({ type: "Stop" }, false);
113113
},
114114
moveToRegion(region) {
115-
client.run({ type: "Move", pos: region.startTime }, false);
115+
client.run({ type: "Move", pos: region.startTime, end: region.endTime }, false);
116116
},
117117
setOutputVolume(id, volume) {
118118
client.run({ type: "SetTrackVolume", track: id, volume }, true);

0 commit comments

Comments
 (0)