Creating a MIDI-file that would be compatible with Cubase

Hi all,

I've been trying to create a csound script that lets me create a MIDI-file from score events. Here's the simple code I've come up with so far:

<CsoundSynthesizer>
<CsOptions>
--midioutfile=test.mid
</CsOptions>
<CsInstruments>

sr = 44100
kr = 4410
ksmps = 10
nchnls = 2

instr 1; MIDIwriter
ichn = 1
inum = p4
ivel = p5
idur = p3
noteondur2 ichn, inum, ivel, idur
endin

</CsInstruments>
<CsScore>
i1 0 1 60 80
i1 2 1 62 80
</CsScore>
</CsoundSynthesizer>

This successfully creates a MIDI-file containing the two notes. But while I am able to open the file in WMP and play it using the basic Windows synth, Cubase (ver. 4.5.2 b.274) seems unwilling to let me import the file. Whenever I try to drag the file to my project window or import it through the "import MIDI" dialog nothing happens. I suspect this is because the file is missing some vital information that Cubase needs, however I don't know what or how to correct this.

Does anyone know how to create MIDI-files that would be compatible with Cubase? If you've succeeded in making MIDI-files that work with another DAW, then that could be helpful too.

My guess...

I don't have CuBase, so this is just a guess, but looking at the midifile produced, it uses a rather uncommon timebase ("division") setting. Trying it with some of the older programs I have around (including one I wrote!), they get confused in various ways. In particular,the sequencer I sometimes use (not on Windows) plays the file correctly, but refuses to show both the notes!

The division generated by Csound is of the type allowed by the SMF standard that specifies an absolute time -- ticks per second, rather than 'ticks per quarter-note' --, and is a negative 16-bit value (which needs to be read as separate bytes rather than a single number). So my guess is that CuBase doesn't like this.

As to what to do about it, I don't know. I can't see any way of telling Csound what division to use; it appears to be fixed (at 3000 ticks/sec). Maybe there's some conversion program around that will rewrite the file with a normal ticks/beat and tempo combination.

It does indeed appear to be

It does indeed appear to be a problem with the timebase. I tried opening the MIDI-file in some different sequencers, and while none were able to convert my file to a working copy, one of them was at least able to produce an error regarding the timebase.

Since I don't know how to fix this, I've decided to approach my script from a different angle, bypassing the MIDI problem altogether. Thanks for having a look at it, though!

z-pak viagra online z pack zpak generic cialis pharmacy uk zpack viagra uk z pak buy viagra uk cialis online avanafil buy zithromax z-pack Canadian pharmacy viagra ed drugs Canadian pharmacy ed pills generic viagra kamagra uk staxyn cheap generic viagra cialis uk