? Litterbox - MML Tracker ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password
What's going on?? See: Site Update March 2022

Litterbox - MML Tracker

Submitted
Updated
Author
glennxserge
Public Key
NDKJR3X3
Min. Compat.
All
Size
1MB
Rating
43 votes
Description A proper MML Tracker. Features include:
  1. Create and manage projects
  2. Restore project from last application state if program was terminated without saving (Start button is pushed)
  3. Pattern editor for organizing song parts
  4. Channel muting/isolation
  5. Instrument selection
  6. FX Editors for adjusting Volume,Pan,Detune,Gate, and Modulation
  7. ADSR Envelope for adjusting instrument amplitude
  8. Playback MML in realtime
  9. Export MML files
  10. And more to come!
As this is the V 1.00 release, it is functionally complete, but I do plan on updating to add additional tools, such as copying and pasting notes, and importing external MML data. Feedback is welcome, and if you find bugs or errors, please leave a comment detailing the issue. Happy composing! EDIT: V 1.03 Update - Fixed sort function for high note positions that set the signed bit, which compared negative and cause high values to get sorted below smaller ones. Results in starting note requiring lots of leading rests during playback or export. Old songs should be fine, it was just a playback issue. - Full optimization pass on rendering process to make this usable on the original 3DS - Better instructions for most modes - Fixed bug when creating notes outside measure, when the length is shorter than the standard grid size - Notes, during edit mode, now sound in accordance with the FX before them. For instance, if a note is selected, and the previous note had a pan effect, that note will playback in the editor with the pan effect. - Fixed various visual bugs relating to optimizations EDIT: V 1.02 Update - Some cosmetic fixes to interface - Fixed pattern bug: subscript error when not all pattern numbers are used - Fixed note hopping near end of measures: increased the maximum note position by 16 times. - Time signature limited to practical values, in conjunction with expanded measure amount (from 8 -> 20 measures) - Added Custom 1 instrument, so default can be used as an instrument - Added loop point in song, now you can specify where the song repeats to once it's reached the end. In the pattern editor the 'X' button will set the active pattern to be the loop point. - Pattern playback timer is now much more accurate, fixed a precision rounding error. - Pattern playback in song mode now plays from the pattern currently being edited, and will loop back to that pattern at the end unless a loop point has been set after it. - Bug fixed in MML generation relating to notes outside pattern measure range. - General maintenance and cleanup EDIT: V 1.01 Update Optimizations - removed excessive draw operations. Hopefully this results in better usability for original 3DS users. Fixed sprite bug in ASDR and FX modes. Added 'hidden' instruments - 144-151 Fixed timer during playback, so it is tied to MAINCNT
Instructions General instructions for each application mode are listed on the top screen for reference. Most inputs have a secondary behavior when the L or R shoulder buttons are held. Touch Input
  1. Touch anywhere in the note editor window to create or select notes
  2. Touch the colored pills on the left side of the screen to select a channel to author notes in. Holding L/R will open the instrument selection mode for that channel.
  3. Touch the 'M' symbol on the left side of the screen to mute that channel. Holding L/R will mute all other channels.
Face Buttons
  1. A (+L/R) - Select next (previous) note
  2. B (+L/R) - Convert note to triplet (Portamento: slide pitch)
  3. X (+L/R) - Play current pattern (song)
  4. Y (+L/R) - Delete note (channel, must hold L/R for at least half a second)
Directional Pad
  1. Dpad U (+L/R) - Move note up a semitone (octave)
  2. Dpad D (+L/R) - Move note down a semitone (octave)
  3. Dpad L (+L/R) - Move note backwards (shorten note)
  4. Dpad R (+L/R) - Move note forward (lengthen note)
Stick
  1. Stick U (+L/R) - Scroll editor view up (2x speed)
  2. Stick D (+L/R) - Scroll editor view down (2x speed)
  3. Stick L (+L/R) - Scroll editor view back (2x speed)
  4. Stick R (+L/R) - Scroll editor view forward (2x speed)
Categories
Keywords
  • MML
  • tracker
  • litterbox
  • music
  • audio
  • programs
  • tools
94 Comment(s) glennxserge glennxserge Update is now available. I've taken a quick pass at optimizing the draw functions (they only refresh when input is polled or states change). So this should look much better on the O3DS, or at least it will be functional for now. If you are a O3DS user, please let me know what your experience is like, so that I can make it better overall. This update is sort of a bandaid, as I think more can be done performance wise, but it should be functional now. Thanks for your patience. mystman12 mystman12 First Day Joined on the very first day of SmileBASIC Source Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Deep Sleep Hidden Website Thanks, this runs pretty well now! There's still a good amount of flickering whenever s change is made, but that can probably be fixed with the double buffering (or whatever it's called) that people have been talking about. It also seems to be running too slow during playback. (Song plays at proper speed, but the tracking bar and time are way too slow.) It also kept crashing while messing with the ASDR settings. (But the auto backup kept my project from being lost!) This will be really nice once it's fully optimized! glennxserge glennxserge hi mystman12, thanks for trying the new version out. It'll probably take a little back and forth to get this sorted, since I rely on feedback from 03DS users to identify issues. I expected that playback would still be slow, because it needs to draw every frame to update the timer and the progress bar, but I'm thinking of ways to optimize that as well. I might just disable playback on the bottom screen for older models so that the top screen timer still works correctly. The ASDR crash, is very unexpected, so I would be grateful for any line number or error feedback regarding what the context was when that happened. Thanks again! EDIT: Oh, and I meant to ask, is the flickering present in every mode or just the note editor? For example, does the splash screen flicker too? MZ952 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Third Year My account is over 3 years old Website Reading I like to read books! Hobbies The flickering only seems to be when you toggle things on the main editing screen. glennxserge glennxserge Thank you, MZ952, that helps me focus my efforts. MZ952 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Third Year My account is over 3 years old Website Reading I like to read books! Hobbies Make it so that it does not redraw the screen unless you offer input. That could at least minimize the flickering, plus its not really necessary to continuously redraw the screen when its not changing. Alright, so ive added this code to your code, and it works OK-ish. REPEAT TOUCH OUT TM,TX,TY UNTIL BUTTON() OR TM Ive placed it just before the Vsync. Ive also edited vsync, setting it to 5. I think theres a command which can recognize the 3ds hardware version, you could use this to optimize (if im correct about its existence). For those who want to optimize it themselves this way, go to line 872 and insert the code i wrote above the VSYNC command glennxserge glennxserge Thanks MZ952, that's the plan. I'm going to do draw optimizations tonight, and overall profiling to make sure there's nothing else creating a bottleneck. The VSYNC changes would work in most cases, except for when playback is happening, as it expects 60 FPS, but I could also fix this too. Now, I'm just wishing I didn't give my old 3ds to a friend so I could use it to test (>_<). EDIT: There is a system variable, HARDWARE, that specifies whether you are using an old or new 3DS but it's read only. This would be a nice feature to have though for debugging. MZ952 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Third Year My account is over 3 years old Website Reading I like to read books! Hobbies Wow. The screen flashes spasmatically. increasing the vsync seems to have little effect. You must be using a different hardware 3ds, i am using an older 3ds. blizord blizord Oh nice. Gale_Storm Gale_Storm Video Games I like to play video games! Hobbies Night Person I like the quiet night and sleep late. Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Very nice! This is just what I was looking for. Now I don't have to develop one for myself! Thank you! :D Lacks Lacks April Fool's 2017 Contest Participant I participated in the SmileBASIC Source April Fool's 2017 Contest! Programming Contest Deep Sleep Hidden Website Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Needs more cowbell! Can't wait to have an o3ds optimized version! This is going to be one handy tool! mystman12 mystman12 First Day Joined on the very first day of SmileBASIC Source Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Deep Sleep Hidden Website This looks sweet! I've been using NCF-Museq, but this looks like an improvement over that! Does it support portamento (_) or note connections (&) by chance? That's the main thing missing in NCF-Museq that I want to work with. mystman12 mystman12 First Day Joined on the very first day of SmileBASIC Source Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Deep Sleep Hidden Website Oh yeah, definitely not working on O3DS! It's flickering like crazy! snail_ snail_ Power User QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Helper Received for being very helpful around SmileBASIC Source Achievements Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Is it slow or just really flickery? Depends on how much optimizing he might need glennxserge glennxserge Mystman12, it supports '_' for portamento connections, and '&' for automatically tieing notes that cross beat boundaries answer answer Great Page Hidden Achievements Third Year My account is over 3 years old Website Deep Sleep Hidden Website Looks beautiful... MZ952 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Third Year My account is over 3 years old Website Reading I like to read books! Hobbies This looks well rounded! raimondz raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Hi, I tried to use it on my O3DS but it doesn't work well. You forgot to use gpage before and after rendering the gui to draw everything in one step. snail_ snail_ Power User QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Helper Received for being very helpful around SmileBASIC Source Achievements Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Oh it's unoptimized on O3DS? Darn, I'll have to wait and try this. This is one of the few SB programs I've actually been anticipating. It looks fantastic though! I was expecting something more like FastTracker II or Famitracker but this I think is more fitting for the nature of MML itself. Can you even call this a tracker? If you need any help optimizing it for O3DS I can get your back. glennxserge glennxserge Hi Raimondz, I've only used this on my N3DS, so I'm unaware of such problems. I'll look into the gpage issue, but I might need feedback from O3DS users. Thanks for pointing the issue out! snail_ snail_ Power User QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Helper Received for being very helpful around SmileBASIC Source Achievements Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Depends on how your code is written, but I could probably give you a gpage buffer in 5 minutes. It's very easy and lightweight and should remove the flicker. Making it run any faster is more of a challenge. glennxserge glennxserge Hi slackerSnail, if you can give me an example of where that's used, I'm sure I can patch it in quickly tonight. There are plenty of other areas I can optimize as well in how the interface is drawn, I just didn't realize it was a problem until now. Sorry to all the O3DS users (>_<) answer answer Great Page Hidden Achievements Third Year My account is over 3 years old Website Deep Sleep Hidden Website Basically here's the problem, you go into the application after making a project, and flicker galore; I can't do anything. :P I'll probably watch this page to see when this is fixed, because it looks impressive; oh boo us O3DS users snail_ snail_ Power User QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Helper Received for being very helpful around SmileBASIC Source Achievements Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements In essence, you use two GRP pages instead of one: one page is the drawing page and the other is the display page. These pages switch places at the end of every scene draw. The previous frame is on screen as you draw the next one, and then you switch their places. The drawing page always gets overwritten so you'll never have any old frames hanging around. This is analogous to page-flip double buffering in modern graphics like OpenGL and eliminates virtually all display artifacts if VSYNCed. While this won't fix any speed issues, you won't have any flickering. I would recommend you ALWAYS set up a buffer system like this, even if you're targeting n3ds. I couldn't exactly tell you how to put it in your code because I haven't seen it yet. But here's a simple example. 'init VAR BD%=0 'display page VAR BB%=2 'buffer page GPAGE BD%,BB% WHILE #TRUE VSYNC GCLS RND(16777216)+#BLACK 'fill screen with random color SWAP BD%,BB% 'swap pages GPAGE BD%,BB% WEND glennxserge glennxserge Thanks slackerSnail, that's crystal clear. I remember using double buffering (and quadbuffering for 3d displays) in other languages, so your explanation makes sense. However, the GPAGE command is a bit odd to me. It seems like it relates strictly to the graphics page. Are the BG and Sprite layers folded into the graphics page at that point? Or will I need to swap those individually as well? Right now I'm using all 6 pages (3 on top, 3 on bottom) for drawing the UI, however, both the BG and Sprite layers use the same tile set, so I could save a page by setting the BG and Sprites to the same one. The top screen I can optimize enough by only drawing it once at the beginning of a application state change as the information is static (outside of the timer during playback). Between those two things, I think I can cut down quite a bit of churn. The actual application data processing should be fairly inexpensive (just iterating over some arrays, and bitfield masking, etc..), but I'll run some timing tests to double check that I'm not wasting cycles there. Thanks again for your help. snail_ snail_ Power User QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Helper Received for being very helpful around SmileBASIC Source Achievements Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Do you do a lot of redrawing on the BG and sprite pages? I was under the impression that the flicker was just from redrawing a lot of GRP graphics on screen. EDIT: NOW that I run it, I notice you're redrawing pretty much everything per frame. That's not something you should do. Much of this UI could be either drawn only when you need to change it, or be sprites or BG layer objects. You may need to do a lot of rewrites to the way you do the GUI. glennxserge glennxserge Very little is drawn to the graphics page, just some text on the top screen, where the console print doesn't give the pixel precision placement I needed. On the bottom screen I draw a line timeline during playback, and I think that's about it. However, I am setting the BG and Sprites on every frame, and I plan on optimizing that with dirty flags that only draw when specific things change. snail_ snail_ Power User QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Helper Received for being very helpful around SmileBASIC Source Achievements Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Agh oops see my edit glennxserge glennxserge Yep, I cringe a bit now thinking that I didn't do this, but lesson learned about understanding how my programs will behave on various target devices, and not being lazy. glennxserge glennxserge "I was expecting something more like FastTracker II or Famitracker but this I think is more fitting for the nature of MML itself. Can you even call this a tracker?" I'm not actually sure what technically constitutes a tracker, but I grew up in the days of ModPlug Tracker, which has similar interface ideas, but I tried to tailor the program to fit the strengths of the 3ds. I'm not particularly attached to calling it a tracker though. jamieyello jamieyello First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Drawing I like to draw! Hobbies It even has an autosave feature? Neat Edit seriously though this is really amazing and polished glennxserge glennxserge Yeppers, when you boot up the program there is a restore button at the bottom if it finds a backup. The application stores all the needed persistent song data in the prg slots, so it survives program termination and can be retrieved later. EDIT: But to be clear, it's a fail-safe, it's a better idea to actually use the Save button in the application 1 2