From 5ccfd80207324cd6347b26e65e41b73d5c811409 Mon Sep 17 00:00:00 2001 From: Nicolas Hurtubise <316k@legtux.org> Date: Mon, 5 May 2014 16:55:35 -0400 Subject: Adds license headers --- squelette_synth_midi.ino | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'squelette_synth_midi.ino') diff --git a/squelette_synth_midi.ino b/squelette_synth_midi.ino index ea272d4..79befd5 100644 --- a/squelette_synth_midi.ino +++ b/squelette_synth_midi.ino @@ -1,3 +1,24 @@ +/* + * squelette_synth_midi.ino + * + * Copyright 2014 Guillaume Riou, Aude Forcione-Lambert & Nicolas Hurtubise. + * + * This file is part of Llammas. + * + * Llammas is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Llammas is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Llammas. If not, see . + * + */ #include #include #include @@ -37,7 +58,7 @@ Multifilter mf(0); bool lfoEffect[2][5]; //0:oscil1, 1:oscil2, 2:oscil3, 3:envelope, 4:detune void handlePitchBend(byte channel, byte lsb, byte msb) { - + pbAmount = pgm_read_float_near(PB_ARRAY+msb); jouerNote(lastMidiNote); } @@ -83,7 +104,6 @@ void handleNoteOff(byte channel, byte note, byte velocity) { if(noteBuffer[0] != -1) { jouerNote((float)noteBuffer[0]); } else { - adsr_filter.noteOff(); adsr_envelope.noteOff(); } @@ -119,7 +139,7 @@ void updateControl() { mf.changeFilter(filterReading); lastFilter = filterReading; } - + MIDI.read(); adsr_envelope.update(); mf.setCutoffFreq(255 * adsr_envelope.next() >> 8); @@ -127,7 +147,7 @@ void updateControl() { int updateAudio() { //adsr.next(); - + /** int osc1 = ncoOne.next(); int osc2 = ncoTwo.next(); @@ -150,8 +170,8 @@ int updateAudio() { //detune } } */ - - + + return (int) (adsr_envelope.next()*(mf.next((ncoOne.next() + ncoTwo.next() + ncoThree.next()) >> 2))) >> 2; } -- cgit v1.3 From 466cc1b61c36c22411324a3c9dd5131642da193c Mon Sep 17 00:00:00 2001 From: kijrel Date: Tue, 13 May 2014 14:33:26 -0400 Subject: initialise lfoEffect dans squelette_synth_midi.ino --- squelette_synth_midi.ino | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'squelette_synth_midi.ino') diff --git a/squelette_synth_midi.ino b/squelette_synth_midi.ino index 79befd5..9804cbf 100644 --- a/squelette_synth_midi.ino +++ b/squelette_synth_midi.ino @@ -126,6 +126,11 @@ void setup() { mf.setResonance(156); lastLfoValues[0] = 0; lastLfoValues[1] = 0; + for(int i=0; i<2; i++){ + for(int j=0; j<5; j++){ + lfoEffect[i][j]=false; + } + } } int lastFilter = 0; -- cgit v1.3