Using xAI’s Grok to Create a Music Player on a Web Page: Chapter 1

I have been experimenting of late with the idea of putting a music player on the Web server I have on our home network. This would give me the ability to easily share a song with a friend or family member, among other functionality. The Web server runs on a Raspberry Pi single board computer configured with Apache and replaces the server I maintained for some years on BlueHost:

Bluehost is a well-established web hosting provider that has been operating since 2003 and is known for its wide range of hosting services, including shared hosting, VPS, dedicated hosting, and specialized WordPress hosting. (via Grok)

Indeed, this new little the server provides this WordPress site on which I am posting this piece right now!

I already have two versions running, Player 1 and Player 2. The first generation player is about as basic of an application one can imagine. It consists of coding in HTML (HyperText Markup Language) and JavaScript, implemented with the help of one of the well-known generative AI systems, i.e. ChatGPT from OpenAI, Claude from Anthropic, or Gemini from Google. I found the second player on GitHub, and it is clearly the product of a lot of work by the developer, Laurens R. Krol, who included his information in the readme.txt for the software. To give credit where credit is due: (Here is Laurens personal Web site, and he is research director at “Zander Labs and scientific coordinator of Project NAFAS.”)

The bottom line is that each of these first two players suffers from a couple of limitations. The first version has no graphic design whatsoever, but hey, that was my first effort where I created something myself with these tools! 😊 Previously, I had “my guys” doing this sort of stuff in the lab at BYU. Now that I am retired, I no longer have any “guys” to do this sort of stuff. Not only that, but those “guys” would of course not have been doing this sort of personal project anyway! Because I have gotten back to programming in the past couple of years, I am excited about doing projects myself. After all I first started programming many years ago, beginning in January 1969 with Fortran.

Anway, back to the discussion of music players. The second player version is definitely an improvement. It has a nice graphical feel to it, but it also has the same serious limitation of the first. In each of those two cases I have to reference each song as an entry on a line of code in the program. This becomes a bit of a problem: there are 3,029 songs presently in my music collection!

Of course, I can access my music collection easily on my phone anywhere. Here at home, I can also use Amazon’s Alexa and the software system My Media for Alexa . When I say “Alexa, ask my media to play songs by the Beatles!” the system will very dutifully comply by connecting to the music player on a Raspberry Pi 3, one of the older single board computers running here. When is ask Alexa to play a French song, it’s a different story. Alexa’s lack of understanding is only sometimes resolved when I pronounce the title with the worst French accent imaginable!

Although my next project does not address that problem, I want to create a new version that mimics Winamp, an early media player for Windows on a PC. Here is how xAI’s Grok describes Winamp:

Winamp was not one of the very first media players on Windows, but it was among the earliest to gain widespread popularity. Before Winamp, there were players like Windows Media Player (which came bundled with Windows), but Winamp’s release in 1997 marked a significant shift due to its focus on MP3 playback at a time when this format was becoming mainstream due to the rise of file sharing.

To make that happen, I have started a discussion on xAI’s Grok. Because this is the first time that I am using that particular generative AI platform for anything substantive, I did not know how to return to previous chats. On the other platforms that I have used most extensively I can easily access previous queries. Not knowing that for Grok, I did know that could easily share a link. Thus, I am creating this post, to include this link, to document that query! 😊

P.S.

I just learned that to access previous chats, I only have to click on the “Chat history” icon that that appears at the upper right-hand corner to the left of the “New Chat” icon:

Posted in Generative AI, Large Language Models | Tagged , , , | Leave a comment

The Hoaxes Continue

Many people are upset that Presient Trump has pardoned the people who have been in jail as a result of the awful demonstrations gone awry on 6 January 2021. Their reasoning is that he supposedly instigated, even encouraged, their actions. Used for justification for this view is this quote that was endlessly repeatedly by the media, “And we fight. We fight like hell. And if you don’t fight like hell, you’re not going to have a country anymore.” It should be clear to the average reader that he said this in the context of political discourse in which “fighting” is used by basically all politicians, everywhere.

With that he also said, “I know that everyone here will soon be marching over to the Capitol building to peacefully and patriotically make your voices heard.” That part was purposely omitted by Trump’s opponents. His entire speech is available here.

The same people who want us to beleve he called for violence on that occasion also want us to believe that Trump referred to neo-nazis and white nationalists as “fine people.” President Joe Biden even cited that supposed statement as his main reason for deciding to run for the Presidency. As the world turns, however, that hoax was even debunked by Snopes.com, a site that is not known for taking up conversative causes.

So, if Trump did not call for violence on January 6, and he did not call neo-nazis “fine people,” what other lies have perhaps been fed to the American people? One Web site, “The American Debunk” has done an excellent job explaining how many hoaxes such as these have been foisted on the world. The site explains how removing context and selective editing make hoaxes such as these possible.

In fact, the site has already documented the latest hoax, which was started just yesterday, the day of the inauguration. Supposedly, Elon Musk gave a nazi salute at the parade at the Capital One Arena, but as the “The American Debunk” points out, Musk touched his heart and gestured to the crowd saying right afterwards, “My heart goes out to you” It would be well worth it to anyone who cares what is going on to take the two minutes to watch the site’s explanation of the framing of this latest hoax:

While on YouTube, it would be well worth another 3 minutes to watch the debunk of the Fine People Hoax. Here is the link to that one:

Posted in Current Events | Leave a comment

WordPress: From the Cloud to Raspberry Pi

I didn’t call it a blog, but I started my first Web site on a NeXT Cube on Thanksgiving Day, 1995. The computer was on loan from the US Air Force Academy, and when a new BYU colleague told me about this important development underway called the World Wide Web (Many thanks, Jesse!), I decided I needed to get involved.

First Web Server

It turned out that the particular computer I happened to have available was the same type of unit used to invent the World Wide Web.

Tim Berners-Lee had used a NeXT Cube for his work at the Center for Nuclear Research (CERN) in Switzerland. For this first Web site I downloaded the necessary software from the CERN FTP site and configured the Unix-based software. Voilà! I was online with my first Web presence! Almost 20 years later I created my first blog using WordPress, pretty much the gold standard for this type of functionality.

Update added in November, 2024:

That WordPress site ran on a “server in the cloud” with Bluehost for 11 years, and here we are in 2024! I recently completed the porting not only of the WordPress blog created on the Bluehost server, but also the content that resided on that NeXT computer all those years ago.

For current system, I am using a Raspberry Pi with 8GB of RAM with a terabyte hard drive, running on my home network with a URL assigned with a free registration with Cloudflare. 

I asked ChatGPT to compare the NexXT with a Raspberry Pi 4:

Raspberry Pi 4 Image and DescriptionThe Raspberry Pi 4 and NeXT Cube illustrate decades of progress. The Pi 4, with up to 8GB RAM, a quad-core 1.5 GHz ARM CPU, and a price under $100, is approximately 50-100 times more powerful than the 1988 NeXT Cube, which had 8MB RAM, a 25 MHz CPU, and cost $6,500—equivalent to about $16,000 today. The Pi’s immense power and affordability sharply contrast with the Cube’s premium cost and limited performance by today’s standards.

Of course, the NeXT had a monitor and a 256 MB magneto-optical drive, a pioneering storage technology for its time, as well as a 40-320 MB hard drive. But still, the comparison after about three decades is mind-boggling.

Posted in Geeky Stuff, Personal | Leave a comment

LLMs for Writing Movie Scripts

As a simple test of various Large Language Models, here is a simple prompt that I submitted to three different systems. Note the intentional lack of details, which was a test to assess each model’s ability to come up with relevant and accurate information.

Here is the interaction with the most well-known model, OpenAI’s ChatGPT.

I changed the prompt slightly for a couple of other models Google’s Gemini and Anthropic’s Claude:

“I need the script for a scene for a movie. It is 27 June 1844. A rider (a well known friend of Joseph and Emma) comes to her home to alert her as to what happened. Write the dialogue for this scene.”

Click here for the result from the interaction with Google’s Gemini. Note the interaction with the chatbot to improve the accuracy of the script.

Here is the results of the same interaction with Anthropic’s Claude.ai. I was unable to get a direct link to the script, so I am pasting it here:

[A rider gallops up to the Smith home in Nauvoo and dismounts, rushing to the door and knocking urgently]

Emma Smith: [opening the door] Why, Brother William, what’s the meaning of this?

William Clayton: [catching his breath] Sister Emma…I’m afraid I bear grave news. It’s about your husband.

Emma: [fear crossing her face] Joseph? What’s happened?

William: He and his brothers were arrested this morning by a mob militia in Carthage under the governor’s order. They’ve been charged with treason and riot.

Emma: [gasping] Oh no…no, this cannot be! Treason? For what cause?

William: For his teachings and the gathering of the Saints, I fear. They claim he’s raised an army against the state.

Emma: But that’s an outrage! He’s done nothing but preach divine truth. We must go to him at once.

William: I’m afraid that won’t be possible, Sister. The jail is surrounded by the militia and an armed mob. It’s not safe.

Emma: [anguished] Then what are we to do? We cannot leave him in their hands! You know what they’ve threatened against him before.

William: [gravely] I wish I had better news…All we can do is put our faith in the Lord’s hands now and pray for a miracle.

Emma: [weeping] Oh Joseph…the Lord alone knows what shall become of this…

Posted in Geeky Stuff, Generative AI, Large Language Models, New Stuff | Leave a comment