Simulates a planet orbiting in a binary star system.
planet simulates a planet orbiting in a binary star system. The outputs are the x, y and z coordinates of the orbiting planet. It is possible for the planet to achieve escape velocity by a close encounter with a star. This makes this system somewhat unstable.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform; Audio out Audio in No messages-odac-iadc-d;;;RT audio I/O; For Non-realtime ouput leave only the line below:; -o planet.wav -W ;;; for file output any platform</CsOptions><CsInstruments>; Initialize the global variables.sr=44100kr=44100ksmps=1nchnls=2; Instrument #1 - a planet oribiting in 3D space.instr1; Create a basic tone.kampinit5000kcpsinit440ifn=1asndoscilkamp,kcps,ifn; Figure out its X, Y, Z coordinates.km1init0.5km2init0.35ksepinit2.2ix=0iy=0.1iz=0ivx=0.5ivy=0ivz=0ih=0.0003ifric=-0.1ax1,ay1,az1planetkm1,km2,ksep,ix,iy,iz,\
ivx,ivy,ivz,ih,ifric; Place the basic tone within 3D space.kxdownsampax1kydownsampay1kzdownsampaz1idist=1ift=0imode=1imdel=1.018853416iovr=2aw2,ax2,ay2,az2spat3dasnd,kx,ky,kz,idist,\
ift,imode,imdel,iovr; Convert the 3D sound to stereo.aleft=aw2+ay2aright=aw2-ay2outsaleft,arightendin</CsInstruments><CsScore>; Table #1 a sine wave.f1016384101; Play Instrument #1 for 10 seconds.i1010e</CsScore></CsoundSynthesizer>