There's melodies in techno?
I've used this receipe to write a few tunes.
-mix some straight booze in a tall glass with plenty of ice cubes
-turn up the drums 2 db for every ice cube in the glass
-kick the chair out of the studio and stand by the gear
-think about something in the day that really..really pissed you off and was out of your control and then turn on a synth..don't touch those presets, in fact you should be deleting the preset banks and start with a sad plain jane vanilla tone. Start to twist that sound as it was the physical manifestation of what was troubling you. The more you twist it and hurt it, the more it should howl in response. You may start grinning by now.
-your glass may be empty and you are swaying a lot. When you fall to the floor as you clumsily grasp at the keyboard is usally how you write a good fill.
works for me.