Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Meowster on Sun 28/09/2003 19:36:36

Title: Question about music
Post by: Meowster on Sun 28/09/2003 19:36:36
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.
Title: Re:Question about music
Post by: Ishmael on Sun 28/09/2003 19:46:23
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.
Title: Re:Question about music
Post by: Ben on Sun 28/09/2003 20:18:59
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);
Title: Re:Question about music
Post by: Meowster on Sun 28/09/2003 20:47:18
I don't understand what you mean by the rooms repeatedly execute. Uh? Where's this? Excuse me for being a nimbecile...
Title: Re:Question about music
Post by: Pumaman on Sun 28/09/2003 20:49:24
Go to the Room Settings pane in the editor, click the Interactions button and add a script for "Repeatedly execute".
Title: Re:Question about music
Post by: ThunderStorm on Mon 29/09/2003 17:47:27
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?
Title: Re:Question about music
Post by: Pumaman on Mon 29/09/2003 23:26:03
Unfortunately not, this is the only value that the MIDI player AGS uses allows you to track.
Title: Re:Question about music
Post by: Ishmael on Tue 30/09/2003 14:57:56
I made the Sledge Hammer theme loop pretty nice with those commands... ;D
Title: Re:Question about music
Post by: ThunderStorm on Tue 30/09/2003 17:46:23
Umh - sorry - I misread the post I was refering to...