[directmusic] Re: Tracks & segments in real time ?

  • From: Abhijit Patait <abhijit_patait@xxxxxxxxx>
  • To: directmusic@xxxxxxxxxxxxx
  • Date: Wed, 18 Dec 2002 17:06:01 -0800 (PST)

Hello List
I have a similar question. I want to write a sequencer application with custom 
sounds (that I wish to load via DLS collections). I have created classes for 
each of the notes that make up a track (this is a musical track, not the 
DirectMusic track object). I am saving each track as a sequence the notes into 
a file. My question is, how do I read, parse and play this track in 
"real-time"? As I read a single track as a sequence of notes (my custom note 
class), do I have to parse what each note is and play it individually? Or is 
there a simpler way of achieving all this?
I am very new to DirectX/DirectMusic world. I would really appreciate any help.
 Todor Fay <todor@xxxxxxxxxxxxx> wrote:

You can do it, but it's a little more work. Each track knows how to read
data in its file format. So, you parse the data into the file format,
and then feed it to the track. How? Each track exposes an IPersistStream
interface with a Load method. Map the track data into a memory buffer
and then create an IStream with Read and Seek methods. Pass it to the
track's Load and it will gobble up your data. I think there's an OS
function for creating an IStream that points to memory, but I can't
remember what it's called...

You might start with a really simple track type, like tempo or time
signature to test it out and work out the kinks. Then, attack the


-----Original Message-----
From: directmusic-bounce@xxxxxxxxxxxxx
[mailto:directmusic-bounce@xxxxxxxxxxxxx] On Behalf Of Ziggy
Sent: Wednesday, December 18, 2002 1:49 AM
To: directmusic@xxxxxxxxxxxxx
Subject: [directmusic] Tracks & segments in real time ?

Hello the list.
I'm new on directx, and i'm interested by directmusic cause I'm doing a
midi editor prog.
But after looking it I 'can't see how to pass custom midi message on
tracks and so on make segment for using effects features and the other
Tell me if I'm wrong , but the only way to pass datas on tracks and
segment is to load a file , a script or a resource. I need to pass
buffers that my sequencer generated. I can't see any exemples to do
this, Is it possible ?
Is it possible to create my Own "pattern" in real time and use it on a
track ?

For now I'v made my own pattern and track classes, and I'm using DX8
only for port and timer features.
The port give me Midimessage that a record on my pattern buffers , and
create tracks whithe it, next I pulse the messages directly to the out
ports, But I can't use segment and tracks features.....

Your help , tutorials and sample codes are welcome.

Thank you all

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Other related posts: