// title: Re: An FM Matrix Synth with 1to1 feedback -- nanokontrol NNdef version // author: miguel-negrao // description: // FM Matrix Synth, now with 1to1 feedback! // // // Version for nanocontrol: // 3x3 matrix // // indexes - 9 faders // freqs, first 3 knobs // amps, second group of 3 knobs // // Needs NNDef from FPLib and Modality // https://github.com/miguel-negrao/FPLib // https://github.com/ModalityTeam/Modality-toolkit // code: /////////////////////////////////////////// // a basic FM Matrix Synth, now with 1to1 feedback. ( NNdef(\fmMatrix, { var numOscs = 3; var k = MIDIMKtl('nnkn0').elements; var freqs = k[\kn][0][..2].collect{ |e| e.enIn.enKr.linlin(0,1,20,5000) }; var amps = k[\kn][0][3..5].collect{ |e| e.enIn.enKr }; var modIndex = k[\sl][0].collect{ |e| e.enIn.enKr.linlin(0,1,0.0,4.0) }.clump(numOscs); var feedbacks = LocalIn.ar(numOscs); var oscs = [freqs, modIndex].flopWith{ |freq, mods| SinOsc.ar( freq + [feedbacks, mods].flopWith{ |feedback, modi| freq * modi * feedback }.sum ) }; LocalOut.ar(oscs); Splay.ar(oscs * amps); }) ) NdefMixer(s)