Yes, a MIDI keyboard with 25 keys will be sufficient for producing music. This is especially true if you plan on making beats or loops. You'll have 2 octaves at your disposal on a 25 key MIDI keyboard and plenty of control options. This makes them great for jotting down quick ideas. That said, 25 keys is the bare minimum requirement for music production.