$ luarocks install ai-make-music luarocks install ai-make-music
local ai_music = require("ai-make-music")
local melody = ai_music.generate_melody({
style = "pop",
length = 30, -- seconds
tempo = 120
})
print("Generated Melody:", melody) -- Returns a string representing the melody (e.g., MIDI data)
-- Save the melody to a file (implementation depends on your MIDI library)
-- local file = io.open("melody.mid", "w")
-- file:write(melody)
-- file:close()
local ai_music = require("ai-make-music")
local base_melody = "C4 D4 E4 F4 G4 A4 B4 C5" -- Example melody
local harmony = ai_music.harmonize_melody({
Versions
Dependencies
lua >= 5.1