The trumpet has only three valves but can produce 45 distinct notes

source