Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
danceformer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
grzonkow
danceformer
Commits
9c2549c3
Commit
9c2549c3
authored
1 year ago
by
Cassandra Grzonkowski
Browse files
Options
Downloads
Patches
Plain Diff
preliminary_exp_main instead of main
parent
362dced5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
preliminary_exp_main.py
+91
-0
91 additions, 0 deletions
preliminary_exp_main.py
with
91 additions
and
0 deletions
preliminary_exp_main.py
0 → 100644
+
91
−
0
View file @
9c2549c3
from
preliminary_experiment
import
*
from
torchaudio.utils
import
download_asset
if
__name__
==
'
__main__
'
:
#path = "../../7guys1pack/28 Grams/28 Grams.ogg"
#path_ex = "../../7guys1pack/Pretty Please/Pretty Please.ogg"
#read_file_meta_data(path="../../7guys1pack/Banger Machine/Banger Machine.sm")
#path_pack = "../../7guys1pack/"
#path_pack = "../../DDR/"
path_pack
=
"
../../FF-DD/
"
songs
=
[]
filtered_songs
=
[]
distances
=
[]
#print(os.listdir(path_pack))
iter
=
0
# make a list of songs of file type sm
for
folder
in
os
.
listdir
(
path_pack
):
if
iter
<=
80
:
path_folder
=
os
.
path
.
join
(
path_pack
,
folder
)
if
os
.
path
.
isdir
(
path_folder
):
for
file
in
os
.
listdir
(
path_folder
):
if
file
.
endswith
(
"
.sm
"
):
songs
.
append
(
os
.
path
.
join
(
path_folder
,
file
))
else
:
break
iter
+=
1
print
(
songs
)
# filter for songs with only one bpm:
for
song
in
songs
:
opened_file
=
simfile
.
open
(
song
)
with
open
(
song
,
'
r
'
,
encoding
=
"
utf8
"
)
as
infile
:
print
(
song
)
loaded_file
=
simfile
.
load
(
infile
)
timing_data
=
TimingData
(
opened_file
)
chart
=
get_middle_chart
(
loaded_file
.
charts
)
split_timing
=
TimingData
(
opened_file
,
chart
)
print
(
f
"
BPMs splitted:
{
split_timing
.
bpms
}
"
)
print
(
split_timing
.
bpms
.
data
.
__len__
())
#print(len(str(split_timing.bpms.split(", "))))
if
len
(
str
(
split_timing
.
bpms
.
data
.
__len__
()))
==
1
:
filtered_songs
.
append
(
song
)
print
(
filtered_songs
)
# calculate info for each song
for
song
in
filtered_songs
:
distances
.
append
(
read_file_meta_data
(
path
=
song
))
# 107 bpm, meter 5
#distances.append(read_file_meta_data(path="../../7guys1pack/Pretty Please/Pretty Please.sm"))
# 112 bpm, meter 5
#distances.append(read_file_meta_data(path="../../7guys1pack/bad boy/bad boy.sm"))
# 124 bpm,
#distances.append(read_file_meta_data(path="../../7guys1pack/Banger Machine/Banger Machine.sm"))
# 150 bpm, meter 4
#distances.append(read_file_meta_data(path="../../7guys1pack/ALONE [In The Dark]/ALONE [In The Dark].sm"))
# 125 bpm, meter 4
#distances.append(read_file_meta_data(path="../../7guys1pack/And Drugs/And Drugs.sm"))
# 128bpm, meter 6
#distances.append(read_file_meta_data(path="../../7guys1pack/And Laugh/And Laugh.sm"))
#distances.append(read_file_meta_data(path="../../7guys1pack/Abberate/Abberate.sm"))
# 120 bpm, meter 5
#distances.append(read_file_meta_data(path="../../7guys1pack/Asymmetric Snowflakes/Asymmetric Snowflakes.sm"))
#distances.append(read_file_meta_data(path="../../7guys1pack/BOY/BOY.sm"))
# 128 bpm, meter 5
#distances.append(read_file_meta_data(path="../../7guys1pack/Bring Em Back/Bring Em Back.sm"))
# 122 bpm, meter 4
#distances.append(read_file_meta_data(path="../../7guys1pack/Bug A Boo (Joe Stone Remix)/Bug A Boo (Joe Stone Remix).sm"))
#distances.append(read_file_meta_data(path="../../7guys1pack/Carnival (TEEZ Remix)/Carnival (TEEZ Remix).sm"))
# 175 bpm, meter 4
#distances.append(read_file_meta_data(path="../../7guys1pack/Chase the Shadow (2021 Rework)/Chase the Shadow (2021 Rework).sm"))
#distances.append(read_file_meta_data(path="../../7guys1pack/BOY/BOY.sm"))
#SAMPLE_GSM = download_asset("tutorial-assets/steam-train-whistle-daniel_simon.gsm")
#SAMPLE_WAV = download_asset("tutorial-assets/Lab41-SRI-VOiCES-src-sp0307-ch127535-sg0042.wav")
#SAMPLE_WAV_8000 = download_asset("tutorial-assets/Lab41-SRI-VOiCES-src-sp0307-ch127535-sg0042-8000hz.wav")
print
(
distances
)
plot_end_histogram
(
distances
,
"
./outputs/distances.pdf
"
)
#read_audio(path_ex)
#read_audio(SAMPLE_WAV)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment