[ back to Tom 7 Radar ]

p
e
r
s
o
n
a
l
I'm not an IDIOT who needs COLOR CHEAT CODES (31 Dec 2015 at 21:28)
Well, here we are at the end of 2015. December was a bunch of travel (14 segments!) and relaxing for me, neither of which make good stories.

The show in New York that I wrote about in post 1126 was awesome. I had some last minute trouble with the electronics after a wire broke (it was hook-up wire, not good for repeated stress). Though I have no recollection of it, I'm certain that at some point when I was assembling that USB laser hat 7 years ago, I momentarily considered, should I really use black wire to denote POSITIVE, just because it's handy? And then thought, sure, it's not like I'm going to FORGET that I made that switch. I'm not an IDIOT who needs COLOR CHEAT CODES. So imagine my chagrin when in 2015 I foolishly soldered the positive and negative leads together and then spent minutes trying to connect to the thing over USB while it was just cooking. But I didn't fry it, and got the software up to modern OS X standards, fit it all in my luggage MacGyver style and got through airport security just fine, and even managed to get the drums there too. The show was super fun! A bunch of people I hadn't seen in ages but who happened to be in NY (or make the trek) surprised me by showing up, and I think I played my weird video game music to about 70 people. Definitely one neat thing about New York is how many people you can find that actually care about some obscure thing like that. I also really enjoyed seeing the other bands rock it live. There are a few videos of my section, and to show my gratitude I also made T7ES-heroifications of songs by Kleenex Girl Wonder and Saskrotch both, all of which I'll try to convert into a reasonable format and post here. But as you know it's New Year's Eve and that means the tradition of Drinking begins imminently!

Also: People have been rediscovering my Alphabetical Star Wars recently due to the new movie. Just tonight I was alerted to this tribute called ACEPS ABLLS which is the same idea applied to the even more hallowed Space Balls. This one is different because it was done automatically, using some new transcription alignment software which seems pretty cool. (It definitely has mistakes in it, but the accuracy is pretty impressive! It even hilariously catches some words in the singing in the closing credits.) So all of you who were asking for alternative supercuts with the ARST ARSW data can now create this on your own without too much tedium.
c
o
m
m
e
n
t
Adhesion (c-73-238-153-49.hsd1.ma.comcast.net) – 01.10.16 16:59:29
The show was awesome!! Everyone killed it. So glad I made the trip. I'd love to hear those covers again too, or even have the proper T7ES Hero files!

On that note I've been trying to get it building on Windows again. (I've done it on Linux before with no problems but Windows is a bit more convenient for me at the moment.) Hoo boy... MinGW et al continue to be an absolute nightmare. For the life of me I can't figure out how to get mlton (via make) to work in any terminal, they all spit out syntax errors as if it can't run the .bat file properly. Not sure if this is an issue with make or what, as running mlton.bat on its own works in the windows terminal as well as git bash (but not msys). Any tips? Alternately - having a provided windows binary for the game would also be awesome :P
c
o
m
m
e
n
t
Adhesion (c-73-238-153-49.hsd1.ma.comcast.net) – 01.18.16 17:47:29
Holy crap I got it to work!! Turns out the plain old mlton binary works fine from make if you're in mlton's msys terminal. Some other notes:

- Had to edit the makefile a bunch to specify some binary (mlton & gcc) and include & lib paths (SDL)
-- Also had to reinstall mlton to a different path, since I initially installed it in the usual program files dir like a normal human being, and make/gcc apparently cannot deal with spaces in -I paths even if escaped or quoted. Sigh.
- mingw.txt is a massive red herring, HACKING is king.
-- Accordingly latency seemed fine without explicitly setting directsound support
- Secret dependencies! sdlml & sml-lib
-- I got really confused when trying to get my SDL paths working. Went down some serious rabbit holes thinking I had to put stuff in /usr/local, also I tried to get sdlml to build on its own without realizing that the t7eshero makefile basically does it itself
- Got confused again with how the input config menu only pays attention to whatever was used first in the main menu. Honestly I think it should accept input from any device.

Anyway it was only an hour or two, so not too bad considering the horrific state of building anything in the terminal on Windows. Now to try and hack some of my songs into it!
c
o
m
m
e
n
t
Adhesion (c-73-238-153-49.hsd1.ma.comcast.net) – 01.19.16 20:52:37
Almost there! (sorry for the spam but the process of figuring this out is really fun for some reason!) Had to figure out a weird MIDI workflow since Ableton Live apparently can't export full MIDI files (?!) but I made a proper MIDI of one of my songs and after some cleanup got it to play. The tempo is totally wrong though... reminds me of ages-old issues I used to have with midimml. In MIDI is the tempo supposed to be an event on the control (0th) track? I assume it's relative to the PPQN/resolution somehow... I'm exporting with default PPQN of 480 but I'm not sure if I have any other options in my DAW re: tempo in an exported MIDI. I've been combing through the genscore & sml-lib midi source a bit but since I'm not too familiar with Standard ML I haven't made a whole lot of progress yet.

Side note: midi.sml doesn't recognize aftertouch as a valid MIDI event/status byte so I had to scrub my file of all such data. IMO it should just spit out a warning & continue for known-to-MIDI-spec-but-unsupported events rather than bailing with an exception.
c
o
m
m
e
n
t
Tom 7 (pool-74-98-230-110.pitbpa.fios.verizon.net) – 01.19.16 21:49:31
Wow, sorry you had to go through all this; it's annoying even for me to try to compile it so I can only imagine!

The tempo problem is something that happened to me when trying to output songs for this last round, too. I think that there is a time division (maybe this is the same as ppqn) somewhere in the file that I am not handling properly in t7eshero. I think that I was able to get Sonar to make files it could use by changing the time division to 120. I'm not sure I ever even implemented tempo in t7eshero, rather, I translate midi ticks straight to an integer number of milliseconds. There's an int in songs.hero that sets this. You may just be able to turn up/down the tempo there.

BTW, in case it's not clear, you need to set track names like "+W" (saw) "+Q" (square) and so on in order to assign instruments; MIDI instruments are ignored. For genscore, you give it the set of tracks that it should generate the guitar tablature from. Most of the time I manually curate which tracks are active at a given time to get a playable score. Good luck! :)

What is the exception that midi.sml raises? I implemented this against some old documentation (I believe the "Sound Blaster Book") in college, so I'm sure it's not complete!!
c
o
m
m
e
n
t
Adhesion (c-73-238-153-49.hsd1.ma.comcast.net) – 01.19.16 22:52:58
No worries! As far as less-documented open source projects go, this one was relatively straightforward :P (aside from the usual windows terminal stuff, which is always awful regardless)

In other news.... victory is mine!!! http://i.imgur.com/BZFhMJ5.png
120 PPQN worked just fine and got me to a reasonable tempo.
So are the |5|-1|-1| etc lines in songs.hero for the tick multiplier? What with all your timesig changes I'm a bit surprised you don't support tempo changes too :P

I did manage to figure out the + notation for tracks - that one was actually documented! :D Looks like there are undocumented R and D track types available too, what are those?
Also, is there a limit to how many tracks/voices the internal synth can do? I think some stuff was missing in playback but the song I was trying to use is pretty dense note-wise.

The MIDI exception is just "raise MIDI "unknown status byte"" at line ~328 of midi.sml, looks like it's in a big switch statement that handles the major types of MIDI events.
c
o
m
m
e
n
t
Tom 7 (pool-74-98-230-110.pitbpa.fios.verizon.net) – 01.20.16 18:55:43
Nice! :) No accelerometer though??

Yeah, I actually don't do tempo changes in my music very much, I think I just got found the time division stuff very confusing and gave up on it. I'd like to support it, though. |5| is the tick multiplier, yes, and -1 and -1 are, I think "how much I like the song" and "how hard it is"? Not used anywhere, though.

Looks like "R" is RHODES (appears to be unimplemented) and D is drums (should work, though no promises it will sound good).

There is indeed a limit to the number of mix channels internally. You can probably just increase NMIX in sound.c and it will just work, though if it's large enough it'll start missing the sample deadlines (you'll hear it).

Some day I will put out a proper version of this game and will include some nonfree songs (e.g. the covers I did for that show), so if you make any songs that play particularly well, please contribute them. :) I vote "Spacious MiniMars"
c
o
m
m
e
n
t
Adhesion (c-73-238-153-49.hsd1.ma.comcast.net) – 01.20.16 21:59:45
Rock'n'roll is very serious business and requires complete stillness at all times. (Alternately I may not have configured the tilt thingy properly.)

I think you're pretty close to implementing the time division stuff properly actually. The time division (aka PPQN, parts per quarter note) is the number of ticks per quarter note, which you seem to be reading & interpreting correctly in genscore when figuring out measure lengths. If we want to correctly calculate ms per tick, we know tick/beat and tempo is just beat/min so it's just a matter of math to get there. For example: my song is at 127bpm. 127 beat/min * 120 tick/beat = 15240 tick/min, 1/15240 min/tick * 60000 ms/min = ~4 ms/tick. Setting my song to 4 in songs.hero sounds pretty damn close to me. (I think most programs use microsecond, or maybe sample, accuracy for doing this kind of thing.) Possible you might have to multiply or divide by 2 if the timesig is in terms of 8th notes, but my instinct is telling me that's not necessary - I think when most DAWs say "beats per minute" they really mean "quarter notes per minute" regardless of time signature.

As far as how the drum sounds are mapped to MIDI notes, is it just General MIDI-style?

Thanks, I'll take a look at sound.c. My song has a lot of doubled parts since the arrangement wasn't intended to be played like this so it could use some cleanup too. I also had some issues with some notes missing from the score but I haven't messed with the watermark option yet, so I'm wondering if that might be the issue.

I wouldn't mind if you slipped me some nonfree songs one way or another :P Also I was definitely planning on doing some Ludum Dare soundtrack songs, that's at the top of the list!
c
o
m
m
e
n
t
Adhesion (c-73-238-153-49.hsd1.ma.comcast.net) – 01.23.16 13:58:14
One more quick question: does MIDI track volume control in-game track volume, or does only velocity work for that?

Also I'm really tempted to bombard you with feature requests but I know I should just learn ML and implement them myself! Argh!
c
o
m
m
e
n
t
Tom 7 (pool-74-98-230-110.pitbpa.fios.verizon.net) – 01.23.16 15:02:40
Here you go: http://spacebar.org/songs-nonfree/ Not sure anything in there is good except for the two I played at the show.

For drums, I mapped some drum samples (from a SID emulator?) to the standard channel 10 midi mapping, but only really for the drums that I tend to use. There are terrible volume problems and so on. Works better if you compose the drum track for t7eshero specifically. I also did something for live drums where you could select the patch set, but I don't remember.

I think I only use velocity of NOTE_ON to control the volume.
p
o
s
t

a

c
o
m
m
e
n
t
Please enter the code, unless you are spammer!!
[ Tom 7 Radar  •  Tom 7 on Google+  •  on Twitter  •  on Facebook ]