# Multi-instruments Playing Backwards

**URL:** https://qa.fmod.com/t/multi-instruments-playing-backwards/14719
**Category:** FMOD Studio
**Created:** [May 27, 2019, 8:32am UTC](https://qa.fmod.com/t/multi-instruments-playing-backwards/14719 "2019-05-27T08:32:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![matiaslizana](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/matiaslizana/32/185_2.png) [@matiaslizana](https://qa.fmod.com/u/matiaslizana)
#### Post date: [May 27, 2019, 8:32am UTC](https://qa.fmod.com/t/multi-instruments-playing-backwards/14719/1 "2019-05-27T08:32:38Z")

</div>

Is it possible to get multiinstruments and scatterer instruments playing backwards setting the frequency to a negative value as it says on this post?  
[https://qa.fmod.com/t/reversing-a-sound/10524](https://qa.fmod.com/t/reversing-a-sound/10524)

I can play single sounds reversed using setFrequency and setPosition to the end of the sound. But it doesn’t work for me using multisounds or scatterer.

Thanks in advance

---

<div class="post-metadata">

### Author: ![matiaslizana](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/matiaslizana/32/185_2.png) [@matiaslizana](https://qa.fmod.com/u/matiaslizana)
#### Post date: [May 27, 2019, 2:06pm UTC](https://qa.fmod.com/t/multi-instruments-playing-backwards/14719/2 "2019-05-27T14:06:36Z")

</div>

This is my code to change the frequency:

```
    soundEvent.start();
    soundEvent.setTimelinePosition(timelinePosition % (int)GetEventLength(soundEvent, true));
    
    RuntimeManager.StudioSystem.flushCommands();
    while (!IsEventState(soundEvent, PLAYBACK_STATE.PLAYING) && !IsEventState(soundEvent, PLAYBACK_STATE.STOPPED));
    
    soundEvent.getChannelGroup(out ChannelGroup channelGroup);
    channelGroup.getGroup(0, out ChannelGroup auxGroup);
    auxGroup.getChannel(0, out Channel channel);
    channel.setFrequency(frequency);

```

If I don’t call flushcommands after starting the event, it doesn’t detect that event is started. Is this true?

I need to take the channel to set the frequency, but I need to wait to the event to be playing to take the channel.

1. I don’t know if this is the correct way to change the frequency of a sound.

2. Also, I want to change the frequency on update time, to play the same sound at different velocities. This includes to call flushcommands on every frame then, and my engine collapses because it takes a lot of time to perform the action. How can I solve that?

Thanks again, can anyone help with that?

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [May 30, 2019, 10:50pm UTC](https://qa.fmod.com/t/multi-instruments-playing-backwards/14719/3 "2019-05-30T22:50:31Z")

</div>

Instead of using flushCommands, using StudioSystem.update() would do the same job more effeciently, as flushCommands will block the thread until all pending commands are executed.

Digging in to the channels and changing frequency isn’t really advised as it can wreak havoc on the playback system, especially if you are trying to play things backwards with a negative frequency.

There are a couple of ways you can go about making a rewind effect.

1. Use a Master Bus custom DSP that writes the audio into a buffer, then when it is time to rewind the buffer can be flipped and played back.

2. Using a generic “audio rewinding” sound effect rather than actual captured audio. This is a much simpler solution and can often produce the required results.

---

<div class="post-metadata">

### Author: ![matiaslizana](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/matiaslizana/32/185_2.png) [@matiaslizana](https://qa.fmod.com/u/matiaslizana)
#### Post date: [June 3, 2019, 7:11am UTC](https://qa.fmod.com/t/multi-instruments-playing-backwards/14719/4 "2019-06-03T07:11:50Z")

</div>

> [@cameron-fmod](#):
>
> Digging in to the channels and changing frequency isn’t really advised as it can wreak havoc on the playback system, especially if you are trying to play things backwards with a negative frequency.

I need to change the frequency on realtime, because when replaying again, listeners can be moved (imagine it’s like a replayer of your gameplay, but changing the camera). I can’t do option number 1, and number 2 doesn’t solve my problem…

There’s no way to reproduce all the different events in backwards? It’s not possible to get the masterchannel of an event and change its frequency?

Thanks again

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [June 3, 2019, 11:53pm UTC](https://qa.fmod.com/t/multi-instruments-playing-backwards/14719/5 "2019-06-03T23:53:41Z")

</div>

> [@matiaslizana](#):
>
> I can’t do option number 1

Is there a reason you cannot do this? It sounds like your only real option at this point.

> [@matiaslizana](#):
>
> It’s not possible to get the masterchannel of an event and change its frequency?

You can only change the frequency on [Channels](https://fmod.com/resources/documentation-api?version=2.0&page=core-api-channel.html#channel_setfrequency) not ChannelGroups.

---

<div class="post-metadata">

### Author: ![matiaslizana](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/matiaslizana/32/185_2.png) [@matiaslizana](https://qa.fmod.com/u/matiaslizana)
#### Post date: [June 4, 2019, 7:10am UTC](https://qa.fmod.com/t/multi-instruments-playing-backwards/14719/6 "2019-06-04T07:10:32Z")

</div>

> [@cameron-fmod](#):
>
> I can’t do option number 1

Because it’s a replayer, and it needs to be reproduced forward and backward on real time in different velocities (not 1x, 2x, but progressive from 0x to 2x, so it can be 1.35x equivalent to 64800Hz (48000Hz for the real sample).

> [@cameron-fmod](#):
>
> It’s not possible to get th

So I understand is not possible to manage a multitrack event playing backwards or different frequencies on realtime, because of the possible breakdown on the playback system.

Also I’ve tried to change the frequency on a single channel with a multitrack or scatterer event and it doesn’t works.
