# Stellar Battle using \_slide options

**URL:** <https://in-thread.sonic-pi.net/t/stellar-battle-using--slide-options/261>\
**Category:** Creations & Ideas\
**Created:** [October 16, 2017, 6:22pm UTC](https://in-thread.sonic-pi.net/t/stellar-battle-using--slide-options/261 "2017-10-16T18:22:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [October 16, 2017, 6:22pm UTC](https://in-thread.sonic-pi.net/t/stellar-battle-using--slide-options/261/1 "2017-10-16T18:22:56Z")

</div>

I’ve always liked the \_slide options in Sonic Pi. Felt the urge to do some zapping this afternoon.  
Here is the result.

```ruby
#Stellar Battle by Robin Newman
#This code makes use of the _slide options available in Sonic Pi
#A rapdily falling pitched note is generated, which is also shifted
#rapidly in pan value. Add some gverb and you have the recipie
#for a mega battle.

define :kapow do |n,o=24,p=1|
  use_synth [:beep,:tri,:pulse,:zawa,:square].choose
  d=[0.1,0.15,0.2,0.25,0.5].choose
  #create a note and store reference to it in k
  k = play note: n+o,release: d,pan: -p,amp: rand(1.5)+0.2
  #control the note via k and slide note and pan values
  control k,note: n,note_slide: d,pan: p,pan_slide: d
  sleep d
end

with_fx :gverb, room: 25,mix: 0.8 do
  live_loop :pow do
    kapow scale(:e2,:minor_pentatonic,num_octaves: 3).choose,[12,18,24,30,36].choose,-1
    sleep rand(1.5)
  end
  
  live_loop :pow2,delay: 2 do
    kapow scale(:c3,:minor_pentatonic,num_octaves: 2).choose,[12,18,24,30,36].choose,1
    sleep rand(1)
  end
end

```

---

<div class="post-metadata">

**Author:** ![Eli](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/eli/32/116_2.png) [@Eli](https://in-thread.sonic-pi.net/u/Eli)\
**Post date:** [October 16, 2017, 9:03pm UTC](https://in-thread.sonic-pi.net/t/stellar-battle-using--slide-options/261/2 "2017-10-16T21:03:16Z")

</div>

One of the first things I ever did with SP was a video add for a friends  
space-comic website… lots of sound effects, but the gun battle between  
the ]Space Marines’ and the Raiders was neat…

Eli…

```ruby
live_loop :do_laser_fight_1, auto_cue:false do
  sleep 1
  with_fx :ixi_techno, mix: 0.5, phase: 0.8 do
    this_rate = [0.5, 1, 1.5].choose
    this_sample = :elec_filt_snare
    sample this_sample, amp: 5, rate: this_rate
    sleep sample_duration(this_sample)*this_rate
  end
end

```

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [October 16, 2017, 9:41pm UTC](https://in-thread.sonic-pi.net/t/stellar-battle-using--slide-options/261/3 "2017-10-16T21:41:09Z")

</div>

> [@Eli](#):
>
> live\_loop :do\_laser\_fight\_1, auto\_cue:false do
> 
> sleep 1
> 
> with\_fx :ixi\_techno, mix: 0.5, phase: 0.8 do
> 
> this\_rate = [0.5, 1, 1.5].choose
> 
> this\_sample = :elec\_filt\_snare
> 
> sample this\_sample, amp: 5, rate: this\_rate
> 
> sleep sample\_duration(this\_sample)\*this\_rate
> 
> end
> 
> end

Yes that sounds cool.ixi\_techno is a great effect.
