Przeglądaj źródła

Improve wavetable Zelda example

dds
PaulStoffregen 6 lat temu
rodzic
commit
d79b1b254f
9 zmienionych plików z 5090 dodań i 14507 usunięć
  1. +0
    -7560
      examples/Synthesis/Wavetable/Zelda/BasicFlute1_samples.cpp
  2. +0
    -12
      examples/Synthesis/Wavetable/Zelda/BasicFlute1_samples.h
  3. +0
    -6904
      examples/Synthesis/Wavetable/Zelda/FrenchHorns_samples.cpp
  4. +0
    -10
      examples/Synthesis/Wavetable/Zelda/FrenchHorns_samples.h
  5. +2534
    -0
      examples/Synthesis/Wavetable/Zelda/MutedTrumpet_samples.cpp
  6. +3
    -0
      examples/Synthesis/Wavetable/Zelda/MutedTrumpet_samples.h
  7. +2537
    -0
      examples/Synthesis/Wavetable/Zelda/WT_Trumpet_samples.cpp
  8. +3
    -0
      examples/Synthesis/Wavetable/Zelda/WT_Trumpet_samples.h
  9. +13
    -21
      examples/Synthesis/Wavetable/Zelda/Zelda.ino

+ 0
- 7560
examples/Synthesis/Wavetable/Zelda/BasicFlute1_samples.cpp
Plik diff jest za duży
Wyświetl plik


+ 0
- 12
examples/Synthesis/Wavetable/Zelda/BasicFlute1_samples.h Wyświetl plik

@@ -1,12 +0,0 @@
#pragma once
#include <Audio.h>

extern const AudioSynthWavetable::sample_data BasicFlute1_samples[2];
const uint8_t BasicFlute1_ranges[] = {54, 127, };

const AudioSynthWavetable::instrument_data BasicFlute1 = {2, BasicFlute1_ranges, BasicFlute1_samples };


extern const uint32_t sample_0_BasicFlute1_BreathyFluteC2[28544];

extern const uint32_t sample_1_BasicFlute1_BreathyFluteA2[31616];

+ 0
- 6904
examples/Synthesis/Wavetable/Zelda/FrenchHorns_samples.cpp
Plik diff jest za duży
Wyświetl plik


+ 0
- 10
examples/Synthesis/Wavetable/Zelda/FrenchHorns_samples.h Wyświetl plik

@@ -1,10 +0,0 @@
#pragma once
#include <Audio.h>

extern const AudioSynthWavetable::sample_data FrenchHorns_samples[1];
const uint8_t FrenchHorns_ranges[] = {127, };

const AudioSynthWavetable::instrument_data FrenchHorns = {1, FrenchHorns_ranges, FrenchHorns_samples };


extern const uint32_t sample_0_FrenchHorns_FrenchHornsA4L[55040];

+ 2534
- 0
examples/Synthesis/Wavetable/Zelda/MutedTrumpet_samples.cpp
Plik diff jest za duży
Wyświetl plik


+ 3
- 0
examples/Synthesis/Wavetable/Zelda/MutedTrumpet_samples.h Wyświetl plik

@@ -0,0 +1,3 @@
#pragma once
#include <Audio.h>
extern const AudioSynthWavetable::instrument_data MutedTrumpet;

+ 2537
- 0
examples/Synthesis/Wavetable/Zelda/WT_Trumpet_samples.cpp
Plik diff jest za duży
Wyświetl plik


+ 3
- 0
examples/Synthesis/Wavetable/Zelda/WT_Trumpet_samples.h Wyświetl plik

@@ -0,0 +1,3 @@
#pragma once
#include <Audio.h>
extern const AudioSynthWavetable::instrument_data WT_Trumpet;

+ 13
- 21
examples/Synthesis/Wavetable/Zelda/Zelda.ino Wyświetl plik

@@ -1,6 +1,8 @@
/* Play Zelda music.
/* Play Zelda music, Overland Theme from The Wind Walker

Reference for this music:
https://www.youtube.com/watch?v=RekBzP114do&t=1091s

Requires Teensy 3.6 due to 520 kbytes of wavetable data
Requires Audio Shield: https://www.pjrc.com/store/teensy3_audio.html
*/

@@ -12,9 +14,9 @@
#include <SerialFlash.h>

#include "Pizzicato_samples.h"
#include "FrenchHorns_samples.h"
#include "Viola_samples.h"
#include "BasicFlute1_samples.h"
#include "WT_Trumpet_samples.h"
#include "MutedTrumpet_samples.h"
#include "PlaySynthMusic.h"

//#define DEBUG_ALLOC
@@ -97,12 +99,12 @@ void setup() {
for (int j = 0; j < 4; ++j)
mixer[i].gain(j, 0.25);
for (int i = 0; i < 4; ++i)
mixer[TOTAL_MIXERS - 1].gain(i, i < SECONDARY_MIXERS ? 1.0 / SECONDARY_MIXERS : 0.0);
mixer[TOTAL_MIXERS - 1].gain(i, 0.5);
usbMIDI.setHandleNoteOn(OnNoteOn);
usbMIDI.setHandleNoteOff(OnNoteOff);
//usbMIDI.setHandleNoteOn(OnNoteOn);
//usbMIDI.setHandleNoteOff(OnNoteOff);
//volumeTimer.begin(setVolume, 100000);
guitarHeroTimer.begin(guitarHeroMode, 1000000/120);
//guitarHeroTimer.begin(guitarHeroMode, 1000000/120);
//midiMapTimer.begin(printVoices, 5000);

delay(2000);
@@ -112,16 +114,6 @@ void loop() {
unsigned char c,opcode,chan;
unsigned long d_time;
// Volume control
// uncomment if you have a volume pot soldered to your audio shield
/*
int n = analogRead(15);
if (n != volume) {
volume = n;
codec.volume((float)n / 1023);
}
*/
// read the next note from the table
c = *sp++;
opcode = c & 0xF0;
@@ -151,10 +143,10 @@ void loop() {
wavetable[chan].setInstrument(Viola);
break;
case 57:
wavetable[chan].setInstrument(BasicFlute1);
wavetable[chan].setInstrument(WT_Trumpet);
break;
default:
wavetable[chan].setInstrument(FrenchHorns);
wavetable[chan].setInstrument(MutedTrumpet);
break;
}
return;
@@ -181,7 +173,7 @@ void loop() {
return;
}

usbMIDI.read();
//usbMIDI.read();
//for (int i = 0; i < TOTAL_BUTTONS; ++i) buttons[i].update();
//if (buttons[0].fallingEdge()) AudioSynthWavetable::print_performance();
//if (buttons[1].risingEdge()) {

Ładowanie…
Anuluj
Zapisz