US Treasury notes - how, exactly, does the interest rate get "set"?

Recently, there has been a lot of talks about how if the US defaults on its obligations, then interest rates on US Treasury notes/bonds will go up.

How, exactly, does that rate get set? Does the United States (or an agency of the US) coldly calculate a new interest rate based on past criteria and/or the current credit ratings of the US, and treat it as a take-it-or-leave-it matter, or are interest rates market driven? E.g. does one “bid” on Treasuries?

e.g.

US Gov’t: We have 1000 $10000 notes for sale. They pay 3%.
Japanese Gov’t: We will buy 800, but only for 5%.
Rich Joe: I want 100, but I insist on 7%
Wells Fargo: We will take 150, but want 6%.
US Gov’t: Ok. The Japanese get all of theirs @ 5%, and Wells Fargo you get your 150 @6%, but Joe, sorry, we don’t have enough after selling to the lower bidders, so you only get 50. Here you go. 50 Treasuries @7%.

From a discussion of T-bill auction:

Just to follow on to septimus’s excellent summary, T-bills are auctioned and the participants bid a price, e.g. “I’ll pay $90 for your $100 T-bill (with 10-year maturity)”.

The bid price of $90 gives you the right to cash in the bill for $100 10 years later. You’re essentially loaning the government $90 at whatever interest rate X would grow it to $100 ten years from now (X = the 10-year yield). So the interest rate is a calculated value based on the bid.

Minor nitpick, T-bills have terms of less than 1 year and T-notes have a term of 1-10 years.

What has been posted so far is correct for the original issuance by the Treasury. However, what you see as the bond price on CNBC etc. is usually the price in the secondary market, i.e. what you would have to pay a current bond-holder to buy that bond. If the market felt that there was an increased chance that ultimately the US government would default on the bond, then a person buying a bond even in the secondary market would want a higher return to compensate for that risk, and hence would offer a lower price for the bond.

…and while T-Bills are sold at a discount, T-notes (1-10 years) and T-Bonds (20, 30 years) throw off semi-annual interest payments.