The melody i'm referring to can be heard at 00:49 in the video below, with a variation coming in at 1:11 if you are interested. Full track can be found here.
In the example above, I used my laptop and a small MIDI keyboard (the Akai LPK25) to quickly get this idea down using a basic piano synth. However this isn’t the only way to do this. I also have another folder set up in my webmail account, and I often take field recordings on my iPhone of music or other sounds that I like and want to use. Then I simply email these sounds to myself. I also use Dropbox for this purpose, and if you have an iPhone too then I would suggest investing in the iTalk application which allows you to record sounds in 44.1 kHz quality then email them to yourself (or anyone else for that matter) and synchronize the sounds to your Dropbox account. If you have Dropbox installed on your studio PC, the next time that you go to make music the recordings will be available on this machine.
Don't stop there though, you could also hum ideas you have into your iPhone. If you don’t have an iPhone or would prefer to get higher quality recordings (in the case of wanting to use certain field recordings as actual samples) and have between 200 and 250 Australian dollars to spare, then you could always get a portable field recording device such as the Zoom H4 as shown in the picture below. Simply emailing yourself YouTube clips of songs you want to sample is another way to go, and that way you can come back at a later date and investigate if it's something you'd like to use. This works well with plugins that you may read about and want to try or that come up on any social media services you use, as well as techniques for transitions in a song that you hear when just listening to music, sample packs you may find on the internet and even synth patches that you might come up with on the fly. Last time I traveled interstate, to Brisbane, I made two really cool synth patches on the plane while on my way over which I just emailed to myself once I arrived.
Professional producers tend to use this technique usually out of necessity due to a heavy touring schedule, as attested to by Phetsta in a recent interview on Bassology conducted by Kay Gray, see below. He describes a similar process to mine, of using a simple piano synth to quickly get down ideas and keep up his creative output.