Log In  
Log In  

Cart [#gruberp8tunesvol2visuals-7#] | Code | 2019-04-17 | License: CC4-BY-NC-SA | Embed
1

This cartridge's source code is a modded variant of "Music Visualizer Bars" by iaoth:
https://www.lexaloffle.com/bbs/?pid=51460
Thanks to him for his visualizer code base!

What I've changed (first version):

  • Corrected the octave numbers to match the PICO-8 SFX editor.
  • Fixed the waveform colors of the bars being wrong. The PICO-8 palette index it was referring to was 1 less than what the SFX editor references to.
  • Changed the beige text color to white. Prevents blending with bars with the PHASER waveform (SFX editor value 7).
  • Implemented displays for custom instruments (SFX 0~7) and effects (slide/vibrato/drop/fade/arp).
  • The colors of the bars and displays now change accordingly if the instrument is either a fixed waveform or a custom instrument.
  • Implemented the DROP and FADE IN effects (SFX editor values 3 and 4, respectively) to the volume bars' handling code. The code I added may not be 100% accurate, but if you have any changes to make to it, please let me know in the comments!
  • Added a function to disable all loop/stop control flags in the music RAM, found at 0x3100~0x31FF in the PICO-8 memory map. This can be disabled by commenting out lines 9~11 in code tab 0.

Update March 27th, 2019:

  • Changed the DROP and FADEOUT effects' speed in their respective handler code. It should be more accurate now.
  • The position of the effect displays' texts are now pseudo-centered.
  • The dark-gray color of the displays for custom instruments is now changed to brown, if it blends with the black background of the visualization.

Update April 3rd, 2019:

  • Fixed custom instrument displays from showing "SFX -1".
  • When the note volume is zero, the wave is set to -8 to make the bar black.
  • Custom instrument bars are now changed to a darker gray. The note/effect displays are changed to white, to be like the fixed waveforms.
  • Effect names now make use of PICO-8's own text string emojis.
  • If PICO-8 plays note indexes beyond 31, they're now treated as being a zero-volume note. Fixes the bars playing inaudible pattern data, especially noted with Marballs 2 while I was making this update.
  • Added displays at the top for showing which patterns and notes the channels are playing.
  • Added another display for identifying what frames repeat or stop the track, by reading the music control flags of each of those 64 frames on the cartridge.
  • Added a simple main menu to select a track the user wishes to play, rather than playing all tracks in one go.

Update April 5th, 2019:

  • Made the loop and stop shapes brighter, as a result of preventing bars for displaying on the top 16 pixel rows.
  • Frames with all three flags disabled will now be displayed with a dark-gray dot/pixel.
  • Arp displays now show the exact note-cycle frequency division for the ~120Hz SFX clock.
  • Tracks in the TRACK.DATA table now have support for loading from an external cartridge. If this is unspecified, track data from the visualizer cartridge itself will be used instead.
  • Minor changes to the menu, including fixing a mistake where I didn't mention the left and right arrows would also select the track, which was already a thing in the previous update.
  • Added the ability to stop a track during playback. When stopping, a 333ms fade-out is applied. However, you can still pause the track by pausing the cartridge.
  • Removed the 3-line time code in the DRAW_VISUALIZER() routine that existed there and did nothing at all.

Update 2 (April 5th, 2019):

  • Fixed bars 2~4 from drawing in front of the top displays.
  • Fixed note nn indexes beyond 31 from showing on the "Rnn" displays.
  • SFX speed is now more accurate to the PICO-8 SFX engine.
  • Bars will no longer display beyond the limit (MUSIC_EVENTS.VOLUME[I]>7), improving max-volume FADE IN effects.
  • More minor changes to the interfaces.

Update April 14th, 2019:

  • Added support for the undocumented "half-clock" audio flags in the RAM. Even when they're disabled (which they always were in all previous versions), the drop/fade speed is now fixed in regards to that TIME() change in PICO-8 0.1.12.
  • The 333ms fade-out is now more like an actual third-of-a-second fade.
  • Added a screen-saver! I don't know if it's any good, but please tell me your thoughts about it in the comments!
  • Removed more unnecessary parts of the code, including a blank MUSIC_EVENTS.LIST table that wasn't used.

Update April 15th, 2019:

  • Fixed the FADE-IN movement from heaping over the top of the bar height position that represents the current note volume.
  • The screen-saver color-changer now refers to the lowest-indexed active channel, instead of only the first channel.
  • Changed the PEEK4() into the recently-added PEEK2(). Notes are 16 bits long, so NOTEDAT doesn't need to be 32-bit.
  • When a track stops, it now automatically goes back to the main menu.
  • Changed a few text label strings.
  • Removed one more unnecessary code line that I forgot to remove.

Update April 16th, 2019:

  • Text labels and code editor comments now feature lowercase letters. Since PICO-8 0.1.12 doesn't convert to lowercase letters when 0.1.11g did, this change was made.
  • Fix to prevent the first frame of track playback from being drawn. This first frame had info from the previously-played track that shouldn't be drawn.
  • Minor change to the code that gets rid of one FOR loop.

To Do:

  • Allow playlists to be configured for native exports (Windows, Linux x64, MacOSX) from PICO-8. This could probably allow custom playlists of other cartridges to be created without having to buy the fantasy console. When there's a way to get this fully working, there's a will to release binaries to the public. For now until then, if you want to see other songs with my visualizer, post some suggestions in the comments, and I'll reply with a cartridge!

To test my new changes to his visualizer, I thought I'd use something new that really got my attention the other day. That is "PICO-8 Tunes Vol. 2", released by Gruber, which is a cartridge featuring 10 amazing tunes! You can find it here:
https://www.lexaloffle.com/bbs/?pid=62911

P#63059 2019-03-27 09:09 ( Edited 2019-04-17 05:27)

Here's a tip for visualizing music from any cartridge!

  1. Go to the SPLORE menu in the PICO-8 desktop app, then go to this cartridge and load it.
  2. After it starts, pause the cart with the ENTER key, then select "EXIT TO SPLORE" from the pause menu.
  3. Press ESC to go to the PICO-8 command line, then save the cart locally using "SAVE [CARTNAME]".
  4. Press ESC again to go to the code editor tab 0, and insert a new code line after line 7 and before line 8.
  5. Add 'RELOAD(0X3100,0X3100,0X1200,"[CARTNAME.P8]")' to the new line that was made from Step 4.
  6. Press ESC once again, then run the cart using the "RUN" command. Enjoy!

Note: Some carts may not be compatible with the steps provided above, such as Barp the Balldragon by Saffith, among others. These could unpack the SFX and music data from a different part of memory, or use a compression algorithm.

EDIT: Since support for loading external cartridges in the playlist have been added, the steps above don't work now.

P#63073 2019-03-27 21:53 ( Edited 2019-04-05 08:26)
:: Gruber

Very cool and mesmerizing to watch, especially Autumn Wind 'cause it's a slow SPD!

P#63287 2019-04-06 13:03

@Gruber Thank you! I really like how you managed to squeeze some good music into just two channels!

Also, have you ever bothered to create music on TIC-80 yet? If you don't know what it is, here's the website:
https://tic.computer

P#63288 2019-04-06 13:59
:: Gruber

@StinkerB06 - Yeah, I've heard of it. The dream is to make music and tutorials for all these fantasy consoles and trackers. Hopefully, eventually, I'll get to it ;)

P#63291 2019-04-06 14:43

[Please log in to post a comment]

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-04-23 23:01 | 0.029s | 4194k | Q:31