roszcz commited on
Commit
78db4f7
·
1 Parent(s): efec4d0

update copy

Browse files
Files changed (1) hide show
  1. app.py +25 -4
app.py CHANGED
@@ -129,13 +129,34 @@ def piano_music_demo():
129
  secondary_piece=piece_b,
130
  )
131
 
132
- st.write("#### Music generation prompting")
133
  st.write("""
134
- Here's how to highlight show results of a generative algorithm that is supposed to work musically with an input from.
135
- We can take the notes with pitch below 72 (C5) as a prompt, and display it together with the generation.
136
- This sample performs random shuffle of the note pitch values, so the results are not muscially great (your algorithms should be better).
 
137
  """)
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  df = piece.df.copy()
140
 
141
  ids = df.pitch < 72
 
129
  secondary_piece=piece_b,
130
  )
131
 
132
+ st.write("#### Music generation")
133
  st.write("""
134
+ Here's how to show the results of a generative algorithm designed to respond to a musical input prompt.
135
+ We can use notes with pitches below 72 (C5) as the prompt and display them alongside the generated output.
136
+ This example performs a random shuffle of note pitch values, so the results are not musically appealing
137
+ (your algorithms should produce better results).
138
  """)
139
 
140
+ code = """
141
+ df = piece.df.copy()
142
+
143
+ ids = df.pitch < 72
144
+
145
+ prompt_df = df[ids].copy()
146
+ prompt_piece = MidiPiece(df=part_a)
147
+
148
+ # Use your implementation here
149
+ generated_df = music_generation_algorithm(prompt_df)
150
+
151
+ generated_piece = MidiPiece(df=generated_df)
152
+
153
+ streamlit_pianoroll.from_fortepyan(
154
+ piece=prompt_piece,
155
+ secondary_piece=generated_piece,
156
+ )
157
+ """
158
+ st.code(code, language="python")
159
+
160
  df = piece.df.copy()
161
 
162
  ids = df.pitch < 72