###Summary
Summary
A whistle with a much smaller resonating chamber has only a very small set of frequencies it resonates at. A bugle, much longer with a horn on one end, resonates at many frequencies. Both start with broadband noise, but the whistle can only resonate at one frequency, while the bugle can resonate at several. Therefore the bugler can adjust the broadband noise to get the frequency they are interested in.
###Noise source
Noise source
Whistles and bugles produce sound in fundamentally different ways, however the result is the same - a relatively narrow but still broadband noise is introduced to the instrument's resonating cavity:
A whistle pushes fast moving air past slower air, producing vortices that create pressure waves. This results in broadband noise with a peak frequency. The chamber or tube which this noise is introduced to resonates at a specific frequency withing the broadband noise, and not only damps other adjacent frequencies, but reinforces the selected frequency. Notably, this broadband noise isn't very adjustable - you can blow faster or slower, but the design of the noise source limits the user's control over what the dominant noise frequency is.
A bugle player introduces broadband noise into the bugle by flowing air past the player's lips, which vibrate, modulating the air and creating the pressure waves. The user has a great deal of control in the dominant frequency introduced into the instrument. By adjusting the tightness of their lips, they can increase or decrease the frequency significantly.
###Resonant cavity
Resonant cavity
When a wave is reflected back towards its source, if it's not in phase with the source, the reflection will damp or reduce the source. If it's in phase, it will reinforce the source.
In a whistle, the chamber or cavity is very simple, most often just a cylinder. It resonates at relatively few frequencies.
A bugle is a much more acoustically complicated instrument. Not only does the length of the tube create a long cavity which can resonate at many frequencies, but the bell at the end is a significant (and complex from a physics standpoint) part of the cavity. A theoretically "perfect" bugle would only resonate at the desired frequencies. Of course there are tradeoffs in the real world, and so the player still has significant work making sure they produce an initial noise that makes the desired note, but the bugle still damps most frequencies, and reinforces the desired frequencies.