You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seperation of system instructions and prompt, and playback safety
- Prompt and system instructions are seperated and now sent through GenerativeAI.SystemInstruction.
- Playback safety is ensured by preventing playing music if a note is already playing.
/*Spoiler: Now, it's not rubbish anymore since I used GenerativeModel.SystemInstruction
1051
+
property of Google_GenerativeAI library, but I kept it as is for nostalgia for
1052
+
my good old "makeshift rubbish prompt template" days. :) */
1053
+
1054
+
// The string that contains system instructions for the AI model
1055
+
stringsystemInstructions=$"--- AI Instructions ---\r\n"+
1051
1056
$"You are an expert music composition AI. "+
1052
1057
$"Your primary goal is to generate music in a well-formed NBPML XML file format. Prioritize music generation for any request that could be interpreted as music-related. "+
1053
1058
$"If the user prompt is a song name, artist name, composer name, or ANY music-related term (even a single word), treat it as a music composition request. "+
@@ -1194,16 +1199,17 @@ by creating NBPML text (Fun fact: I wasn't know what system prompt is.
1194
1199
$" </Line>\r\n"+
1195
1200
$" <!-- More <Line> elements representing musical events or rests -->\r\n"+
0 commit comments