Spin Rhythm XD

Spin Rhythm XD

评价数不足
Trimming/Clipping songs for multi-diff customs
由 gav 制作
A simple way to manipulate the audio used for any given difficulty in your charts. Useful for shortening low-diff charts or trimming audio without sacrificing quality.
2
   
奖励
收藏
已收藏
取消收藏
(Optional) Set up Notepad++
While srtbs can be viewed in any text editor, Notepad++ has a handy utility that automatically organizes the file as a json. Don't know what a json is? That's fine. Just compare these two images:


Even though it isn't perfect, it sure helps.

1. Get Notepad++ from https://notepad-plus-plus.org/downloads/
2. Install "JSON Viewer" from Plugins>Plugins Admin
3. With any srtb file open, push ctrl-alt-shift-m
In-game Preparations
A lot of the process is much easier if we make a few changes to the custom file in-game first.

Before attempting to mess with clipping, make sure the entire song is properly tempomapped and cuepointed, and enable every difficulty you wish to modify.

I also highly recommend arranging your first time signature to be before the start of the audio file and at least 8 beats before the first note.

Examples of good tempo and time signature marker placements:
An example of bad placement:
l











When trimming or splicing, all notes will remain at the exact same time placements as before, even if the audio for that section is different or gone. I highly recommend trimming/splicing before you start placing notes.
Locating the clipData
This whole process takes place outside of the game. You will need to find your customs files in your operating system's file explorer. The easiest way is to click "Show Files" in the customs' side menu, in the track select screen. Find your file, and open it in a text editor.

Whether you use Notepad++ or not, you should be able to use ctrl-f or something similar to search for text within your file. The specific string we want is "clipData", but bear in mind that there are up to 5 of these in any srtb file.

Once you've found your desired clipData, you should see a bunch of text inside a pair of [square brackets] representing every clip in the song. Even with the extra formatting provided by Notepad++, this section is a little hard to navigate, so be very careful when changing anything that you don't mess up the format, forget a comma, etc..

Here is an example of what one clipData might look like:
\"clipData\":[{\"clipIndex\":0,\"startBar\":0,\"endBar\":158,\"transitionIn\":0,\"transitionInValue\":0.0,\"transitionInOffset\":0.0,\"transitionOut\":0,\"transitionOutValue\":0.0,\"transitionOutOffset\":0.0}]
Modifying the clipData
This is where things get potentially dangerous. I highly recommend making a backup before commencing with any actual changes. One mistake, and your chart will fail to play.

There are many fields in each object inside clipData. I'll list and briefly explain them here:
Field Name
Default
Value
Notes
clipIndex
0
Which audio to use. All charts have 1 clipInfo unless you really get into clip sorcery. Keep this at default
startBar
varies
The measure that this clip starts on. Initial value depends on the tempomap
endBar
varies
The measure that this clip ends on. Initial value depends on the tempomap
transitionIn
0
0 for hard start
1 to fade out of the bounds of this clip (ie. fade before the clip begins)
2 to fade within the bounds of this clip
transitionInValue
0.0
length of the fade effect in seconds
transitionInOffset
0.0
offset of the start of the clip in seconds

if positive, the start of this clip will be silenced, possibly shortening the chart
if negative, this clip will start early, possibly extending the chart or overlapping the previous clip
transitionOut
0
0 for hard end
1 to fade out of the bounds of this clip (ie. fade after the clip ends)
2 to fade within the bounds of this clip
transitionOutValue
0.0
length of the fade effect in seconds
transitionOutOffset
0.0
offset of the end of the clip in seconds

if positive, this clip will end later, possibly extending the chart or overlapping the next clip
if negative, the end of this clip will be silenced, possibly shortening the chart

Fades and offsets will misbehave if you attempt to access audio that doesn't exist (eg. before or after the song)

The game will delete notes during any audio that was grabbed by fade outs.
Basic Tutorial: Trimming your song
As an example, let's trim the last 8 measures off the end of a song. It's complete silence, nobody wants to sit through it while grinding for score, so let's get rid of it.

First, I'll use ctrl-f to find clipData:

There are 5 results (5 difficulties), but some of them are empty.
for now, I'm only modifying XD, so the 5th and final one.

Now we just change the 120 to 112, right?
Unfortunately, if there's only 1 object in clipData, spythm will completely reset it the moment you try to load your chart.
(I guess it assumes something is wrong, and tries to fix it by resetting to the audio length?)

We can get around this by making a dummy clip that starts and ends on bar 0 (or whatever your initial startBar is), then putting the real clip after that. Something like
{\"clipIndex\":0,\"startBar\":0,\"endBar\":0,\"transitionIn\":0,\"transitionInValue\":0.0,\"transitionInOffset\":0.0,\"transitionOut\":0,\"transitionOutValue\":0.0,\"transitionOutOffset\":0.0}

We then follow it up with a comma, then our actual clip,
{\"clipIndex\":0,\"startBar\":0,\"endBar\":112,\"transitionIn\":0,\"transitionInValue\":0.0,\"transitionInOffset\":0.0,\"transitionOut\":0,\"transitionOutValue\":0.0,\"transitionOutOffset\":0.0}

Leaving us with the final clipData:
\"clipData\":[{\"clipIndex\":0,\"startBar\":0,\"endBar\":0,\"transitionIn\":0,\"transitionInValue\":0.0,\"transitionInOffset\":0.0,\"transitionOut\":0,\"transitionOutValue\":0.0,\"transitionOutOffset\":0.0},{\"clipIndex\":0,\"startBar\":0,\"endBar\":112,\"transitionIn\":0,\"transitionInValue\":0.0,\"transitionInOffset\":0.0,\"transitionOut\":0,\"transitionOutValue\":0.0,\"transitionOutOffset\":0.0}]

Assuming nothing went wrong, the chart should now end 8 measures earlier than it used to.
Basic Tutorial: Fades
Maybe your song doesn't have 8 measure of silence. Maybe it has 8 measures of trailing noise, and you can't chart it, but it sounds weird if it suddenly stops. We can make it slowly fade out instead!

There are two ways to approach this. We can go 8 measures back and use an out-bound fade, or we can go somewhere between 0 and 8 measures back and use an in-bound.
The first method allows us to start fading out exactly when we want.
The second method allows us to finish fading out exactly when we want.

It's easiest to use the first method (this is what the in-game clipping tool does!)
but, if you find that the notes near the end of your chart are getting deleted, you should switch to the second.

First Method - Out-bound fade
Let's start by copying every step from the previous tutorial. Once we've done that, we're actually pretty close to done. All that's left is to change transitionOut to 1, and transitionOutValue to the length of the fade.
Regarding the length of the fade, it's best to experiment and see what sounds best. For the sake of this guide, I'll just say 4 seconds.

As with Basic Tutorial: Trimming your song, you'll have to make sure you use at least 2 clips, otherwise Spin will overwrite your clipData with the default.

Here's the end result:
\"clipData\":[{\"clipIndex\":0,\"startBar\":0,\"endBar\":0,\"transitionIn\":0,\"transitionInValue\":0.0,\"transitionInOffset\":0.0,\"transitionOut\":0,\"transitionOutValue\":0.0,\"transitionOutOffset\":0.0},{\"clipIndex\":0,\"startBar\":0,\"endBar\":112,\"transitionIn\":0,\"transitionInValue\":0.0,\"transitionInOffset\":0.0,\"transitionOut\":1,\"transitionOutValue\":4.0,\"transitionOutOffset\":0.0}]

Second Method - In-bounds fade
Similarly to the first method, we'll want to follow the previous tutorial, except we want to "end" the song a little later. (eg. I'll use measure 114 instead)
Next, change transitionOut to 2 and transitionOutValue to the length of the fade (again, 4 seconds).
Here's what this fade might look like:
\"clipData\":[{\"clipIndex\":0,\"startBar\":0,\"endBar\":0,\"transitionIn\":0,\"transitionInValue\":0.0,\"transitionInOffset\":0.0,\"transitionOut\":0,\"transitionOutValue\":0.0,\"transitionOutOffset\":0.0},{\"clipIndex\":0,\"startBar\":0,\"endBar\":114,\"transitionIn\":0,\"transitionInValue\":0.0,\"transitionInOffset\":0.0,\"transitionOut\":2,\"transitionOutValue\":4.0,\"transitionOutOffset\":0.0}]
Basic Tutorial: Splicing clips together
I want to chart Easy and Normal, but my song is too long and repetitive. Let's cut it up and stitch it back together so that the first buildup goes straight into the second drop.

First, find the clipData. Let's just modify the Easy one. We can paste it over Normal later.


I use the in-game editor to find the right place to initiate the splice. In this song, it's measure 18.


So, our 1st clip needs to go from 0 to 18.

Now to find when the 2nd drop starts. In this case, measure 42.


So our 2nd clip needs to go from 42 to the end (53)
(me oh my what a short song)

One last thing: hard cut splices tend to have their sounds overlap even though they shouldn't. The best way I've found to fix this is to introduce a small fade-in to the 2nd clip.
So in this example, I will also set the 2nd clip's transitionIn to 1, and transitionInValue to 0.001.

Here's the result:
{\"clipIndex\":0,\"startBar\":0,\"endBar\":18,\"transitionIn\":0,\"transitionInValue\":0.0,\"transitionInOffset\":0.0,\"transitionOut\":0,\"transitionOutValue\":0.0,\"transitionOutOffset\":0.0},{\"clipIndex\":0,\"startBar\":42,\"endBar\":53,\"transitionIn\":1,\"transitionInValue\":0.001,\"transitionInOffset\":0.0,\"transitionOut\":0,\"transitionOutValue\":0.0,\"transitionOutOffset\":0.0}

Assuming we did everything right (don't forget to separate the clips with a comma!), the song should now jump from 18 to 42, but only on Easy.
However, when the audio jumps, it sounds unnatural and doesn't mesh well. We might need to introduce some crossfading...
Visualizing Fade and Offset
Visualizing transition types with waveforms:
These pictures come from Audacity. I'm just using them as examples to explain things, because the Spythm editor can make it hard to see the details of these concepts.

Jump cut:
(transitionIn and transitionOut are 0)
It's basic, but it works for most use cases on its own

Out-bounds fade:
(transitionIn and transitionOut are 1)
(i previously called this "crossfade", which was silly and caused confusion)

In-bounds fade:
(transitionIn and transitionOut are 2)

Usually when fading between two clips, it's easiest to have one fade in-bounds while the other fades out-bounds. Otherwise, there will be silence or overlap issues during the transition

Visualizing offset:

No Offset:
By default, one clip will run directly into the next. Visually, it might look something like this:

Inward Offset:
(transitionInOffset is positive, transitionOutOffset is negative)
Inward Offset will remove some audio, with a resultant silence where the audio used to be

Outward Offset:
(transitionInOffset is negative, transitionOutOffset is positive)
Outward Offset will add some audio, causing the audio clips to overlap.

Offset can't cause clips to "move" in time. Attempting to move a clip using offset will just create empty space or clip overlap to compensate
Offset can, however, move the chart's beginning or ending

Combining Fade and Offset
When moving the endpoint of the audio for a given clip using offset, you also move the fade effect by that same amount. No matter what offset is set to, a fade will always last the full length it's set to

Whether transitionInOffset is 0.5 or -0.5, the fade always lasts 1 second.
Advanced Tutorial: Complex transitions
If you find yourself in a spot where a hard cut won't do it for you, you're welcome to try something a bit more complicated. Fair warning, there will likely be a lot of trial and error, as well as audio oddities where your clips overlap.

As an example, I'm going to use the real chart of Lost memory. There are many splices across all difficulties, but I'm mainly going to focus on two in particular: 69 - 77 and 120 - 128.

Because it's simpler, I'll start with
Crossfade, measures 120 - 128.

The entire purpose of this splice is to force the backing synth in this section to fade twice as fast. The splice appears in every difficulty except XD, and the two relevant clips look something like this:

{\"clipIndex\":0,\"startBar\":0,\"endBar\":120,\"transitionIn\":0,\"transitionInValue\":0.0,\"transitionInOffset\":0,\"transitionOut\":2,\"transitionOutValue\":8.0,\"transitionOutOffset\":0.0},{\"clipIndex\":0,\"startBar\":128,\"endBar\":135,\"transitionIn\":1,\"transitionInValue\":4.0,\"transitionInOffset\":-4.0,\"transitionOut\":0,\"transitionOutValue\":0.0,\"transitionOutOffset\":0.0}

Anyways, to sum up what's happening in a more understandable format, I'll use audacity again.
The first clip fades in-bounds for 8 seconds, while the 2nd clip fades out-bounds for 4, starting 4 seconds early.


This does result in a slight bulge during the overlap, which could be problematic. However, I get away with it in this song because this section peaks at -1.5 dB. To lessen the impact of the overlap, though, I could have it spend more time fading in so it takes longer to reach full volume.
(ie. instead of -4 offset and 4 fade-in, -2 offset and 6 fade-in)


The only reason the crossfade works and sounds decent is because both the first and second clips sound very similar, the only difference being how loud the backing synth is.


Crossfade, measures 69 - 77
This one also occurs on all but XD, and the clips look something like this:
{\"clipIndex\":0,\"startBar\":0,\"endBar\":69,\"transitionIn\":0,\"transitionInValue\":0.0,\"transitionInOffset\":0.0,\"transitionOut\":2,\"transitionOutValue\":1.5,\"transitionOutOffset\":0.0},{\"clipIndex\":0,\"startBar\":77,\"endBar\":141,\"transitionIn\":2,\"transitionInValue\":8.5,\"transitionInOffset\":-3.5,\"transitionOut\":0,\"transitionOutValue\":0.0,\"transitionOutOffset\":0.0}

In English, the first clip fades in-bounds for 1.5 seconds, and the 2nd clip fades in-bounds for 8.5 seconds, starting 3.5 seconds early (two in-bound fades?!). Overall, this results in a transition much quieter than either part was originally, but it meshes well with the music.


This transition in particular was very prone to weird issues. Both clips' audios had the same notes at the same pitches, but they would overlap in such a way that they partially cancelled one another. It took a lot of trial and error to fine tune it to make this effect unnoticeable.


The first step in setting up a crossfade transition is to seriously consider if you should be using one at all. A well-made jump cut is often better and easier, especially with the kind of music that is typically charted.
If you're dead-set on a crossfade, finding the right place to put it is key. Repeating audio or breaks in the music tend to work best, while lyric or percussion-heavy sections tend to sound the worst.
Try to make the crossfade as short as possible.
Troubleshooting
I can't play my chart anymore!
Try restarting your game. If it still won't work, you probably messed up the formatting somewhere.
You can try double checking everything, but honestly, starting over might be easier. :/

My difficulties are acting strange!
Multiple hard buttons?
More than 5 difficulties?
You probably forgot a comma or messed up formatting somewhere.

I did all the right things, but my changes aren't applying!
When you modify something outside of Spin Rhythm, the chart won't update immediately in game. Your options are to either restart the game or move the chart out of your customs folder, then back in.
(If you're confident, you can also delete the chart in game, then save in your notepad editor, which should recreate the file and refresh in game)

Barring that, make sure that you have at least 2 clips, or else Spythm will reset your clips back to default. (for details, read the section called Basic Tutorial: Trimming your song)

For some reason, two of my clips overlap and it sounds terrible!
Yeah I don't know why Spin does this. The best solution I found was to have the second clip out-bounds fade in for a very short duration (eg. 0.001 seconds). If that doesn't work, you might have to go for a full crossfade

My notes keep getting deleted!
Spin Rhythm will delete notes that it thinks are out of bounds. Unfortunately, this includes notes that technically occur after the last clip has ended, which happens if the chart ends on an out-bounds fade out. You can fix this by moving the ending later or switching to an in-bounds fade.
Examples
A few people stumbled across the variables necessary to make clipping work, but the first actual use case was by Haxton, on his chart of Out There[spinsha.re].
https://www.youtube.com/watch?v=xOt5H4dJlB8
notice how the song fades out at the end of the video

For more in-depth examples, the full-diff charts from "A city that rejoices in love" by Chroma feature extensive clipping.
Lost memory[spinsha.re]
Phantom train journey[spinsha.re]
Observer's story[spinsha.re]
Snowmelt[spinsha.re]
2 条留言
smb 2023 年 2 月 3 日 上午 12:41 
There's some incredible work being done here. Great stuff
Daverwob  [开发者] 2023 年 1 月 24 日 下午 8:30 
This is awesome. As you can tell there's a bunch of awful and annoying things to do when changing clip lengths. We currently do it all in Unity and it's quite messy (I need a DAW open at the same time where I actually do the cuts). We want to make this standard, but there's a ton of UI things to add in the clip info editor to make it possible. We may just settle for fade in / out, not actually allowing cutting of the middle, as that would probably make 95% of charters happy, but yeah, this is still something we want to do. Well done.