|
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) |
|
|
|
|