Human-written demonstration (OpenAssistant volunteers)· OpenAssistant (human-written)
OpenAssistant Conversations (oasst2)
write an example of code that produces MIDI sounds to the tune of popular urban hip-hop
In OpenAssistant data, “assistant” turns were written by human volunteers as demonstrations. They are not model outputs.
- User
write an example of code that produces MIDI sounds to the tune of popular urban hip-hop
- Assistant
Here is an example of code that produces MIDI sounds to the tune of popular urban hip-hop using the Python library midiutil:
pythonimport midiutil # Set up the MIDI file tempo = 120 # beats per minute duration = 2 # seconds track = 0 channel = 0 volume = 100 program = 1 # Acoustic Piano midi_file = midiutil.MIDIFile(1) midi_file.addTempo(track, 0, tempo) # Define the notes notes = ["C5", "D5", "E5", "G5", "A5"] durations = [1, 1, 1, 1, 2] # Add the notes to the MIDI file time = 0 for note, dur in zip(notes, durations): midi_file.addProgramChange(track, channel, time, program) midi_file.addNote(track, channel, midiutil.noteNameToMidi(note), time, dur * duration, volume) time += dur * duration # Write the MIDI file to disk with open("hip_hop.mid", "wb") as output_file: midi_file.writeFile(output_file)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →