Question about music

Started by Meowster, Sun 28/09/2003 19:36:36

Previous topic - Next topic

Meowster

I have this midi... it has a sort of starting theme for when you first enter the town, and then it goes into the tune that I want to loop. But I don't want it to loop from the BEGINNING, it you catch my drift, but from a few seconds INTO the midi.

I was wondering if there was a way to do this in AGS. I'm pretty sure there is but I can't figure it out. Also, is there any way you can add layers. Ah, again, I can't explain what I'm asking for. I mean like in MI2, where you walk to different areas of Woodtick for example, and it plays different 'layers' of the midi over the original, or something.

Ishmael

#1
The midi question:

in the room repeadetly_execute:

if (GetMidiPosition() == 127) // or whatever is the number of notes total in the midi
SetMidiPosition(12); // or whatever number of notes should it loop to

Study the manual for those functions.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Ben

You shold be able to loop the midi in whatever sequencer you're using.

As for having different layers, maybe you could try having several diferent versions of the same song, and use a script like this to change which version is playing:

x = GetMidiPosition();
PlayMusic(...);
SetMidiPosition(x);

Meowster

I don't understand what you mean by the rooms repeatedly execute. Uh? Where's this? Excuse me for being a nimbecile...

Pumaman

Go to the Room Settings pane in the editor, click the Interactions button and add a script for "Repeatedly execute".

ThunderStorm

I have tried to implement similar MIDI functions and found GetMidiPosition not accurate enoug, as it only returns the number of the bar currently playing. Is there any chance of having a function that returns a more precise value?

Pumaman

Unfortunately not, this is the only value that the MIDI player AGS uses allows you to track.

Ishmael

I made the Sledge Hammer theme loop pretty nice with those commands... ;D
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

ThunderStorm

#8
Umh - sorry - I misread the post I was refering to...

SMF spam blocked by CleanTalk