? Litterbox - MML Tracker ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password
OSP Contest!

Litterbox - MML Tracker

Submitted
Updated
Author
glennxserge
Public Key
NDKJR3X3
Min. Compat.
All
Size
1MB
Rating
26 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
70 Comment(s) miwa miwa Disguised Hidden Website 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 Nice work on the sprites, layout and overall modern style. It seems like a program that might be found in the eShop. NoDot_wav NoDot_wav I absolutely agree. How do we get Nintendo to adopt this astounding software? I have the KORG DSN-12 synth/sequence program. This actually measures up to some degree and even surpasses at points. This isn't such a rigid structured feel as other sequencing programs. It allows me the freedom to put the music down how I hear it, and is so clean looking. Spectacular work, glennxserge. miwa miwa Disguised Hidden Website 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 If there's one thing I dislike, it might be the size of icons ... DizzyDude DizzyDude Video Games I like to play video games! Hobbies Night Person I like the quiet night and sleep late. Express Yourself Pokemon Is Awesome! I love Pokemon! Express Yourself kewl thatguy thatguy Does anybody else have the problem that they cant scroll to the right? I am on the old 3ds, please fix it. glennxserge glennxserge How many measures are in your active pattern? The default is 2, which coincidentally, fit exactly in the screen without the need to scroll. If you've lengthened the pattern and still can't scroll this is a bug. thatguy thatguy O thanks it decided to work now and can you export mml to other programs in smilebasic and run it, if so how? glennxserge glennxserge Yeah, if you export to MML, it's just a string of characters in a file. So you can just do this from another program to play it (as long as the mml file is in that project folder): VAR SONG$ = LOAD( "TXT:YOUR_SONG.mml", 0 ) BGMPLAY SONG$ Let me know if you have any other issues. thatguy thatguy Thank you! for taking the time to help me. ahavasandwich ahavasandwich Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Pokemon Is Awesome! I love Pokemon! Express Yourself Minecraft Is Awesome! I love Minecraft! Express Yourself Good program. Saves time. Anyways...there is a problem with one song I converted to mml. The right hand consists of nothing but triplets and left is just regular notes. I only copied nine measures of the song, and they sound good for a while. However, after a few loops things start to get out of sync. The tempos are the same for both line, so that's not it. glennxserge glennxserge That's odd. Is there a simple way I can try recreating your scenario? Or if you want to upload just the SNG file and PM me the key, I'd be happy to look. ahavasandwich ahavasandwich Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Pokemon Is Awesome! I love Pokemon! Express Yourself Minecraft Is Awesome! I love Minecraft! Express Yourself Sent it your way. Thanks. 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, first let me say that your program is really good. I can port music from synthesia without problem because they look similar. Can you add the hidden instrument?. I mean the ones that appear between [256,410]. I have them in my MML editor and trying to edit your program to use them on my O3ds. However, it would be useful if the other user could use those instrument on the next version. glennxserge glennxserge Hey, raimondz. Sure I can add those. I honestly didn't even think to include the SFX samples, but some of those are pretty nice. I've been taking a break from the project, but this shouldn't require much work, and I need to get my motivation back for 2.0. I'll post when I have this done. EDIT: Also, I've never heard of Synthesia, is it another MML editor? snail_ snail_ Helper Received for being very helpful around SmileBASIC Source Achievements 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 The mml instruments actually go up to 511 (512?) but there's a lot of blanks. I don't remember if there's anything that high up. 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 Synthesia is a program for PC(Windows or Mac) to learn to play piano. It can load Midi files and display the songs in a similar way to guitar hero. It also show the tempo and the length of the notes. PS: I found a bug that occur when you delete a pattern and then create a new at the end. For example. Patterns:(1-2-3) Delete 3 and create a new one(1-2-4) When I play all the patterns, it use (1-2-3) instead of (1-2-4). I solved it by changing the line 2410: Before: PRG1_2_PATTERN L AFTER: PRG1_2_PATTERN PLIST[L] glennxserge glennxserge Thanks for reporting that. Bug feedback is super helpful. I'll take a look when I get back home. I finished adding the other instruments you requested, and it gave me an opportunity to add tabs to the instrument gui for organizationand because I'll likely add specialized custom fm synth stuff later. I'm on vacation at the moment, and closing on a house in the next week so I haven't had a chance to upload. Given the bug you found, I'll wait until I have time to sort that before I post. glennxserge glennxserge Quick amendment to V 1.03 - that fixes a playback issue with longer patterns. glennxserge glennxserge Version 1.03 - No more flicker at all on O3DS! See version changelog in the program description for all the details. As this includes very big changes to the way the rendering process happens, and while I feel like I tested it well, please report any bugs you encounter and I'll make sure to fix them. Thanks for your patience, this update was a long time coming. Aside from fixing reported bugs, I'm going to put this project down for a while, so I can focus on other things. I have a feature list for 2.0 that I want to tackle, but I need a break. In case you are curious, here are some features at the top of my list:
  1. Song sharing - send song/mml files to others, directly from Litterbox.
  2. Custom instrument creation - users can add pre-built modules representing various types of synth waveforms and stack them together using mathematical operations. Will also support recording from the mic so you can make your cat sound like a robot.
  3. Copy and paste groups of notes
Suggestions are welcome too!
glennxserge glennxserge Just a quick update, I got my hands on a O3DS with SmileBASIC, so I can much better test and optimize. I've already fixed the upper screen during playback so it doesn't flicker, and I'll be doing the same for the bottom screen as well. It means refactoring a bit of the rendering code so it won't get done overnight, but stay tuned in the next couple of weeks for an update that levels the playing field for 03DS users. NateDogg1232 NateDogg1232 Night Person I like the quiet night and sleep late. Express Yourself Avatar Embargo I didn't change my avatar for 90 days Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength This is good, because it's very hard to use the other one, as there is lag between the graphics and the actual song, whilst playing. glennxserge glennxserge Yeah, this is the first time I've gotten to see my program on the older model, and it's an epileptic nightmare in playback. snail_ snail_ Helper Received for being very helpful around SmileBASIC Source Achievements 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 Good to hear! Hopefully you can get the UI factored into something that sitting. glennxserge glennxserge New update is available: V 1.02 (This list is included in the program description, but this one is more detailed for those interested) Features and bug fixes: Some cosmetic fixes to interface: pattern editor text positioning, keyboard sprite now fades when touched, instrument selection now highlights properly past the standard instruments Fixed pattern bug: subscript error when not all pattern numbers are used, this was an error in calculating the frames in each pattern for the playback timer. Now if patterns aren't used they contribute 0 frames, but are indexed properly. Fixed note hopping near end of measures: increased the maximum note position by 16 times. Optimizing note position bit field to sqeeze out some extra storage, went from 8->12 bits. Time signature limited to practical values, in conjunction with expanded measure amount (from 8 -> 20 measures). To prevent note position overflow (the above bug), I've calculated the maximum number of measures + time signature and set that as the limit. Added Custom 1 instrument, so default can be used as an instrument. This is just the default sound that is already loaded in that slot, but in the future I'll make customizing it possible. 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. Loop points affect both playback and MML export. So you could use this to design a one time intro. Pattern playback timer is now much more accurate, fixed a precision rounding error. To be precise, the timer was calculated in seconds with float precision, but it resulted in rounding errors, so I calculate the timer in frames instead, which gives almost perfect accuracy. 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. Previously, this was very buggy and the note editor and the song would get out of sync. Now you can start song playback at any pattern. Bug fixed in MML generation relating to notes outside pattern measure range. This is in the case that a pattern has been resized, by lowering the measure amount. If notes are outside the new measure range, they don't get deleted, but they also no longer get factored into MML generation. General maintenance and cleanup: code cleanup, tidyness, etc., not that interesting. 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 Video Games I like to play video games! Hobbies Okay, I just found a new, really bad bug. When you raise the amount of measures (in my case four) and try to then move a note placed in a measure after the second horizontally with the d-pad, it just moves backwards, a lot spaces, no matter which direction you press. This is really messing things up making it a pain to edit notes after the second measure. Edit: Oh wait, I just noticed unclesporky already mentioned this, sorry. :/ glennxserge glennxserge Yes, this was an issue with how many positions I could store in a 8 bit field, however, I've done some extra bit squeezing here and there, and managed to expand that by 16 times. Hurrah! I'll be releasing my next update later today that addresses this issue, as well as placing some reasonable limitations on measure amount in conjunction with time signature. You'll still be able to have about 20 measures in a single pattern, but it'll prevent the note position rollover that currently happens. That and I've fixed the serious pattern bug that ElzoBro found, as well as added some features. Stay tuned! ElzoBro ElzoBro First Day Joined on the very first day of SmileBASIC Source Website Video Games I like to play video games! Hobbies Drawing I like to draw! Hobbies When you make a new pattern then delete it and make another new one it keeps going up and it doesnt go back down. The problem is that when you press the play Song thing it does an out of range error. Please fix. glennxserge glennxserge The new pattern always increments to a new value as any of the preceding ones, even if deleted, could have values in them. If you want to use a previous pattern number, up or down on the dpad will change the number of the selected pattern. Edit: found the bug, fixing this now The out of range error is unexpected though. I'll make sure to fix that. Unclesporky Unclesporky More bugs: - I hit B a lot on one note, just playing around with portamento, but I can't select and delete those split up notes any more. Tapping on that space instead creates a new note, very short, rather than selecting the existing notes. I noticed that normally when you split up a note and delete part of it, it automatically selects another part of that split up note so you can delete the rest. After some messing around, I think they become permanent after you've done one playback. - Very weird things can happen when you select notes and press right. If you are further along in the pattern, they will warp backwards, with the backwards movement more extreme the further you are into the pattern. - After saving a new song, I was unable to reload that same song I had just saved. I had to exit out of the program and go back in, and then the song appeared in the load list. Also, could there be a button to exit and go back to the main menu? - This isn't a bug, but is there really no way to choose a volume and have all notes placed after that point take on that volume? I have to adjust the volume of every note individually? - Sorry to make more requests, but MUSEQ also has a series of instruments at the bottom of its second page that are all the same, 224 to 255. I assume these are custom instruments that haven't been customized. However, even in their uncustomized state they have a cool sound to them. Could we get one of these as an option too, even if actual customization isn't in yet? 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 Video Games I like to play video games! Hobbies I noticed the same issue with selecting the smaller notes, however you can still select them by selecting the previous note and then pressing A to select the next note. glennxserge glennxserge Thanks Unclesporky, you're providing me a huge service by testing so thoroughly. No need to apologize, I'm happy to add the extra instruments, I just figured I'd wait until I understood how to do the custom instruments, but if they are immediately useful in their default state, then I'll add them in my next update. The volume can be set on the first note in a channel and the rest of the pattern/song should maintain that volume (for the channel) until it's changed. Are you finding that not to be the case? The volume controls are in one of the fx modes, just to the left of the note button on the top row. You can visually tell when an effect has been applied to a note because a blue or orange dot will show up above or below it. The song saving/loading issue when it's first made, is something I'm aware of, the file list just needs to be refreshed. This one will be easy to fix. The note zooming left issue is a bit weird, I see it now under the same circumstances you mentioned, so I'll try to figure out why that's not behaving properly. Portamento's shouldn't be able to continually be made if further subdivisions can't be visually represented, and notes in the same channel aren't supposed to occupy the same space. So I'll double check that as well. Thanks again Unclesporky, this is hugely helpful info. EDIT: oh and mystman12, if you hold L/R and press A it will select the previous note from your current selection too. Unclesporky Unclesporky It looks like volume is preserved after setting it once earlier in the song. I was confused because placing new notes plays them at full volume, so I thought they were being set at full volume, but in playback they are correct. Mystman12 is right that you can press A to get to those portamento notes and still be able to delete them, but it still doesn't behave quite like I would expect, you can't tap to select them. Not sure of a better way to handle them though. glennxserge glennxserge Oh, sorry, just a correction on my terminology, I've been referring to triplets as portamentos. What I meant to say is that creating triplets from a note that isn't long enough doesn't work. As far as selecting a note goes, if a note is very small, the default grid snap value (the button with the magnet), probably can't select it. The grid snap is by default set to an eighth note (16 pixels). If you create a note when you are trying to select one, it's probably because the grid snap is trying to snap it to the nearest grid point. I'll think a bit more about how I want this to behave, and whether this is the right choice. glennxserge glennxserge Update is live. This addresses the sprite bugs Unclesporky and mystman12 discovered. I also added the additional hidden instruments 144-151 and fixed the timer so that it can keep track even when VSYNCs are missed during playback. I still have more to do, but this should get rid of the problematic errors. Please let me know if you see anything else. I think I can make this even more stable at 30FPS, but I'm wondering what people think about lowering the frame rate. pirate pirate First Week Joined in the very first week of SmileBASIC Source Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Should have called it Flickerbox am i rite Unclesporky Unclesporky I just crashed on ASDR too, the very first time I was messing with it. I was dragging in all directions after tapping the various elements and IIRC it crashed while dragging. The error is "Out of range in 0:2187(SPSET:1)" One request I would like to make it to be able to use the "hidden" instruments past the drum sets, like we can in NCF-MUSEQ. I just want access to that hollow flute square wave and raw noise. :) 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 Video Games I like to play video games! Hobbies Yep, that's the error I was getting. I'd actually like to have those instruments, too, and even the ability to load custom instruments into the editor. That would be really handy! glennxserge glennxserge Ahh, that bug is related to my sprite optimizations. I know how to fix it. The hidden instruments I didn't even know about, but I will be sure to add them too. EDIT:The custom instruments is on my list of extra features. I just need to think more about how to bundle them with the MML export so they are not troublesome to deal with. 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 Video Games I like to play video games! Hobbies 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 Drawing I like to draw! Hobbies 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 Drawing I like to draw! Hobbies 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 Drawing I like to draw! Hobbies 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
1 2