I don't really produce edm that much but I do this all the time with guitar riffs, if I want to write a song I go through my random riffs and maybe something works.