Contrary motion and counterpoint tend to be used mostly in composers’ vernacular, but they’re concepts that have a place in just about all genres. Being aware of them as tools, particularly as an electronic producer who’s creating the instrumentals for an entire track, can certainly be valuable.
Contrary motion is simply the practice of having one melody ascending while another is descending. The most common use of this trick is over the bass line and lead melody line, the bass line using octaves and harmonies of the lead line. This adds a layer of complexity and tension to the piece of music, rather than simply having a bass line predictably follow your lead melody. So keep that in mind next time you’re working melodies, pick a scale and see if you can create two voicings that run away from each other in your chosen instruments.
Oblique motion is a related concept, and defines the action of one instrument playing a single note while another goes in any direction. You can hear this a lot in cheesy rock songs; a bass player chugging away on a G while the lead guitarist shreds up and down the fretboard, but that’s not to say you can’t apply the concept creatively in electronic music.
Counterpoint is another melodic concept, and it’s one that you can certainly use contrary motion in. At its root, it boils down to multiple independent melodies playing at the same time. A lot of classical music is extraordinarily busy — there’s melodies going on all over the shop — classical composers loved a good counterpoint melody. In contemporary music, you can apply this concept to a secondary main melody coming in to add depth and drive to your music. The idea works well when the melodies are rhythmically and melodically independent but resolve to be on your root note (or note within a chord structure) at crucial points — like the end of a bar for example. In between those crucial points though, you can have fun and be creative.
Hopefully those concepts help get you away from playing ‘follow the leader’ with your melodies and song arrangements. Get experimenting and enjoy!