Excellent! This is an area that is begging for information and insight. As someone who has published a bit, let me offer some advice. (Perhaps not needed by you, but for others who are considering getting in the game.)
First, to establish my my own pubcred, many of you know I have recently gone the self publishing route with a book now at Lulu.com. Fewer (apparently a lot fewer) may know of my textbook, now languishing on Amazon at an absurd price. And finally, I have sixty-some short tutorials on Max/MSP circulating world wide. (Information on all of these can be found at my site listed below.) Here what those experiences have taught me.
First, there are six parts to the process:
Writing the text-- actually you spend more time researching and experimenting than looking for words. You want everything you say to be true, solidly backed up by personal experience or information from trusted sources.
Copy editing-- this is more than just running spell check. This means repeated readings and rewriting to make sure you are getting your points across as clearly as possible. (I urge you to get a copy of "Line by Line" by Claire Kehrwald Cook.) This is the most painful part, as you will have to (in various writer's words) kill some babies.
Graphics-- yet another art that must be mastered. This is the production of drawings or photos that illustrate your material. It's a lot more time consuming than you think, especially as production requirements of various publishing venues are rigorous and contradictory. You will probably have to buy some high end software just to get the art formatted.
Page layout-- It's not hard to make attractive pages in Word (consistent headings, no pages with just one sentence, and so on) but this will not transfer to the formats publishers require. It's not hard to sort out, but tedious, because every tweak you make ripples all the way through the rest of the chapter. Of course, you need a completely different layout for ePub if you want to go that way.
Production-- paper books require a printing press. Obviously, you will get someone else to do this. There are two ways to go. The traditional way is to run as many you think you are going to sell and then store them until the orders come in. This is the cheapest way, but eventually the cost of storage exceeds what the book can earn. The new-fangled way is print on demand. PODs are more expensive per unit, and the printing delay is added to the shipping delay, which may disgruntle your readers. The new POD publishers promise things will get better. ePubs need extra formatting, either by a (probably expensive) program or someone really hot in HTML and XML. Then you need a solid server to host it.
Marketing-- once you have a book, it will only be bought by people that have heard of it. You can tell a few influential friends and hope they will take it viral, but the chances are about the same as getting airplay for a pop single. You will need to annoy a lot of people to get reasonable sales.
Distribution-- filling orders one by one is a full time job. You can just collect orders and mail the books out, but this will prevent any more music production. (Unless the book is a flop, of course.) You need a fulfillment service.
Luckily, there is plenty of help available. Just like the music business, many companies are eager to profit from your talent and hard work. Service levels run from writing and publishing the book for you, free-lance copy editors and graphics and layout artists, to plain POD and ePub hosting a la Lulu and Amazon.
Old school publishing is probably not what you have in mind, and that makes sense. My textbook publisher treated me well (and supplied a dynamite copy editor), but their process was so slow that by the time they were ready to print, several of the software companies I used for examples had gone out of business. (Remember Peak?) I did a quick rewrite, and they sat on it for another year. So it is really a text on electro-musicology. If there has been any marketing, I haven't noticed it, although they did get it in many university libraries (at a discount, which cut my percentage). As for the money side, it's pretty much like the music industry, royalties on sales. l get paid about 15% of the price, but they pegged the price to the textbook market, not general interest, so only students who need it for a course will buy (as far as I know, there are no classes anywhere that require it.) Once a year I get a check for maybe $700. As a final straw, the editors refuse to even consider ePubs. (I pitched another publisher who has a modern attitude for my second book, but they saw the market for what I was selling as too small. They are looking for 10,000 sales to break even.)
My experience with Lulu consisted mainly of reading a convoluted set of web pages trying to find out how to get the manuscript formatted for their system. (Also look carefully at their pricing information and the use of ISBNs.) I eventually wrote my first draft in Word, then imported it into Open Office to get an "official" PDF that Lulu can handle. The problem with open office is that their layout tools are not ready for prime time, and I kept having to delete and reinsert graphics. If I do an ePub version I'll use InDesign. Lulu's deal is they set a production price, you set a cover price, then Lulu gives you a percentage of the difference.. However, if you want to go to other retailers, you set a wholesale price and Lulu gets you an ISBN and becomes the publisher of record. That means they own part of the copyright and your cut becomes a royalty from them. Great, unless they go down the tube. Then you will wind up in copyright hell.
My freebies are all plain old PDFs of varying quality. They were originally hosted on a University server, since they were course materials. I was kind of surprised when I started getting mail about them, but it is satisfying to know folks find them useful. (IT said they were the most popular downloads on the campus.) I had to set up my own server to host them after my retirement, but I just piggybacked on my wife's business account, so I avoid the usual GoDaddy hassles.
I'm not trying to discourage anyone here. Writing is a lot like music, in that it is rewarding in itself. A few people manage to make a living at it, and even fewer get rich doing it, so don't let your expectations get out of hand. I'm looking forward to reading what you have to say.
P.S. the best source of information on all of this is
https://selfpublishingadvice.org