Jump to content
  • 0

Midi Editing - remove arbitrary amount of silence from start of midi file


plums

Question

I've started making midi music using a tracker that isn't really designed for it. The only way I've found to actually record midi files with it, in a way that doesn't mess up the timing too badly, is to record using a Linux tool that basically dumps all the incoming data into a midi file. This basically works, but there's no sync, so there's a bunch of silence at the start of the file that doesn't line up with a beat. Moving or quantizing the notes around in any midi editor I've tried doesn't move the CC data as well, so that doesn't work. What I want is a tool that can move the position of every midi event by a specific number of beats:tics all at once. Any ideas?

 

Example file, the timing is still slightly wonky and there are some notes that don't shut off properly, but ignore that:

https://user.fm/files/v2-56e651fe1acaea11add67e1684f6b27e/rt_test3a.mid

 

(Alternately, does any one want to write a midi file writer in my music software for me? :p)

Edited by plums

Share this post


Link to post

19 answers to this question

Recommended Posts

  • 0

I'll think you'll just have to edit the file with a MIDI sequencer, because the program you're using to save the MIDI is adding multiple issues.

There are way too many extraneous commands in the MIDI file.  They bloat the MIDI's size so excessively that they somehow cause the MIDI file to load slowly in the sequencer I use.  There are thousands and thousands of pointless volume commands in the file in the first channel alone.

 

Untitled.png.c9f29d13bfa343c6eca0feb482c6ee34.png

Share this post


Link to post
  • 0
15 minutes ago, TheUltimateDoomer666 said:

There are way too many extraneous commands in the MIDI file.  They bloat the MIDI's size so excessively that they somehow cause the MIDI file to load slowly in the sequencer I use.  There are thousands and thousands of pointless volume commands in the file in the first channel alone.

It's definitely bloated, but those volume commands aren't pointless -- they're volume envelopes mapped to the midi volume CC. I can and should optimize it somewhat, but that doesn't really help my main problem. (Despite the excessive amount of volume commands it plays back fine in any non-gui midi player I've tried, including Doom source ports.)

Share this post


Link to post
  • 0
2 hours ago, Dragonfly said:

Use Sekaiju! :)

Thanks but I'm really, really not interested in suggestions for other midi editors -- it's a road I've been down a few times before, and I've been trying out different midi software for the past 6 months alone. Piano rolls frustrate me to no end and any dedicated midi trackers I've tried lack basic functionality or won't work on Linux at all. Schismtracker gets me 95% of the way there, I just want something that can chop the silence off of the start.

 

edit: @Dragonfly Sorry, this was bit of an overreaction, I have just spent a lot of time with traditional Midi sequencers and I just find them extremely cumbersome to use. I still appreciate the effort to help.

 

Also, again, those aren't redundant events! :P Unless there's some other way of automating volume changes in midi that I'm not aware of. Schismtracker is perfectly capable of making basic midi files without CC events though.

 

(I do use Sekaiju for some basic midi editing stuff, just not composing.)

Edited by plums

Share this post


Link to post
  • 1
59 minutes ago, plums said:

Also, again, those aren't redundant events!

It looks like many of the other events are, though.

For example, there are squillions of pitch wheel events that constantly raise and lower the pitch of the channel by a slight amount.  If it's for (extremely fast) vibrato, then surely there must be a better way to do it, as not even the heaviest MIDIs I've seen need that many events that close together.

 

Spoiler

Untitled.png.b3fac64b9bd022428fed195082665fe2.png

 

There are so many here they form a solid black line:
 

Spoiler

Untitled.png.f8620a0c294eabcd1a7f6ab3e545707a.png

 

Edit:  I selected all the tracks in the MIDI sequencer and simply dragged them to the left with the mouse.  This removed the silence at the start of the file while keeping all notes and events in sync.  Since this is a very old MIDI sequencer, I'm sure modern MIDI sequencers would also have this function.

 

Untitled.png.ca68cfd2d503e5963af4c5272e0a8a06.png

Edited by TheUltimateDoomer666

Share this post


Link to post
  • 1
36 minutes ago, plums said:

Thanks but I'm really, really not interested in suggestions for other midi editors -- it's a road I've been down a few times before, and I've been trying out different midi software for the past 6 months alone. Piano rolls frustrate me to no end and any dedicated midi trackers I've tried lack basic functionality or won't work on Linux at all. Schismtracker gets me 95% of the way there, I just want something that can chop the silence off of the start.

 

Also, again, those aren't redundant events! :P Unless there's some other way of automating volume changes in midi that I'm not aware of. Schismtracker is perfectly capable of making basic midi files without CC events though.

 

(I do use Sekaiju for some basic midi editing stuff, just not composing.)

I know you don't want any suggestions, but in this case, i do have to remind you of ZTracker - A pure midi tracker. It isn't maintained anymore, but a follow up has been made - ZTracker Prime. There is source code and a Windows binary, but being SDL based, it may just compile fine for Linux too.

 

Share this post


Link to post
  • 0
18 hours ago, Redneckerz said:

I know you don't want any suggestions, but in this case, i do have to remind you of ZTracker - A pure midi tracker. It isn't maintained anymore, but a follow up has been made - ZTracker Prime. There is source code and a Windows binary, but being SDL based, it may just compile fine for Linux too.

 

Heyyy, now that is definitely relevant to my interests. I've used ZTracker before but had no idea about ZTracker Prime. or that people were still doing things with it. I'm really not sure how I missed all of this -- my quest to find a midi composer that would work for me actually started with seeing how much work it would be to port ZTracker to Linux. The answer was "too much for me," but maybe ZT' will be workable.

 

ZTracker had a bunch of minor issues that made it a little frustrating to write general midi files with, but it looks like at least some of those have been fixed in ZT'.

 

Hahaha, there's even recent-ish involvement in ZTracker/ports by Esa Ruoho, of course there is. (Esa, AKA Distance/Lackluster, is a longtime Impulse Tracker and Schism Tracker user, quite well known back in the days of music trackers/demoscene/etc., and a frequent poster on the Schismtracker boards when they existed. I'm not laughing at Esa, he's great, I'm laughing because this shouldn't have been so far off of my radar.)

 

Thanks, I was definitely not expecting this! Even if it doesn't work out, I'm glad you didn't listen to me when I said I wasn't interested in software suggestions, haha.

Edited by plums

Share this post


Link to post
  • 0
22 minutes ago, TheUltimateDoomer666 said:

It looks like many of them are, though.

Ah, you're right about it being full of redundant pitch bends. I've been hacking at the source code a little and I thought I'd fixed that but I guess not, thanks for the heads-up there.

Share this post


Link to post
  • 0
1 hour ago, plums said:

Unless there's some other way of automating volume changes in midi that I'm not aware of.

Aside from velocity (which only affects how hard an entire note is played), there are only volume/expression controls as far as I know.

I see that the huge number of volume events are for adding envelopes to every note.  That actually helps MIDI to sound a lot more realistic/expressive and dynamic.  Most other MIDI composers I've seen do not seem to bother with that, presumably because of the extra time needed to add those events, and also because of the rapid increase in file size.

Share this post


Link to post
  • 0
51 minutes ago, plums said:

Heyyy, now that is definitely relevant to my interests. I've used ZTracker before but had no idea about ZTracker Prime. or that people were still doing things with it. I'm really not sure how I missed all of this -- my quest to find a midi composer that would work for me actually started with seeing how much work it would be to port ZTracker to Linux. The answer was "too much for me," but maybe ZT' will be workable.

 

ZTracker had a bunch of minor issues that made it a little frustrating to write general midi files with, but it looks like at least some of those have been fixed in ZT'.

 

Hahaha, there's even recent-ish involvement in ZTracker/ports by Esa Ruoho, of course there is. (Esa, AKA Distance/Lackluster, is a longtime Impulse Tracker and Schism Tracker user, quite well known back in the days of music trackers/demoscene/etc., and a frequent poster on the Schismtracker boards when they existed.)

 

Thanks, I was definitely not expecting this! Even if it doesn't work out, I'm glad you didn't listen to me when I said I wasn't interested in software suggestions, haha.

You know, the things that bring a smile upon my face are reactions like this. I am glad it was a useful comment!

 

And as you mention, there is a Esa Ruoho port of ZTracker for Mac, found here.

Another Midi tracker with an Impulse Tracker interface is Shake (And it has a Linux build)

 

Its just that you mentioned ZTracker at all that i thought: ''It might be a one-off, but does he know of ZTracker Prime?''

 

I know several more unusual midi progs, but ill listen to your warning now :)  - If you need more trackers, there is Trackerbase. (Links to Trackers that have a Linux build)

Edited by Redneckerz

Share this post


Link to post
  • 0
17 minutes ago, Redneckerz said:

I know several more unusual midi progs, but ill listen to your warning now :) 

If they don't use a piano roll, feel free to suggest some more. Things also don't need a Linux build if they work in Wine (which ZTrackerPrime does, though I can't figure out how to unzoom it to properly fit my laptop screen).

 

Modplug tracker/OpenMPT actually has a decent midi export function, but it doesn't support many tracker features like envelopes/most pattern effects/etc., so that's kind of my baseline for program functionality. IIRC Skale's midi output is even more basic but I haven't tried it in ages so it's worth another look. It was always kind of a buggy program though. Schismtracker translates almost all of its effects into midi CC params, which is hugely useful IMO, though it's kind of hacky, and also results in some pretty bloated files as the other replies here have pointed out.

Edited by plums

Share this post


Link to post
  • 0
1 hour ago, TheUltimateDoomer666 said:

Edit:  I selected all the tracks in the MIDI sequencer and simply dragged them to the left with the mouse.  This removed the silence at the start of the file while keeping all notes and events in sync.  Since this is a very old MIDI sequencer, I'm sure modern MIDI sequencers would also have this function.

I just caught this edit now -- which program are you using? I really have tried this in several other midi sequencers and none of them dragged the CC events. It's possible I've been doing something wrong, but either way I haven't had any luck so far.

Share this post


Link to post
  • 0
33 minutes ago, plums said:

which program are you using?

Cakewalk Pro Audio 9.03.  I don't know if it is still available online.  Previous versions might be available, but they contain more bugs than 9.03.

Edited by TheUltimateDoomer666

Share this post


Link to post
  • 0
53 minutes ago, plums said:

If they don't use a piano roll, feel free to suggest some more. Things also don't need a Linux build if they work in Wine (which ZTrackerPrime does, though I can't figure out how to unzoom it to properly fit my laptop screen).

 

Modplug tracker/OpenMPT actually has a decent midi export function, but it doesn't support many tracker features like envelopes/most pattern effects/etc., so that's kind of my baseline for program functionality. IIRC Skale's midi output is even more basic but I haven't tried it in ages so it's worth another look. It was always kind of a buggy program though. Schismtracker translates almost all of its effects into midi CC params, which is hugely useful IMO, though it's kind of hacky, and also results in some pretty bloated files as the other replies here have pointed out.

Sorry, i originally wrote Skale, but i wanted to say Shake - Link has been changed. Shake is a fully midi-only tracker.

Trackerbase has a lot of them as linked, but admittely - Midi trackers often were also sample based, and there are very few midi-only ones.

  • Bosca Ceoil looks pretty fucking amazing but that sadly has a piano roll.
  • Synergy might be something for you?
Edited by Redneckerz

Share this post


Link to post
  • 0

So I figured out an answer to my original problem with Sekaiju: you can select all, and move it with Edit->Modify Event's Time, which will actually move everything instead of just the notes as when dragging. I had to do it in a few steps, first for beats and then frames, but that's fine.

Share this post


Link to post
  • 0
13 hours ago, TheUltimateDoomer666 said:

Aside from velocity (which only affects how hard an entire note is played), there are only volume/expression controls as far as I know.

I see that the huge number of volume events are for adding envelopes to every note.  That actually helps MIDI to sound a lot more realistic/expressive and dynamic.  Most other MIDI composers I've seen do not seem to bother with that, presumably because of the extra time needed to add those events, and also because of the rapid increase in file size.

 

Every MIDI note already includes a Velocity value to describe the loudness of the note. Adding Volume is just redundant.

 

I think the ultimate takeaway here is that OP is making MIDIs with a program that just plain isn't meant for making MIDIs - and s/he's not likely to find a proper MIDI sequencing program without a Piano Roll, because Piano Rolls are what MIDI composers use and it would be stupid for such an application not to have one. That's like saying, "I'd really like an Operating System but only if it doesn't have a way to read files."

Share this post


Link to post
  • 0
3 minutes ago, Bucket said:

Adding Volume is just redundant.

In this case, plums is adding volume events to add volume envelopes to every note.  It's similar to what Bobby Prince did with the choir in "Sign of Evil"/E1M8:

1525806353_e1m8choirvolume.png.9da656ec219381431a6fb0d81414e27a.png

Share this post


Link to post
  • 0

Hmm, I see.

Even so, you could cut those events down by 4/5ths and still have the desired effect. You probably aren't going to notice an instrument going from 50 to 55 volume instead of 50-51-52-53-54-55.

Share this post


Link to post
  • 0
3 hours ago, Bucket said:

I think the ultimate takeaway here is that OP is making MIDIs with a program that just plain isn't meant for making MIDIs - and s/he's not likely to find a proper MIDI sequencing program without a Piano Roll, because Piano Rolls are what MIDI composers use and it would be stupid for such an application not to have one. That's like saying, "I'd really like an Operating System but only if it doesn't have a way to read files." 

Keep your piano roll-centrism out of here! ;p

 

A better analogy would be "I'd like an operating system that lets you interact with files without using a mouse." @Redneckerz has already posted a few good ones with a tracker interface -- ZTrackerPrime is quite nice (as long as you have a large enough monitor since the zoom level seems fixed :/ ). If you're used to a piano roll it probably looks like a spreadsheet, but to someone like me who is used to a tracker interface, trying to compose with a piano roll feels like trying to paint by dipping the brush in paint and then throwing it across the room at the canvas over and over again. Apart from that there are also numerous midi programming languages and textual notations that will render to midi, as well as more abstract interfaces in both software and hardware.

 

Schismtracker, the program I'm using, is something I've used a lot for non-midi music, and it gives you a lot of control over midi stuff through CCs that is quite hard to do with a standard piano roll interface, like easily putting volume envelopes on any note. The big problem in using it for midi is simply that no one ever made a proper "export to midi file" feature for it, and while I can fiddle with the code to an extent, I'm not really a programmer, so implementing that would probably take me months if not years. So until that happens, I have to work around it.

 

The second problem, and unfortunately the one that people have fixated on, is that having such control produces vastly more midi events than a typical midi composition tool. Some of this is inevitable without giving up that control, and some of it is from Schismtracker not caring about making midi output bloated, and then some of it is from me posting an unoptimized midi because that wasn't the problem I was trying to solve :/ (But I did learn about some things that it's still doing like the incessant pitch bend signals, so it's all good.)

Edited by plums

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...