3v324v23 commited on
Commit
84f213f
1 Parent(s): 9e57738
Files changed (1) hide show
  1. app.py +20 -17
app.py CHANGED
@@ -71,33 +71,36 @@ Colab version - https://colab.research.google.com/drive/1gEsZCCh2zMKqLmaGH5BPPLr
71
  ### Basic usage
72
  Upload your audio, enter the beat swapping pattern, change scale and shift if needed, and run it.
73
 
74
- #### pattern syntax
75
- patterns are sequences of **beats**, separated by commas or other separators. You can use spaces freely in patterns to make them look prettier.
76
- * `1, 3, 2, 4` - swap 2nd and 3rd beat every four beats. Repeats every four beats because `4` is the biggest number in it.
77
- * `1, 3, 4` - skip 2nd beat every four beats
78
- * `1, 2, 3, 4!` - skip 4th beat every four beats. `!` skips the beat.
79
 
80
- * `1>0.5` - plays first half of 1st beat
81
- * `1<0.5` - plays last half of 1st beat
82
- * `1 > 1/3, 2, 3, 4` - every four beats, plays first third of the first beat - you can use math expressions anywhere in your pattern.
83
- * also instead of slicing beats you can use a smaller `scale` parameter to make more precise beat edits
 
84
 
85
- * `1; 2, 3, 4` - every four beats, play 1st and 2nd beats at the same time.
 
86
 
87
- * `1, 2r` - 2nd beat will be reversed
88
- * `1, 2s0.5` - 2nd beat will be played at 0.5x speed
89
- * `1, 2d10` - 2nd beat will have 8-bit effect (downsampled)
 
90
 
91
  You can do much more with the syntax - shuffle/randomize beats, use samples, mix two songs, etc. Syntax is described in detail at https://huggingface.co/spaces/dpe1/BeatManipulator
92
- #### scale
93
  `scale = 0.5` will insert a new beat position between every existing beat position in the beatmap. That allows you to make patterns on smaller intervals.
94
 
95
  `scale = 2`, on the other hand, will merge every two beat positions in the beatmap. Useful, for example, when beat map detection puts sees BPM as two times faster than it actually is, and puts beats in between every actual beat.
96
- #### shift
97
  Shifts the beatmap, in beats. For example, if you want to remove 4th beat every four beats, you can do it by writing `1, 2, 3, 4!`. However sometimes it doesn't properly detect which beat is first, and for example remove 2nd beat every 4 beats instead. In that case, if you want 4th beat, use `shift = 2`. Also sometimes beats are detected right in between actual beats, so shift = 0.5 or -0.5 will fix it.
98
- #### creating images
99
  You can create cool images based on beat positions. Each song produces its own unique image. This gradio app creates a 2048x2048 image from each song.
100
- #### presets
101
  A bunch of example patterns: https://github.com/stunlocked1/beat_manipulator/blob/main/beat_manipulator/presets.yaml
102
 
103
  Those are supposed to be used on normalized beat maps, where kick + snare is two beats, so make sure to adjust beatmaps using `scale` and `shift`.
 
71
  ### Basic usage
72
  Upload your audio, enter the beat swapping pattern, change scale and shift if needed, and run it.
73
 
74
+ ### pattern syntax
75
+ patterns are sequences of **beats**, separated by **commas** or other separators. You can use spaces freely in patterns to make them look prettier.
76
+ - `1, 3, 2, 4` - swap 2nd and 3rd beat every four beats. Repeats every four beats because `4` is the biggest number in it.
77
+ - `1, 3, 4` - skip 2nd beat every four beats
78
+ - `1, 2, 3, 4!` - skip 4th beat every four beats. `!` skips the beat.
79
 
80
+ **slicing:**
81
+ - `1>0.5` - plays first half of 1st beat
82
+ - `1<0.5` - plays last half of 1st beat
83
+ - `1 > 1/3, 2, 3, 4` - every four beats, plays first third of the first beat - you can use math expressions anywhere in your pattern.
84
+ - also instead of slicing beats you can use a smaller `scale` parameter to make more precise beat edits
85
 
86
+ **merging beats:**
87
+ - `1; 2, 3, 4` - every four beats, play 1st and 2nd beats at the same time.
88
 
89
+ **effects:**
90
+ - `1, 2r` - 2nd beat will be reversed
91
+ - `1, 2s0.5` - 2nd beat will be played at 0.5x speed
92
+ - `1, 2d10` - 2nd beat will have 8-bit effect (downsampled)
93
 
94
  You can do much more with the syntax - shuffle/randomize beats, use samples, mix two songs, etc. Syntax is described in detail at https://huggingface.co/spaces/dpe1/BeatManipulator
95
+ ### scale
96
  `scale = 0.5` will insert a new beat position between every existing beat position in the beatmap. That allows you to make patterns on smaller intervals.
97
 
98
  `scale = 2`, on the other hand, will merge every two beat positions in the beatmap. Useful, for example, when beat map detection puts sees BPM as two times faster than it actually is, and puts beats in between every actual beat.
99
+ ### shift
100
  Shifts the beatmap, in beats. For example, if you want to remove 4th beat every four beats, you can do it by writing `1, 2, 3, 4!`. However sometimes it doesn't properly detect which beat is first, and for example remove 2nd beat every 4 beats instead. In that case, if you want 4th beat, use `shift = 2`. Also sometimes beats are detected right in between actual beats, so shift = 0.5 or -0.5 will fix it.
101
+ ### creating images
102
  You can create cool images based on beat positions. Each song produces its own unique image. This gradio app creates a 2048x2048 image from each song.
103
+ ### presets
104
  A bunch of example patterns: https://github.com/stunlocked1/beat_manipulator/blob/main/beat_manipulator/presets.yaml
105
 
106
  Those are supposed to be used on normalized beat maps, where kick + snare is two beats, so make sure to adjust beatmaps using `scale` and `shift`.