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)