Path: chuka.playstation.co.uk!news From: James Shaughnessy Newsgroups: scee.yaroze.programming.sound Subject: Re: VAG in SEQ? SeqPlay example Date: Thu, 05 Feb 1998 08:53:08 +0000 Organization: Bacardi Ferrari V12 Lines: 55 Message-ID: <34D97DF4.7A24@manc.u-net.com> References: <34D85A44.89550AF9@infores.com> NNTP-Posting-Host: manc.u-net.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0 (Win95; I) Luca Cappellini wrote: > I do not understand the meaning of having a VAG (group of waveforms) > associated to a SEQ file (MIDI file that define instruments and note > I thought that a SEQ file could play alone, why i have to give to the > SsOpenSeq func the VAG address ? The VAG sound samples are the instruments, and the SEQ file is just a data file which says what SEQuence to play those instruments in. You give SsOpenSeq a VAB_ID number (not its address) which is determined with the the return value from SsVabTransfer (which is what uses the addresses of the .vh and .vb files (parts of the split VAB). eg: #define SEQ_ADDR 0x80090000 // #define VH_ADDR 0x800a0000 // or wherever #define VB_ADDR 0x800b0000 // main () { short vab_id, access_num; // MUST do this to hear amything! SsSetMVol(127,127); // Put samples in sound RAM and get vab_id // (we don't control where it goes) vab_id = SsVabTransfer((u_char *)VH_ADDR, (u_char *)VB_ADDR, 1, 1); // Get SEQ access num access_num = SsSeqOpen(u_long *)SEQ_ADDR, vab_id); // MUST do this too! SsSetSeqVolume(access_num, 127, 127); // Finally play the SEQ SsSeqPlay(access_num, SSPLAY_PLAY, 1); ... } Job's a good'en! You can play a sound sample from the VAB simply by using SsUtKeyOn() etc. as sfx and seq instruments are the same thing. Hope that helps you and others who just need a little example to get them going (I sure did!), Jim -- ----------------------------------------- James Shaughnessy james@manc.u-net.com http://www.netyaroze-europe.com/~shaughnj -----------------------------------------