quick links

essays poetry anthology electronics projects playlists bicycles

Technical Logs/Journal

072226 - Going to start documenting my work on this website in a sort of technical journal as I personally think it is probably good in all kinds of technical work to maintian some kind of project journal for a number of reasons that I feel are self-evident with some though, and this is just for me anyway so there isn't any audience besides me to explain this to. Today I am working on adding a basic audio player to the sire. I was successful this morning at adding a play/pause button that was nicely animated with some javascript that could,well, play and pause an mp3 file (youtube to mp3 conversion of the demo version of The Replacements' Can't Hardly Wait). However, the ultimate dream is to implement some live broadcast. One day I could probably implement some real solution that operates with some kind of simple server and a service that I just found like "Icecast" which is what a website on neocities called radio.kwsx.online uses. However, a perhaps clever idea that I have is to simply have a long playlist audio file loaded up on deck, I'll create an audio object with the js new audio = Audio(SRC FILE HERE) constructor, and then call Date.now() to get the current time, and set the current time on the audio file to audio.currentTime = Date.now() % audio.duration. Also, I've been using JSpaint to create thumbnails quickly by hand its kind of cool. You can also just do Image>Invert Colors to create a nice "hover" icon.

Okay update: crude live player works. https://www.w3schools.com/Jsref/dom_obj_audio.asp. In order to access the duration of the audio file, you first need the metadata (at least) to load. So what you can do is force the page to preload the metadata with audio.preload = "metadata". Then I think best practice is to set the starting point only after the metadat has loaded by using an event handler, audio.onloadedmetadata = function(){ IN HERE YOU SET THE CURRENT TIME WITH THE (Date.now()/1000) % Math.floor(audio.duration) and tell the audio to start playing audio.play() }. This is best practice because I think you otherwise could create a race condition in which its possible that js tries to set the currentTime before the metadata has loaded in which the duration will return NaN and you're SOL.

Furthermore, I think the best way to handle playlist mp3 and metadata is to create a playlists directory with subdirectories with standardized naming conventions for metadata and mp3 file. Not sure the best way to pull strings from text files. I think instead I will set up an easily edited config.js file where I can easily update things that I might want to update often: playlist name and path, stubbs images, etc. Also, the music player should have some other controls/displays: volume, current position in runtime, playlist name with a link to details (details contained on html page in the playlist directory)


072326 - Today just doing some backend infrastructure stuff. Like I mentioned yesterday (I think), I'm assembling a config.js file to make updating aspects of the site a little easier. For instance, today on this file I created a Playlist class that will contain some metadata and locations of (i.e. "point to") primary data for each playlist. The config file will be contain a list of these Playlist objects and will have a single line of code that I can edit to drop a different playlist into the Home Screen location. You caould see how this might allow for some kind of javascript automation where the playlists can automatically rotate by day or something like that. There are larger implications for this as well I guess. This requires a highly structured and scalable file system to contain the playlist data which is what I have been tediously setting up.

Also, building off of the playlist idea, I have already established a structured filesystem for the peoms within the anthology, so I should be able to set up a button on the home screen that will send you to a random poem within said anthology. My original idea was to display the poem on the home screen, but due to differences in poem length this might be impossible.

Also been implementing this idea I have to add some external links to cool websites. I could also put together some master lsit of links on its own page, but my original idea was to have a few relevant external links on the sidebar of each page (e.g. track-blaster.com on the playlist page).

could be cool to have a cheezy oscilloscope-style audio visualizer. Perhaps time axis, xy-axis, and dft visualizations