# Research on Procedural Music in Games - Participants needed

**URL:** <https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817>\
**Category:** Csound for Games\
**Created:** [18 August 2021 08:10 UTC](https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817 "2021-08-18T08:10:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Videon](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/videon/32/4108_2.png) [@Videon](https://forum.cabbageaudio.com/u/Videon)\
**Post date:** [18 August 2021 08:10 UTC](https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817/1 "2021-08-18T08:10:53Z")

</div>

Dear Cabbage community,

I’m currently conducting an experiment for my MA thesis on the impact of procedural music on emotion and memory in digital games.

The procedural music in the experiment is generated and synthesized with Csound + CsoundUnity for the integration.  
On that note, thanks for the great work! After having tried Pd and ChucK, CsoundUnity turned out to be the most reliable solution, and therefore was perfect for this scenario!

Anyway, I’m still quite urgently looking for participants in the experiment. It takes around 15 minutes and comes in the form of a Unity app for Win/Mac.  
Find it here: [https://secretstage.itch.io/procmuex](https://secretstage.itch.io/procmuex)

If you have any more questions or would like to discuss the project, I’ll be happy to converse here. 🙂

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [18 August 2021 08:58 UTC](https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817/2 "2021-08-18T08:58:36Z")

</div>

Hi @Videon, welcome to the forum. I’m happy to try this wen I get a chance. I launched it a few moments ago but got interrupted so I had to kill the game 🤣 I hope this doesn’t mess with your analysis results.

What university are you doing your MA at?

---

<div class="post-metadata">

**Author:** ![Videon](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/videon/32/4108_2.png) [@Videon](https://forum.cabbageaudio.com/u/Videon)\
**Post date:** [18 August 2021 09:50 UTC](https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817/3 "2021-08-18T09:50:36Z")

</div>

Hi @rorywalsh! Thanks for taking a look.  
Everything is transferred at the very end so the results will be fine. 🙂

> [@rorywalsh](#):
>
> What university are you doing your MA at?

I’m studying MA Digital Games at the Cologne University of Applied Sciences. Coming more from a game dev background and somehow ended up doing experiments on music cognition 🤣

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [18 August 2021 11:13 UTC](https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817/4 "2021-08-18T11:13:21Z")

</div>

That’s a nice deviation from game dev 🤣 I will try this again when I get a chance 😉

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [18 August 2021 14:20 UTC](https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817/5 "2021-08-18T14:20:34Z")

</div>

I completed this a few hours ago. Quite a nice experience! Please share your results when you are done. I think many would find it interesting. Also, you might wish to post a message to the [Csound forum](https://forum.csound.com/) too?

---

<div class="post-metadata">

**Author:** ![Videon](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/videon/32/4108_2.png) [@Videon](https://forum.cabbageaudio.com/u/Videon)\
**Post date:** [19 August 2021 08:17 UTC](https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817/6 "2021-08-19T08:17:27Z")

</div>

Thanks so much for your participation, and for making the whole thing possible with CsoundUnity! 🙂

I will share the thesis and results after my defense. Will put it on Researchgate probably sometime in October.

Good suggestion posting it on the Csound forum. I’ll be sure to do that!

---

<div class="post-metadata">

**Author:** ![giovannibedetti](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/giovannibedetti/32/4146_2.png) [@giovannibedetti](https://forum.cabbageaudio.com/u/giovannibedetti)\
**Post date:** [25 August 2021 18:53 UTC](https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817/7 "2021-08-25T18:53:02Z")

</div>

Hi, happy to see you’re using CsoundUnity for your thesis!  
I’m trying the macOS version, but I get no sound!  
What version of CsoundUnity are you using? The latest (v3) should produce valid builds for macOS.

EDIT:

It looks like you’re using the latest version of CsoundUnity, but from what I read in the log it cannot find the opcode path. Does the macOS build produce sound on your end?  
Here is the log:

> **LOG**
>
> Mono path[0] = ‘/private/var/folders/cp/l9853sv572q8n42ncj7plhy80000gn/T/AppTranslocation/F32848CA-01D5-420E-95E2-A4355D71AE04/d/MA Thesis.app/Contents/Resources/Data/Managed’  
> Mono config path = ‘/private/var/folders/cp/l9853sv572q8n42ncj7plhy80000gn/T/AppTranslocation/F32848CA-01D5-420E-95E2-A4355D71AE04/d/MA Thesis.app/Contents/MonoBleedingEdge/etc’  
> New input system (experimental) initialized  
> Initialize engine version: 2020.3.14f1 (d0d1bb862f9d)  
> [Subsystems] Discovering subsystems at path /private/var/folders/cp/l9853sv572q8n42ncj7plhy80000gn/T/AppTranslocation/F32848CA-01D5-420E-95E2-A4355D71AE04/d/MA Thesis.app/Contents/Resources/Data/UnitySubsystems  
> GfxDevice: creating device client; threaded=1  
> 2021-08-25 19:50:37.007 MA Thesis[42660:674076] Color LCD preferred device: NVIDIA GeForce GT 650M (high power)  
> 2021-08-25 19:50:37.007 MA Thesis[42660:674076] Metal devices available: 2  
> 2021-08-25 19:50:37.007 MA Thesis[42660:674076] 0: NVIDIA GeForce GT 650M (high power)  
> 2021-08-25 19:50:37.007 MA Thesis[42660:674076] 1: Intel HD Graphics 4000 (low power)  
> 2021-08-25 19:50:37.007 MA Thesis[42660:674076] Using device NVIDIA GeForce GT 650M (high power)  
> Initializing Metal device caps: NVIDIA GeForce GT 650M  
> Begin MonoManager ReloadAssembly
> 
> - Completed reload, in 0.107 seconds  
> UnloadTime: 1.987142 ms  
> CsoundUnityBridge constructor from dir: /private/var/folders/cp/l9853sv572q8n42ncj7plhy80000gn/T/AppTranslocation/F32848CA-01D5-420E-95E2-A4355D71AE04/d/Packages/com.csound.csoundunity/Runtime/macOS  
> csdFile:  
>   
> 
> -n -d ; Initialize the global variables. ksmps = 32 nchnls = 2 0dbfs = 1
> 
> seed 0 //Sets a new seed for randomization on every init
> 
> //GLOBAL VARIABLES  
> giSteps init 16 ;Number of steps per bar (global)  
> giBars init 4 ;Number of bars per loop (global)
> 
> giEuclayers init 4 ;Number of euclidean rhythm percussion layers. Only 4 are supported as of writing. May be changed in the future.
> 
> //TABLES - RANGE 900-999 is reserved for perc samples!  
> ;Global config tables - #800-809  
> giScale ftgen 800, 0, 128, -2, -1 ;Global scale table  
> giNotes ftgen 801, 0, 128, -2, -1 ;Global table containing midi note numbers of all active notes in scale, last index(127) contains number of active notes, i.e. highest index containing a valid note  
> giActivebars ftgen 802, 0, 64, -2, -1 ;Global table containing active bar information, read: 4 \* # of layers, including individual eucrth layers  
> giComm ftgen 803, 0, 4, -2, 0 ;Communication table for providing Unity with Csound state information, Params: 0 = update, 1 = currentbar, 2 = currentstep
> 
> ;EucRth config tables - #810-819  
> giEucRthConfig ftgen 810, 0, 8, -2, 0 ;Params: 0 = sample table#, 1 = pulses, for layers 0-3  
> giEucGrid ftgen 811, 0, giEuclayers\*giSteps, -2, -1 ;EucRth grid as table. Length is steps \* layers.
> 
> ;SnhMel config tables - #820-829  
> giSnhMelConfig ftgen 820, 0, 8, -2, 0 ;Params: 0 = pulses, 1 = occurence, 2 = minOct, 3 = maxOct, 4 = melody (lfo) curve, 5 = melody mode  
> giSnhMelGsyn ftgen 821, 0, 32, -2, 0 ;GSYNTH Instrument config table  
> giSnhMelGrid ftgen 822, 0, giSteps, -2, -1 ;SNHMEL steps grid
> 
> ;Chords config tables - #830-839  
> giChordsConfig ftgen 830, 0, 8, -2, 0 ;Params: 0 = pulses  
> giChordsNotes ftgen 831, 0, 16, -2, 0 ;Params: 0 = note0, 1 = note1…16 = note16  
> giChordsGsyn ftgen 832, 0, 32, -2, 0 ;GSYNTH Instrument config table  
> giChordsGrid ftgen 833, 0, giSteps, -2, -1 ;CHORDS steps grid
> 
> ;SnhBas config tables - #840-849  
> giSnhBasConfig ftgen 840, 0, 8, -2, 0 ;Params: 0 = pulses, 1 = occurence, 2 = minOct, 3 = maxOct, 4 = melody (lfo) curve, 5 = melody mode  
> giSnhBasGsyn ftgen 841, 0, 32, -2, 0 ;GSYNTH Instrument config table  
> giSnhBasGrid ftgen 842, 0, giSteps, -2, -1 ;SNHBAS steps grid
> 
> ;Waveforms  
> gisine ftgen 700, 0, 16384, 10, 1 ; Sine wave  
> gisquare ftgen 701, 0, 16384, 10, 1, 0, 0.3, 0, 0.2, 0, 0.14, 0, .111 ; Square  
> gisaw ftgen 702, 0, 16384, 10, 1, 0.5, 0.3, 0.25, 0.2, 0.167, 0.14, 0.125, .111 ; Sawtooth  
> gipulse ftgen 703, 0, 16384, 10, 1, 1, 1, 1, 0.7, 0.5, 0.3, 0.1 ; Pulse
> 
> //SYSTEM INSTRUMENTS
> 
> //Generates a global clock signal (gktrig) as long as it’s running.  
> instr CLOCK  
> gkbpm init 110 ;beats per minute  
> ;gkbpm portk chnget(“gBpm”), 0.5  
> gkbpm chnget “gBpm” ;TODO implement smoothing for handling external value changes
> 
> ```
> gkcurrentbar init 0 ;setting to -1 as it will be set to 1 on first gkstep
> gkstep init 0
> 
> kpulses = 4 ;pulses per beat
> 
> gktrig metro gkbpm*kpulses/60
> 
> if gktrig == 1 then
> gkstep = (gkstep + 1) % giSteps ;perform modulo operation to clamp step index
> tabw(gkstep,2,803) ;set comm table index 2 to current step index
> 
> if gkstep == 0 then
> gkcurrentbar = (gkcurrentbar+1) % giBars
> tabw(1,0,803) ;sets table index=0 to 1 to signify update to Unity
> tabw(gkcurrentbar,1,803) ;set comm table index 1 to current bar index
> endif
> endif
> 
> ```
> 
> endin
> 
> //INSTRUMENTS
> 
> //Sampler instrument for use with audioclips from Unity  
> //i, start, dur, pitch, file\_index  
> instr SMPLR\_UNITY ; play audio from function table using flooper2 opcode
> 
> ```
> ifn = chnget(sprintf("sampletable%d", 900+p4))
> ;prints "giTable p4 = %d, ifn = %d\n", p4, ifn
> ilen = nsamp(ifn)
> ;prints "actual numbers of samples = %d\n", ilen
> itrns = 1	; no transposition
> ilps = 0	; loop starts at index 0
> ilpe = ilen	; ends at value returned by nsamp above
> imode = 1	; loops forward
> istrt = 0	; commence playback at index 0 samples
> ; lphasor provides index into f1
> alphs lphasor itrns, ilps, ilpe, imode, istrt
> atab tablei alphs, ifn
> 
> arevL, arevR freeverb atab, atab, 0.5, 0.6
> 
> outs atab*0.1+arevL*0.1, atab*0.1+arevR*0.1
> 
> ```
> 
> endin
> 
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
> //EUCLIDEAN RHYTHMS  
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> 
> //Fills the grid. Triggered at the start of a new bar.  
> instr EUC\_FILL  
> ipulses = p4  
> irotation = p5 ;TODO rotation currently not implemented  
> itabn = p6 ;p6 is grid table#  
> ioffset = p7 ;offsets write index by grid length \* ioffset. needed for tables with multiple grid layers (e.g. EUCRTH)
> 
> ```
> kbucket init 0
> kstep init 0
> 
> //Fill sequence
> while kstep < giSteps do
> 
> kbucket = kbucket + ipulses
> 
> if kbucket >= giSteps then
> kbucket = kbucket - giSteps
> tabw(1,kstep+ioffset*giSteps,itabn) ;1 = impulse for triggering sound
> else
> tabw(-1,kstep+ioffset*giSteps,itabn) ;-1 = no impulse on grid position
> endif
> 
> //gkgrid[ilayer][kstep+ giSteps] = gkgrid[ilayer][istep] ;copying current value to offset position (for rotation support)
> 
> kstep += 1
> od
> 
> ```
> 
> endin
> 
> //Steps through the grid and triggers sounds accordingly  
> instr EUC\_STEP  
> if gktrig == 1 then  
> //Fill grid on start of a new bar  
> if gkstep == 0 then  
> //EUC\_FILL for all instruments
> 
> ```
> //EUCRTH
> klayer = 0
> while klayer < giEuclayers do
> event "i", "EUC_FILL", 0, 1, tab:k(klayer*2+1, 810), 0, 811, klayer
> klayer += 1
> od
> 
> event "i", "EUC_FILL", 0, 1, tab:k(0,830), 0, 833, 0 //CHORDS
> 
> event "i", "EUC_FILL", 0, 1, tab:k(0,820), 0, 822, 0 //SNHMEL
> 
> event "i", "EUC_FILL", 0, 1, tab:k(0,840), 0, 842, 0 //SNHBAS
> 
> endif
> 
> //PLAY ALL INSTRUMENTS ACCORDING TO GRID AND ACTIVE BAR INFORMATION
> //EUCRTH
> 
> klayer = 0
> while klayer < giEuclayers do ;iterate through all percussion layers
> if tab:k(0 * giBars + gkcurrentbar, 802) > 0 then ;only play if current bar is active
> if tab:k(klayer * 16 + gkstep, 811) > -1 then
> event "i", "SMPLR_UNITY", 0, 2, tab:k(klayer*2, 810)
> endif
> endif
> klayer += 1
> od
> 
> //CHORDS
> if tab:k(1 * giBars + gkcurrentbar, 802) > 0 then ;only play if current bar is active, x * giBars to skip bars indices for other instruments
> if tab:k(gkstep, 833) > -1 then
> event "i", "CHORDS", 0, 1
> endif
> endif
> 
> endif
> 
> ```
> 
> endin
> 
> //EUCLIDEAN RHYTHMS END  
> //-----------------------------------------------------------------------------------------------------------------------------
> 
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
> //SAMPLE AND HOLD MELODY  
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> 
> //TODO Maybe SNHMEL could use a morphable wavetable for sound generation??  
> instr SNHMEL  
> ;kmaxnote = tab:k(127, 801)  
> kminnote init 0  
> kmaxnote init 0
> 
> koccurence = tab:k(1, 820)  
> kminoct = tab:k(2,820)_12 //multiply octave values by 12 to get octaves as midi-style notes  
> kmaxoct = tab:k(3,820)_(12+11) //add 11 to include last note of octave
> 
> //Find min note index whenever oct settings have changed  
> if changed(kminoct) == 1 then  
> kcnt = 0  
> while kcnt \< 127 do  
> if tab:k(kcnt, 801) \>= kminoct then  
> kminnote = kcnt  
> kcnt=127  
> endif  
> kcnt +=1  
> od  
> ;printks “MINNOTE: %d”, 0, kminnote  
> endif
> 
> if changed(kmaxoct) == 1 then  
> kcnt = 0  
> while kcnt \< 127 do  
> kmaxnote = kcnt  
> if tab:k(kcnt, 801) \>= kmaxoct then  
> kcnt=127  
> endif  
> kcnt +=1  
> od  
> ;printks “MAXNOTE: %d”, 0, kmaxnote  
> endif
> 
> krd randomi 0.01, 8, 0.1
> 
> klfo lfo 1, krd, 1  
> kscaled = kminnote + (kmaxnote-kminnote) \* (klfo - -1) / (1 - -1) //scale lfo from -1…1 to min,max note indices
> 
> ;printks “KRES: %d”, 0.5, kscaled
> 
> gksnhmel\_note = limit(kscaled,kminnote,kmaxnote)  
> gksnhmel\_note = tab:k(kscaled,801)
> 
> kmode = tab:k(5,820)  
> ;printks “KNOTE: %d”, 0.5, knote  
> ;TODO check if set to discrete mode and play gsynth only in that case.  
> if gktrig == 1 then  
> //if continuous  
> if kmode == 0 kgoto continuous  
> kgoto discrete ;else
> 
> ```
> continuous:
> if changed(kmode) == 1 then
> event "i", "GSYNTH_CONTIN", 0, -1, 0, 821
> endif
> 
> kgoto continue
> 
> discrete:
> if changed(kmode) == 1 then
> event "i", "GSYNTH_CONTIN", 0, 1, 0, 821
> endif
> 
> if tab:k(2 * giBars + gkcurrentbar, 802) > 0 then
> if tab:k(gkstep, 822) > -1 then
> event "i", "GSYNTH", 0, 1, gksnhmel_note, 821
> endif
> endif
> 
> continue:
> 
> ```
> 
> endif
> 
> endin
> 
> //TODO Currently SNHBAS is identical with SNHMEL. Using two different instruments for allowing individual features later on  
> instr SNHBAS  
> ;kmaxnote = tab:k(127, 801)  
> kminnote init 0  
> kmaxnote init 0
> 
> koccurence = tab:k(1, 840)  
> kminoct = tab:k(2,840)_12 //multiply octave values by 12 to get octaves as midi-style notes  
> kmaxoct = tab:k(3,840)_(12+11) //add 11 to include last note of octave
> 
> //Find min note index whenever oct settings have changed  
> if changed(kminoct) == 1 then  
> kcnt = 0  
> while kcnt \< 127 do  
> if tab:k(kcnt, 801) \>= kminoct then  
> kminnote = kcnt  
> kcnt=127  
> endif  
> kcnt +=1  
> od  
> ;printks “MINNOTE: %d”, 0, kminnote  
> endif
> 
> if changed(kmaxoct) == 1 then  
> kcnt = 0  
> while kcnt \< 127 do  
> kmaxnote = kcnt  
> if tab:k(kcnt, 801) \>= kmaxoct then  
> kcnt=127  
> endif  
> kcnt +=1  
> od  
> ;printks “MAXNOTE: %d”, 0, kmaxnote  
> endif
> 
> klfo lfo 1, 1.2, 5  
> kscaled = kminnote + (kmaxnote-kminnote) \* (klfo - -1) / (1 - -1) //scale lfo from -1…1 to min,max note indices
> 
> ;printks “KRES: %d”, 0.5, kscaled
> 
> knote = limit(kscaled,kminnote,kmaxnote)  
> knote = tab:k(kscaled,801)
> 
> ;printks “KNOTE: %d”, 0.5, knote
> 
> if gktrig == 1 then  
> if tab:k(3 \* giBars + gkcurrentbar, 802) \> 0 then  
> if tab:k(gkstep, 842) \> -1 then  
> event “i”, “GSYNTH”, 0, 1, knote, 841  
> endif  
> endif  
> endif
> 
> endin
> 
> //SAMPLE AND HOLD MELODY END  
> //-----------------------------------------------------------------------------------------------------------------------------
> 
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
> //CHORDS  
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> 
> //Fetches notes from note ftable (#831)  
> instr CHORDS  
> kCnt init 0
> 
> while kCnt \< 16 do  
> kval = tab:k(kCnt,831) ;kval is also note as midi number
> 
> ```
> if kval > -1 then
> event "i", "GSYNTH", 0, 1, kval, 832
> endif
> 
> kCnt += 1
> 
> ```
> 
> od  
> endin
> 
> //CHORDS END  
> //-----------------------------------------------------------------------------------------------------------------------------
> 
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
> //GAME SYNTH  
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> 
> //Wavetable numbers: sine = 710, square = 711, saw = 712, pulse = 713
> 
> gisyntrig init 0
> 
> //i GSYNTH [p3 = length] [p4 = note] [p5 = param table#] [p6 = panning, 0=L, 1=R]  
> // TABLE VALUES: [p5 = velocity] [p6 = osc waveform 0:sin 1:sqr 2:saw] [p7 = noise amp]  
> // [p8 = filter frequency] [p9 = filter resonance] [p10 = filter env amount][p11,12,13,14 = filter A,D,S,R] [p15,16,17,18 = amp A,D,S,R]  
> // [p19 = stereo width] [p20,21,22 = reverb amount, room size, damp]  
> instr GSYNTH
> 
> ;pX = lfo waveform
> 
> //Input/midi variables  
> ifreq = pow(2,(p4-69)/12)\*440 ;note as midi# value, is converted to frequency (Hz)
> 
> ifn = p5
> 
> ivel = tab\_i(5,ifn) ;note velocity value
> 
> iwf = 700+tab\_i(6,ifn) ;waveform
> 
> inoise = tab\_i(7,ifn) ;noise amount
> 
> //Filter parameters  
> iffreq = tab\_i(8,ifn) ;lowpass filter frequency  
> ifres = tab\_i(9,ifn) ;lowpass filter resonance  
> ifenv\_amt = tab\_i(10,ifn) ;lowpass filter env amount
> 
> ifenv\_att = tab\_i(11,ifn) ;filter attack  
> ifenv\_dec = tab\_i(12,ifn) ;filter decay  
> ifenv\_sus = tab\_i(13,ifn) ;filter sustain  
> ifenv\_rel = tab\_i(14,ifn) ;filter release
> 
> //Amp parameters  
> iaenv\_att = tab\_i(15,ifn) ;amp attack  
> iaenv\_dec = tab\_i(16,ifn) ;amp decay  
> iaenv\_sus = tab\_i(17,ifn) ;amp sustain  
> iaenv\_rel = tab\_i(18,ifn) ;amp release
> 
> //Additional parameters  
> iwidth = tab\_i(19,ifn) ;stereo width
> 
> //FX  
> irev\_amt = tab\_i(20,ifn)  
> irev\_roomsize = tab\_i(21,ifn)  
> irev\_damp = tab\_i(22,ifn)
> 
> //Perform alternating execution when a note is played  
> if gisyntrig == 1 then  
> kpan = 0.5 + iwidth / 2 ;set note panning r  
> gisyntrig = 0  
> else  
> kpan = 0.5 - iwidth / 2  
> gisyntrig = 1  
> endif
> 
> //LFOs  
> klfo1 lfo 1, 1
> 
> //OSCs  
> aosc1 poscil ivel, ifreq, iwf
> 
> anoise rand limit(inoise,0,1)
> 
> abus = aosc1 + anoise
> 
> //Filters  
> kfenv madsr ifenv\_att, ifenv\_dec, ifenv\_sus, ifenv\_rel ;filter envelope
> 
> alp zdf\_2pole abus, iffreq+kfenv\*ifenv\_amt, ifres ;filter signal
> 
> //Amp  
> aaenv madsr iaenv\_att, iaenv\_dec, iaenv\_sus, iaenv\_rel ;amplitude envelope
> 
> abus = alp\*aaenv
> 
> abusL, abusR pan2 abus, kpan ;pan signal
> 
> arevL, arevR freeverb abusL, abusR, irev\_roomsize, irev\_damp
> 
> outs abusL+arevL_irev\_amt, abusR+arevR_irev\_amt
> 
> endin
> 
> //GAME SYNTH END  
> //-----------------------------------------------------------------------------------------------------------------------------
> 
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
> //GAME SYNTH SNHMEL EDITION  
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> 
> //Wavetable numbers: sine = 710, square = 711, saw = 712, pulse = 713
> 
> //i GSYNTH [p3 = length] [p4 = note] [p5 = param table#] [p6 = panning, 0=L, 1=R]  
> // TABLE VALUES: [p5 = velocity] [p6 = osc waveform 0:sin 1:sqr 2:saw] [p7 = noise amp]  
> // [p8 = filter frequency] [p9 = filter resonance] [p10 = filter env amount][p11,12,13,14 = filter A,D,S,R] [p15,16,17,18 = amp A,D,S,R]  
> // [p19 = stereo width] [p20,21,22 = reverb amount, room size, damp]  
> instr GSYNTH\_CONTIN
> 
> ;pX = lfo waveform
> 
> //Input/midi variables  
> kfreq = pow(2,(gksnhmel\_note-69)/12)\*440 ;note as midi# value, is converted to frequency (Hz)
> 
> ifn = p5
> 
> kvel = tab\_i(5,ifn) ;note velocity value
> 
> iwf = 700+tab\_i(6,ifn) ;waveform
> 
> knoise = tab\_i(7,ifn) ;noise amount
> 
> //Filter parameters  
> kffreq = tab\_i(8,ifn) ;lowpass filter frequency  
> kfres = tab\_i(9,ifn) ;lowpass filter resonance  
> kfenv\_amt = tab\_i(10,ifn) ;lowpass filter env amount
> 
> ifenv\_att = tab\_i(11,ifn) ;filter attack  
> ifenv\_dec = tab\_i(12,ifn) ;filter decay  
> ifenv\_sus = tab\_i(13,ifn) ;filter sustain  
> ifenv\_rel = tab\_i(14,ifn) ;filter release
> 
> //Amp parameters  
> iaenv\_att = tab\_i(15,ifn) ;amp attack  
> iaenv\_dec = tab\_i(16,ifn) ;amp decay  
> iaenv\_sus = tab\_i(17,ifn) ;amp sustain  
> iaenv\_rel = tab\_i(18,ifn) ;amp release
> 
> //Additional parameters  
> iwidth = tab\_i(19,ifn) ;stereo width
> 
> //FX  
> krev\_amt = tab\_i(20,ifn)  
> krev\_roomsize = tab\_i(21,ifn)  
> krev\_damp = tab\_i(22,ifn)
> 
> //TODO Panning may be modulated by k value  
> kpan = 0.5
> 
> //LFOs  
> klfo1 lfo 1, iwf  
> krd randomi 0.01, 0.1, 0.1 ;min,max,cps
> 
> //OSCs  
> aosc1 poscil krd, kfreq, 702
> 
> anoise rand limit(knoise,0,1)
> 
> abus = aosc1 + anoise
> 
> //Filters  
> kfenv madsr ifenv\_att, ifenv\_dec, ifenv\_sus, ifenv\_rel ;filter envelope
> 
> alp zdf\_2pole abus, kffreq+kfenv\*kfenv\_amt, kfres ;filter signal
> 
> //Amp  
> aaenv madsr iaenv\_att, iaenv\_dec, iaenv\_sus, iaenv\_rel ;amplitude envelope
> 
> ;abus = alp\*aaenv
> 
> abusL, abusR pan2 abus, kpan ;pan signal
> 
> arevL, arevR freeverb abusL, abusR, krev\_roomsize, krev\_damp
> 
> outs aosc1, aosc1  
> ;outs abusL+arevL_krev\_amt, abusR+arevR_krev\_amt
> 
> endin
> 
> //GAME SYNTH CONTINUOUS END  
> //-----------------------------------------------------------------------------------------------------------------------------  
>   
>   
> f 0 z  
> i “CLOCK” 2 -1  
> i “EUC\_STEP” 2 -1  
> i “SNHMEL” 2 -1  
> i “SNHBAS” 2 -1
> 
> opcodePath /private/var/folders/cp/l9853sv572q8n42ncj7plhy80000gn/T/AppTranslocation/F32848CA-01D5-420E-95E2-A4355D71AE04/d/Packages/com.csound.csoundunity/Runtime/macOS/CsoundLib64.bundle/Contents/MacOS exists? False
> 
> WARNING: e[mError opening plugin directory ‘/private/var/folders/cp/l9853sv572q8n42ncj7plhy80000gn/T/AppTranslocation/F32848CA-01D5-420E-95E2-A4355D71AE04/d/Packages/com.csound.csoundunity/Runtime/macOS/CsoundLib64.bundle/Contents/MacOS’: No such file or directorye[m  
> e[m0dBFS level = 32768.0  
> –Csound version 6.14 (double samples) Jan 26 2020  
> [commit: 0ce67f7c105ed2aee98d0e7f43558d62357c769b]  
> libsndfile-1.0.28  
> System buffer size: 1024, buffer count: 4, samplerate: 44100
> 
> PerformKsmps: 0
> 
> CsoundCompile: True
> 
> zerdbfs 1
> 
> CsoundUnity done init, compiledOk? True
> 
> inactive allocs returned to freespace  
> end of score. overall amps: 0.91331 0.90319  
> overall samples out of range: 0 0  
> 0 errors in performance  
> Elapsed time at end of performance: real: 13.933s, CPU: 7.561s  
> Setting up 4 worker threads for Enlighten.  
> Thread → id: 70000f3d2000 → priority: 1  
> Thread → id: 7000109ed000 → priority: 1  
> Thread → id: 70001073b000 → priority: 1  
> Thread → id: 70001096a000 → priority: 1

EDIT 2:

Sorry for the false flag, I have sound! (had a wrong output device selected). 👌

EDIT 3:

At the start of the app there are some glitches, the notes come all together!  
Apart from that, It was really interesting to try it!  
Thank you!

---

<div class="post-metadata">

**Author:** ![Videon](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/videon/32/4108_2.png) [@Videon](https://forum.cabbageaudio.com/u/Videon)\
**Post date:** [26 August 2021 16:49 UTC](https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817/8 "2021-08-26T16:49:55Z")

</div>

Hi @giovannibedetti, thank you so much for trying it out!

I’m aware of the sounds playing at the start of the app. It’s due to the sequencer starting to play before notes are generated. However, I decided to keep it in as it’s useful for testing whether the sound is working. Also, it reminds me a bit of an orchestra tuning up before playing 😁

Interesting to see that the log outputs the complete source code for the Csound part of the project haha.

---

<div class="post-metadata">

**Author:** ![giovannibedetti](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/giovannibedetti/32/4146_2.png) [@giovannibedetti](https://forum.cabbageaudio.com/u/giovannibedetti)\
**Post date:** [26 August 2021 17:02 UTC](https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817/9 "2021-08-26T17:02:02Z")

</div>

> [@Videon](#):
>
> Interesting to see that the log outputs the complete source code for the Csound part of the project haha.

Yes this is something we should remove from the Logs 😉

---

<div class="post-metadata">

**Author:** ![Videon](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/videon/32/4108_2.png) [@Videon](https://forum.cabbageaudio.com/u/Videon)\
**Post date:** [26 October 2021 10:26 UTC](https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817/10 "2021-10-26T10:26:24Z")

</div>

Hi everyone,

I just wanted to follow up with the results of the experiment. [You can find them in my MA thesis on Researchgate (click here)](https://www.researchgate.net/publication/354552162_Conception_and_Evaluation_of_a_Procedural_Music_System_for_Engagement_with_Player_Emotion_and_Memory_in_Digital_Games)

Thanks again for your help and participation!

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [26 October 2021 11:07 UTC](https://forum.cabbageaudio.com/t/research-on-procedural-music-in-games-participants-needed/2817/11 "2021-10-26T11:07:25Z")

</div>

Thanks for sharing this.👍
