Spaces:
Running
Running
liampond
commited on
Commit
·
c79c7f8
1
Parent(s):
f2aca95
Testing to see if markdown was preventing streamlit from building
Browse files- .gitignore +10 -0
- app.py +101 -101
.gitignore
CHANGED
@@ -32,3 +32,13 @@ webapp/output/
|
|
32 |
webapp/tmp_ds/
|
33 |
webapp/uploaded_ds/
|
34 |
webapp/uploaded_mei/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
webapp/tmp_ds/
|
33 |
webapp/uploaded_ds/
|
34 |
webapp/uploaded_mei/
|
35 |
+
docs/resources/arch-acoustic.jpg
|
36 |
+
docs/resources/arch-overview.jpg
|
37 |
+
docs/resources/arch-variance.jpg
|
38 |
+
docs/resources/phoneme-distribution.jpg
|
39 |
+
lib/python3.13/site-packages/pip/_vendor/distlib/t32.exe
|
40 |
+
lib/python3.13/site-packages/pip/_vendor/distlib/t64-arm.exe
|
41 |
+
lib/python3.13/site-packages/pip/_vendor/distlib/t64.exe
|
42 |
+
lib/python3.13/site-packages/pip/_vendor/distlib/w32.exe
|
43 |
+
lib/python3.13/site-packages/pip/_vendor/distlib/w64-arm.exe
|
44 |
+
lib/python3.13/site-packages/pip/_vendor/distlib/w64.exe
|
app.py
CHANGED
@@ -121,50 +121,50 @@ patch_config_yaml_files()
|
|
121 |
st.write("✅ Loaded assets to:", base_path)
|
122 |
|
123 |
# CSS styling
|
124 |
-
st.markdown("""
|
125 |
-
<style>
|
126 |
-
html, body, [class*="css"] { font-size: 18px !important; }
|
127 |
-
div[data-testid="stSelectbox"] label,
|
128 |
-
div[data-testid="stNumberInput"] label,
|
129 |
-
div[data-testid="stTextInput"] label { font-size: 13px; padding-bottom: 0px; }
|
130 |
-
div[data-testid="stSlider"] label { font-size: 0px; }
|
131 |
-
div.stButton > button:first-child {
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
}
|
136 |
-
section[data-testid="stFileUploaderDropzone"] { padding: 2rem; }
|
137 |
-
|
138 |
-
.tooltip {
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
}
|
144 |
-
|
145 |
-
.tooltip .tooltiptext {
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
}
|
161 |
-
|
162 |
-
.tooltip:hover .tooltiptext {
|
163 |
-
|
164 |
-
|
165 |
-
}
|
166 |
-
</style>
|
167 |
-
""", unsafe_allow_html=True)
|
168 |
|
169 |
# Phoneme mappings
|
170 |
phoneme_display_map = { "ap": "Pause", "br": "Breath" }
|
@@ -174,87 +174,87 @@ full_phoneme_list_display = [phoneme_display_map.get(p, p) for p in permitted_ph
|
|
174 |
# Pitch list D4-D5
|
175 |
allowed_pitches = ["D4", "D#4", "E4", "F4", "F#4", "G4", "G#4", "A4", "A#4", "B4", "C5", "C#5", "D5"]
|
176 |
|
177 |
-
# Title
|
178 |
-
st.title("CantusSVS: Latin Singing Voice Synthesis")
|
179 |
|
180 |
-
st.markdown("""
|
181 |
-
# About CantusSVS
|
182 |
|
183 |
-
<p>CantusSVS is a web-based Singing Voice Synthesis (SVS) system designed for composers and musicians to synthesize Latin chant audio from a custom musical score.
|
184 |
-
Built on top of the DiffSinger AI model, CantusSVS enables detailed, precise control over melody, rhythm, phonemes, and timing without any programming knowledge required.</p>
|
185 |
|
186 |
-
<p>Designed by Liam Pond as the final project for MUS6329X: Projet en informatique musicale (Prof. Dominic Thibault) at the Université de Montréal.
|
187 |
-
You can view this project's GitHub repository [here](https://github.com/liampond/CantusSVS).</p>
|
188 |
|
189 |
-
---
|
190 |
|
191 |
-
# How to Use CantusSVS
|
192 |
|
193 |
-
## 1. Compose Your Music
|
194 |
|
195 |
-
Compose the chant you want to synthesize using the notation software of your choice. [MuseScore 4](https://musescore.org/en/download) is recommended.
|
196 |
-
The chant must adhere to the following conditions:
|
197 |
|
198 |
-
- Monophonic only (one note at a time, no harmonies or chords)
|
199 |
-
- Pitch range of <span class="tooltip">**D4 to D5**<span class="tooltiptext">Because training data was limited outside this range, synthesis outside these pitches is very poor.</span></span>
|
200 |
-
- Lyrics (Latin) under each note, separated by syllable
|
201 |
|
202 |
-
## 2. Export Your Score to MEI
|
203 |
|
204 |
-
When your score is complete, export it to MEI.
|
205 |
|
206 |
-
In MuseScore:
|
207 |
-
- Go to **File → Export**
|
208 |
-
- Choose the `.mei` file format
|
209 |
-
- Save it to your computer
|
210 |
|
211 |
-
## 3. Upload Your Score to CantusSVS
|
212 |
|
213 |
-
In the CantusSVS web app:
|
214 |
|
215 |
-
- Select **MEI** mode
|
216 |
-
- Adjust the **tempo** if necessary using the provided slider
|
217 |
-
- Upload your `.mei` file
|
218 |
-
- Your score will be displayed using Verovio
|
219 |
-
- You may use the demo `.mei` file if you wish
|
220 |
|
221 |
-
## 4. Edit Phonemes, Durations, and Pitches
|
222 |
|
223 |
-
CantusSVS automatically suggests phoneme splits for each syllable.
|
224 |
-
However, you will have the opportunity to review phonemes, durations, and pitches.
|
225 |
|
226 |
-
## 5. Synthesize the Audio
|
227 |
|
228 |
-
When you're done:
|
229 |
|
230 |
-
- Click **Confirm**
|
231 |
-
- CantusSVS will create a `.ds` file which are processed through pretrained DiffSinger models
|
232 |
-
- The synthesized chant will be generated
|
233 |
|
234 |
-
This can take a few minutes depending on input length
|
235 |
|
236 |
-
## 6. Listen and Download
|
237 |
|
238 |
-
After synthesis you can either listen to your chant directly in the app or download a `.wav` file to your computer.
|
239 |
|
240 |
-
---
|
241 |
-
""", unsafe_allow_html=True)
|
242 |
|
243 |
-
st.markdown("""
|
244 |
-
<script>
|
245 |
-
const tooltipSpan = window.parent.document.querySelector('span[style*="border-bottom: 1px dotted black"]');
|
246 |
-
if (tooltipSpan) {
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
}
|
256 |
-
</script>
|
257 |
-
""", unsafe_allow_html=True)
|
258 |
|
259 |
filetype = st.selectbox("Select file type:", ["MEI", "DS"])
|
260 |
|
|
|
121 |
st.write("✅ Loaded assets to:", base_path)
|
122 |
|
123 |
# CSS styling
|
124 |
+
# st.markdown("""
|
125 |
+
# <style>
|
126 |
+
# html, body, [class*="css"] { font-size: 18px !important; }
|
127 |
+
# div[data-testid="stSelectbox"] label,
|
128 |
+
# div[data-testid="stNumberInput"] label,
|
129 |
+
# div[data-testid="stTextInput"] label { font-size: 13px; padding-bottom: 0px; }
|
130 |
+
# div[data-testid="stSlider"] label { font-size: 0px; }
|
131 |
+
# div.stButton > button:first-child {
|
132 |
+
# background-color: black; color: white;
|
133 |
+
# font-size: 14px; padding: 4px 10px;
|
134 |
+
# border-radius: 8px;
|
135 |
+
# }
|
136 |
+
# section[data-testid="stFileUploaderDropzone"] { padding: 2rem; }
|
137 |
+
|
138 |
+
# .tooltip {
|
139 |
+
# position: relative;
|
140 |
+
# display: inline-block;
|
141 |
+
# border-bottom: 1px dotted white;
|
142 |
+
# cursor: help;
|
143 |
+
# }
|
144 |
+
|
145 |
+
# .tooltip .tooltiptext {
|
146 |
+
# visibility: hidden;
|
147 |
+
# width: 250px;
|
148 |
+
# background-color: black;
|
149 |
+
# color: #fff;
|
150 |
+
# text-align: center;
|
151 |
+
# border-radius: 6px;
|
152 |
+
# padding: 6px;
|
153 |
+
# position: absolute;
|
154 |
+
# z-index: 1;
|
155 |
+
# bottom: 125%; /* Position above */
|
156 |
+
# left: 50%;
|
157 |
+
# margin-left: -125px;
|
158 |
+
# opacity: 0;
|
159 |
+
# transition: opacity 0.3s;
|
160 |
+
# }
|
161 |
+
|
162 |
+
# .tooltip:hover .tooltiptext {
|
163 |
+
# visibility: visible;
|
164 |
+
# opacity: 1;
|
165 |
+
# }
|
166 |
+
# </style>
|
167 |
+
# """, unsafe_allow_html=True)
|
168 |
|
169 |
# Phoneme mappings
|
170 |
phoneme_display_map = { "ap": "Pause", "br": "Breath" }
|
|
|
174 |
# Pitch list D4-D5
|
175 |
allowed_pitches = ["D4", "D#4", "E4", "F4", "F#4", "G4", "G#4", "A4", "A#4", "B4", "C5", "C#5", "D5"]
|
176 |
|
177 |
+
# # Title
|
178 |
+
# st.title("CantusSVS: Latin Singing Voice Synthesis")
|
179 |
|
180 |
+
# st.markdown("""
|
181 |
+
# # About CantusSVS
|
182 |
|
183 |
+
# <p>CantusSVS is a web-based Singing Voice Synthesis (SVS) system designed for composers and musicians to synthesize Latin chant audio from a custom musical score.
|
184 |
+
# Built on top of the DiffSinger AI model, CantusSVS enables detailed, precise control over melody, rhythm, phonemes, and timing without any programming knowledge required.</p>
|
185 |
|
186 |
+
# <p>Designed by Liam Pond as the final project for MUS6329X: Projet en informatique musicale (Prof. Dominic Thibault) at the Université de Montréal.
|
187 |
+
# You can view this project's GitHub repository [here](https://github.com/liampond/CantusSVS).</p>
|
188 |
|
189 |
+
# ---
|
190 |
|
191 |
+
# # How to Use CantusSVS
|
192 |
|
193 |
+
# ## 1. Compose Your Music
|
194 |
|
195 |
+
# Compose the chant you want to synthesize using the notation software of your choice. [MuseScore 4](https://musescore.org/en/download) is recommended.
|
196 |
+
# The chant must adhere to the following conditions:
|
197 |
|
198 |
+
# - Monophonic only (one note at a time, no harmonies or chords)
|
199 |
+
# - Pitch range of <span class="tooltip">**D4 to D5**<span class="tooltiptext">Because training data was limited outside this range, synthesis outside these pitches is very poor.</span></span>
|
200 |
+
# - Lyrics (Latin) under each note, separated by syllable
|
201 |
|
202 |
+
# ## 2. Export Your Score to MEI
|
203 |
|
204 |
+
# When your score is complete, export it to MEI.
|
205 |
|
206 |
+
# In MuseScore:
|
207 |
+
# - Go to **File → Export**
|
208 |
+
# - Choose the `.mei` file format
|
209 |
+
# - Save it to your computer
|
210 |
|
211 |
+
# ## 3. Upload Your Score to CantusSVS
|
212 |
|
213 |
+
# In the CantusSVS web app:
|
214 |
|
215 |
+
# - Select **MEI** mode
|
216 |
+
# - Adjust the **tempo** if necessary using the provided slider
|
217 |
+
# - Upload your `.mei` file
|
218 |
+
# - Your score will be displayed using Verovio
|
219 |
+
# - You may use the demo `.mei` file if you wish
|
220 |
|
221 |
+
# ## 4. Edit Phonemes, Durations, and Pitches
|
222 |
|
223 |
+
# CantusSVS automatically suggests phoneme splits for each syllable.
|
224 |
+
# However, you will have the opportunity to review phonemes, durations, and pitches.
|
225 |
|
226 |
+
# ## 5. Synthesize the Audio
|
227 |
|
228 |
+
# When you're done:
|
229 |
|
230 |
+
# - Click **Confirm**
|
231 |
+
# - CantusSVS will create a `.ds` file which are processed through pretrained DiffSinger models
|
232 |
+
# - The synthesized chant will be generated
|
233 |
|
234 |
+
# This can take a few minutes depending on input length
|
235 |
|
236 |
+
# ## 6. Listen and Download
|
237 |
|
238 |
+
# After synthesis you can either listen to your chant directly in the app or download a `.wav` file to your computer.
|
239 |
|
240 |
+
# ---
|
241 |
+
# """, unsafe_allow_html=True)
|
242 |
|
243 |
+
# st.markdown("""
|
244 |
+
# <script>
|
245 |
+
# const tooltipSpan = window.parent.document.querySelector('span[style*="border-bottom: 1px dotted black"]');
|
246 |
+
# if (tooltipSpan) {
|
247 |
+
# tooltipSpan.addEventListener('mouseover', () => {
|
248 |
+
# tooltipSpan.children[0].style.visibility = 'visible';
|
249 |
+
# tooltipSpan.children[0].style.opacity = 1;
|
250 |
+
# });
|
251 |
+
# tooltipSpan.addEventListener('mouseout', () => {
|
252 |
+
# tooltipSpan.children[0].style.visibility = 'hidden';
|
253 |
+
# tooltipSpan.children[0].style.opacity = 0;
|
254 |
+
# });
|
255 |
+
# }
|
256 |
+
# </script>
|
257 |
+
# """, unsafe_allow_html=True)
|
258 |
|
259 |
filetype = st.selectbox("Select file type:", ["MEI", "DS"])
|
260 |
|