acanivet's picture
v1
bdac835
raw
history blame
951 Bytes
import streamlit as st
from model import generate
import numpy as np
if "result" not in st.session_state:
st.session_state["result"] = np.empty(16000*4)
st.title("Sound Exploration")
col1, col2 = st.columns(2)
with col1:
instrument = st.selectbox(
'Which intrument do you want ?',
('🎸 Bass', '🎺 Brass', 'πŸͺˆ Flute', 'πŸͺ• Guitar', '🎹 Keyboard', 'πŸ”¨ Mallet', 'Organ', 'Reed', '🎻 String', 'Synth lead', 'πŸŽ™οΈ Vocal')
)
with col2:
instrument_t = st.selectbox(
'Which type intrument do you want ?',
('πŸ“― Acoustic', 'πŸŽ™οΈ Electronic', 'πŸŽ›οΈ Synthetic')
)
with st.expander("Magical parameters πŸͺ„"):
p1 = st.slider('p1', 0., 1., step=0.001)
if st.button("Generate ✨", type="primary"):
st.session_state["result"] = generate([instrument, instrument_t])
if st.session_state["result"].any():
st.audio(st.session_state["result"], sample_rate=16000)