File size: 951 Bytes
55056c0 bdac835 55056c0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
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)
|