From 064cf18f54d063d8cb193111097925703f270e13 Mon Sep 17 00:00:00 2001 From: dashodanger Date: Fri, 26 Jul 2024 08:32:23 -0600 Subject: [PATCH] MIDI updates --- libraries/steve/src/Steve.cpp | 2 +- libraries/steve/src/creator/Bass.cpp | 5 +- libraries/steve/src/creator/Drums.cpp | 55 ++- modules/midi_generation.lua | 1 + scripts/midi/relaxed.json | 526 ++++++++++++++---------- scripts/midi/safe.json | 570 +++++++++++++++----------- 6 files changed, 678 insertions(+), 481 deletions(-) diff --git a/libraries/steve/src/Steve.cpp b/libraries/steve/src/Steve.cpp index edacf83e5..5f48d13c9 100644 --- a/libraries/steve/src/Steve.cpp +++ b/libraries/steve/src/Steve.cpp @@ -102,7 +102,7 @@ void steve::add_note(Notes ¬es, uint8_t channel, uint8_t tone, size_t start, Note note; note.channel = channel; note.tone = tone; - note.velocity = clamp(velocity + Rand::next_velocity_jitter(), 0, 96); + note.velocity = clamp(velocity + Rand::next_velocity_jitter(), 0, 127); note.duration = length; notes.insert(make_pair(start, note)); } diff --git a/libraries/steve/src/creator/Bass.cpp b/libraries/steve/src/creator/Bass.cpp index 4f2459b45..e463bfcb6 100644 --- a/libraries/steve/src/creator/Bass.cpp +++ b/libraries/steve/src/creator/Bass.cpp @@ -10,9 +10,6 @@ Bass::Bass(Music *music) : Creator(music) void Bass::init() { Creator::init(); - - _min_tone = 36; - _max_tone = _min_tone + 12; } Notes Bass::get(size_t start, size_t size) const { @@ -34,5 +31,5 @@ Notes Bass::get(size_t start, size_t size) const } bool Bass::is_valid_instrument(const Instrument &instrument) const { - return instrument.midi_id >= 33 && instrument.midi_id <= 40; + return instrument.midi_id >= 32 && instrument.midi_id <= 39; } diff --git a/libraries/steve/src/creator/Drums.cpp b/libraries/steve/src/creator/Drums.cpp index d4e17ee3c..7c1cd1e78 100644 --- a/libraries/steve/src/creator/Drums.cpp +++ b/libraries/steve/src/creator/Drums.cpp @@ -5,6 +5,12 @@ using namespace steve; +static const std::vector bass = {35, 36}; +static const std::vector snare = {38, 40}; +static const std::vector tom = {41,43,45,47,48,50}; +static const std::vector hi_hat = {42,44,46}; +static const std::vector cymbal = {49,51,55,57,59}; + Drums::Drums(Music *music) : Creator(music) { } @@ -31,21 +37,56 @@ Notes Drums::get(size_t, size_t size) const uint32_t layers(Rand::next(2, 5)); for (uint32_t i(0); i < layers; i++) { - //uint8_t tone(Rand::next(35, 59)); - uint8_t tone(Rand::next(35, 36)); - NoteValue period_value = (max_period <= NoteValue::half) ? max_period : Rand::next(NoteValue::half, max_period); - uintptr_t period = ticks_for(period_value); - uintptr_t offset = ticks_for((period_value <= NoteValue::half) ? period_value : Rand::next(NoteValue::half, period_value)); + uint8_t tone; + NoteValue period_value; // = (max_period <= NoteValue::quarter) ? max_period : Rand::next(NoteValue::quarter, max_period); + //NoteValue period_value = Rand::next(NoteValue::eighth, max_period); + uintptr_t period;// = ticks_for(period_value); + //uintptr_t offset = ticks_for(Rand::next(NoteValue::eighth, period_value)); + uintptr_t offset;// = ticks_for((period_value <= NoteValue::quarter) ? period_value : Rand::next(NoteValue::quarter, period_value)); + switch (i) + { + case 0: + tone = Rand::in(bass); + period_value = (max_period <= NoteValue::half) ? max_period : Rand::next(NoteValue::half, max_period); + period = ticks_for(period_value); + offset = ticks_for((period_value <= NoteValue::quarter) ? period_value : Rand::next(NoteValue::quarter, period_value)); + break; + case 1: + tone = Rand::in(snare); + period_value = (max_period <= NoteValue::quarter) ? max_period : Rand::next(NoteValue::quarter, max_period); + period = ticks_for(period_value); + offset = ticks_for((period_value <= NoteValue::eighth) ? period_value : Rand::next(NoteValue::eighth, period_value)); + break; + case 2: + tone = Rand::in(tom); + period_value = (max_period <= NoteValue::eighth) ? max_period : Rand::next(NoteValue::eighth, max_period); + period = ticks_for(period_value); + offset = ticks_for((period_value <= NoteValue::sixteenth) ? period_value : Rand::next(NoteValue::sixteenth, period_value)); + break; + case 3: + tone = Rand::in(hi_hat); + period_value = (max_period <= NoteValue::eighth) ? max_period : Rand::next(NoteValue::eighth, max_period); + period = ticks_for(period_value); + offset = ticks_for((period_value <= NoteValue::sixteenth) ? period_value : Rand::next(NoteValue::sixteenth, period_value)); + break; + case 4: + tone = Rand::in(cymbal); + period_value = (max_period <= NoteValue::eighth) ? max_period : Rand::next(NoteValue::eighth, max_period); + period = ticks_for(period_value); + offset = ticks_for((period_value <= NoteValue::sixteenth) ? period_value : Rand::next(NoteValue::sixteenth, period_value)); + break; + default: + break; + } if (i == 0 || Rand::next(0, 3) > 0) { offset = 0; } - for (uintptr_t j(offset); j < size; j += period) { if (_music->is_beat(j)) { - add_note(notes, _channel, tone, j, 1, 64); + add_note(notes, _channel, tone, j, 1, 100); } } } diff --git a/modules/midi_generation.lua b/modules/midi_generation.lua index 0649f3420..d59cb8362 100644 --- a/modules/midi_generation.lua +++ b/modules/midi_generation.lua @@ -12,6 +12,7 @@ end function MIDI_CONFIG.all_done() for _,song in pairs(GAME.RESOURCES.MUSIC_LUMPS) do + gui.prog_step("Generating MIDI...") if gui.generate_midi_track("scripts/midi/" .. PARAM.midi_config_selection .. ".json", "temp/" .. song .. ".mid") == 1 then if ob_mod_enabled("compress_output") == 1 then gui.pk3_insert_file("temp/" .. song .. ".mid", "music/" .. song .. ".mid") diff --git a/scripts/midi/relaxed.json b/scripts/midi/relaxed.json index deb97ee15..aae440d21 100644 --- a/scripts/midi/relaxed.json +++ b/scripts/midi/relaxed.json @@ -186,601 +186,675 @@ "instruments": { "Acoustic Grand Piano": { "index": 0, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 21, + "max_tone": 108, "voices": 10 }, "Bright Acoustic Piano": { "index": 1, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 21, + "max_tone": 108, "voices": 10 }, "Electric Grand Piano": { "index": 2, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 21, + "max_tone": 108, "voices": 10 }, "Honky Tonk Piano": { "index": 3, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 21, + "max_tone": 108, "voices": 10 }, "Electric Piano 1": { "index": 4, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 21, + "max_tone": 108, "voices": 10 }, "Electric Piano 2": { "index": 5, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 21, + "max_tone": 108, "voices": 10 }, "Harpsichord": { "index": 6, - "min_tone": "F1", - "max_tone": "F6", + "min_tone": 29, + "max_tone": 89, "voices": 10 }, "Clavinet": { "index": 7, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 29, + "max_tone": 89, "voices": 10 }, "Celesta": { "index": 8, - "min_tone": "C4", - "max_tone": "C8", + "min_tone": 60, + "max_tone": 108, "voices": 10 }, "Glockenspiel": { "index": 9, - "min_tone": "G5", - "max_tone": "C8" + "min_tone": 79, + "max_tone": 108 }, "Music Box": { "index": 10, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 79, + "max_tone": 108, "voices": 10 }, "Vibraphone": { "index": 11, - "min_tone": "F3", - "max_tone": "F6" + "min_tone": 53, + "max_tone": 89 }, "Marimba": { "index": 12, - "min_tone": "C2", - "max_tone": "C7" + "min_tone": 36, + "max_tone": 96 }, "Xylophone": { "index": 13, - "min_tone": "F3", - "max_tone": "C8" + "min_tone": 79, + "max_tone": 108 }, "Tubular Bells": { "index": 14, - "min_tone": "F3", - "max_tone": "G5" + "min_tone": 72, + "max_tone": 91 }, "Dulcimer": { "index": 15, - "min_tone": "A2", - "max_tone": "A6" + "min_tone": 40, + "max_tone": 76 }, "Drawbar Organ": { "index": 16, - "min_tone": "C2", - "max_tone": "C7", + "min_tone": 36, + "max_tone": 96, "voices": 10 }, "Percussive Organ": { "index": 17, - "min_tone": "C2", - "max_tone": "C7", + "min_tone": 36, + "max_tone": 96, "voices": 10 }, "Rock Organ": { "index": 18, - "min_tone": "C2", - "max_tone": "C7", + "min_tone": 36, + "max_tone": 96, "voices": 10 }, "Church Organ": { "index": 19, - "min_tone": "C-1", - "max_tone": "G9", + "min_tone": 36, + "max_tone": 96, "voices": 10 }, "Reed Organ": { "index": 20, - "min_tone": "C2", - "max_tone": "C7", + "min_tone": 36, + "max_tone": 96, "voices": 10 }, "Accordion": { "index": 21, - "min_tone": "D2", - "max_tone": "D8", + "min_tone": 36, + "max_tone": 96, "voices": 5 }, "Harmonica": { "index": 22, - "min_tone": "C2", - "max_tone": "C7" + "min_tone": 36, + "max_tone": 96 }, "Tango Accordion": { "index": 23, - "min_tone": "C2", - "max_tone": "C7", + "min_tone": 36, + "max_tone": 96, "voices": 5 }, "Acoustic Guitar (Nylon)": { "index": 24, - "min_tone": "E2", - "max_tone": "C6", + "min_tone": 40, + "max_tone": 76, "voices": 6 }, "Acoustic Guitar (Steel)": { "index": 25, - "min_tone": "E2", - "max_tone": "C6", + "min_tone": 40, + "max_tone": 76, "voices": 6 }, "Electric Guitar (Jazz)": { "index": 26, - "min_tone": "E2", - "max_tone": "C6", + "min_tone": 40, + "max_tone": 76, "voices": 6 }, "Electric Guitar (Clean)": { "index": 27, - "min_tone": "E2", - "max_tone": "C6", + "min_tone": 40, + "max_tone": 76, "voices": 6 }, "Electric Guitar (Muted)": { "index": 28, - "min_tone": "E2", - "max_tone": "C6", + "min_tone": 40, + "max_tone": 76, "voices": 6 }, "Overdriven Guitar": { "index": 29, - "min_tone": "E2", - "max_tone": "C6", + "min_tone": 40, + "max_tone": 76, "voices": 6 }, "Distorted Guitar": { "index": 30, - "min_tone": "E2", - "max_tone": "C6", + "min_tone": 40, + "max_tone": 76, "voices": 6 }, "Guitar Harmonics": { "index": 31, - "min_tone": "E2", - "max_tone": "C6", + "min_tone": 40, + "max_tone": 76, "voices": 6 }, "Acoustic Bass": { "index": 32, - "min_tone": "E1", - "max_tone": "G4", - "voices": 4 + "min_tone": 24, + "max_tone": 60, + "voices": 1 }, "Electric Fingered Bass": { "index": 33, - "min_tone": "E1", - "max_tone": "G4", - "voices": 4 + "min_tone": 24, + "max_tone": 60, + "voices": 1 }, "Electric Picked Bass": { "index": 34, - "min_tone": "E1", - "max_tone": "G4", - "voices": 4 + "min_tone": 24, + "max_tone": 60, + "voices": 1 }, "Fretless Bass": { "index": 35, - "min_tone": "E1", - "max_tone": "G4", - "voices": 4 + "min_tone": 24, + "max_tone": 60, + "voices": 1 }, "Slap Bass 1": { "index": 36, - "min_tone": "E1", - "max_tone": "G4", - "voices": 4 + "min_tone": 24, + "max_tone": 60, + "voices": 1 }, "Slap Bass 2": { "index": 37, - "min_tone": "E1", - "max_tone": "G4", - "voices": 4 + "min_tone": 24, + "max_tone": 60, + "voices": 1 }, "Syn Bass 1": { "index": 38, - "min_tone": "E1", - "max_tone": "G4", - "voices": 4 + "min_tone": 24, + "max_tone": 60, + "voices": 1 }, "Syn Bass 2": { "index": 39, - "min_tone": "E1", - "max_tone": "G4", - "voices": 4 + "min_tone": 24, + "max_tone": 60, + "voices": 1 }, "Violin": { "index": 40, - "min_tone": "G3", - "max_tone": "G7" + "min_tone": "G2", + "max_tone": "A6" }, "Viola": { "index": 41, - "min_tone": "C3", - "max_tone": "C7" + "min_tone": 55, + "max_tone": 105 }, "Cello": { "index": 42, - "min_tone": "C2", - "max_tone": "C6" + "min_tone": 36, + "max_tone": 84 }, "Contrabass": { "index": 43, - "min_tone": "E1", - "max_tone": "D4" + "min_tone": 24, + "max_tone": 60 }, "Tremolo Strings": { "index": 44, - "min_tone": "C3", - "max_tone": "C6" + "min_tone": 36, + "max_tone": 105 }, "Pizzicato Strings": { "index": 45, - "min_tone": "C3", - "max_tone": "C6" + "min_tone": 36, + "max_tone": 105 }, "Orchestral Harp": { "index": 46, - "min_tone": "B0", - "max_tone": "G7" + "min_tone": 23, + "max_tone": 104 }, "Timpani": { "index": 47, - "min_tone": "D2", - "max_tone": "A3" + "min_tone": 36, + "max_tone": 57 }, "String Ensemble": { "index": 48, - "min_tone": "G3", - "max_tone": "C5" + "min_tone": 36, + "max_tone": 105 }, "String Ensemble 2 (Slow)": { "index": 49, - "min_tone": "G3", - "max_tone": "C5" + "min_tone": 36, + "max_tone": 105 }, "Syn Strings 1": { "index": 50, - "min_tone": "G3", - "max_tone": "C5" + "min_tone": 36, + "max_tone": 105 }, "Syn Strings 2": { "index": 51, - "min_tone": "G3", - "max_tone": "C5" + "min_tone": 36, + "max_tone": 105 }, "Choir Aahs": { "index": 52, - "min_tone": "E2", - "max_tone": "A#5" + "min_tone": 41, + "max_tone": 84 }, "Voice Oohs": { "index": 53, - "min_tone": "E2", - "max_tone": "A#5" + "min_tone": 41, + "max_tone": 84 }, "Syn Choir": { "index": 54, - "min_tone": "E2", - "max_tone": "A#5" + "min_tone": 41, + "max_tone": 84 }, "Orchestral Hit": { "index": 55, - "min_tone": "C3", - "max_tone": "C6" + "min_tone": 24, + "max_tone": 108 }, "Trumpet": { "index": 56, - "min_tone": "E2", - "max_tone": "C6" + "min_tone": 54, + "max_tone": 86 }, "Trombone": { "index": 57, - "min_tone": "B1", - "max_tone": "A#4" + "min_tone": 40, + "max_tone": 77 }, "Tuba": { "index": 58, - "min_tone": "E1", - "max_tone": "F4" + "min_tone": 19, + "max_tone": 72 }, "Muted Trumpet": { "index": 59, - "min_tone": "E2", - "max_tone": "C6" + "min_tone": 54, + "max_tone": 86 }, "French Horn": { "index": 60, - "min_tone": "B1", - "max_tone": "F5" + "min_tone": 38, + "max_tone": 60 }, "Brass Section": { "index": 61, - "min_tone": "E2", - "max_tone": "E4" + "min_tone": 38, + "max_tone": 86 }, "Synth Brass 1": { "index": 62, - "min_tone": 28, - "max_tone": 67 + "min_tone": 38, + "max_tone": 86 }, "Synth Brass 2": { "index": 63, - "min_tone": 28, - "max_tone": 67 + "min_tone": 38, + "max_tone": 86 }, "Soprano Sax": { "index": 64, - "min_tone": "G#3", - "max_tone": "E6" + "min_tone": 56, + "max_tone": 89 }, "Alto Sax": { "index": 65, - "min_tone": "C#3", - "max_tone": "G#5" + "min_tone": 52, + "max_tone": 88 }, "Tenor Sax": { "index": 66, - "min_tone": "G#2", - "max_tone": "E5" + "min_tone": 46, + "max_tone": 77 }, "Baritone Sax": { "index": 67, - "min_tone": "C2", - "max_tone": "A4" + "min_tone": 40, + "max_tone": 74 }, "Oboe": { "index": 68, - "min_tone": "A#3", - "max_tone": "G6" + "min_tone": 58, + "max_tone": 93 }, "English Horn": { "index": 69, - "min_tone": "E3", - "max_tone": "C6" + "min_tone": 58, + "max_tone": 93 }, "Bassoon": { "index": 70, - "min_tone": "A#1", - "max_tone": "E5" + "min_tone": 34, + "max_tone": 75 }, "Clarinet": { "index": 71, - "min_tone": "C#2", - "max_tone": "G6" + "min_tone": 50, + "max_tone": 106 }, "Piccolo": { "index": 72, - "min_tone": "D5", - "max_tone": "C8" + "min_tone": 74, + "max_tone": 110 }, "Flute": { "index": 73, - "min_tone": "C4", - "max_tone": "C7" + "min_tone": 60, + "max_tone": 98 }, "Recorder": { "index": 74, - "min_tone": "F3", - "max_tone": "G7" + "min_tone": 60, + "max_tone": 98 }, "Pan Flute": { "index": 75, - "min_tone": "B3", - "max_tone": "G7" + "min_tone": 60, + "max_tone": 98 }, "Bottle Blow": { "index": 76, - "min_tone": 36, - "max_tone": 95 + "min_tone": 60, + "max_tone": 98 }, "Shakuhachi": { "index": 77, - "min_tone": "D4", - "max_tone": "E6" + "min_tone": 60, + "max_tone": 98 }, "Whistle": { "index": 78, "min_tone": 60, - "max_tone": 84 + "max_tone": 98 }, "Ocarina": { "index": 79, - "min_tone": "C4", - "max_tone": "C7" + "min_tone": 60, + "max_tone": 98 }, "Lead 1 (Square)": { - "index": 80 + "index": 80, + "min_tone": 0, + "max_tone": 127 }, "Lead 2 (Sawtooth)": { - "index": 81 + "index": 81, + "min_tone": 0, + "max_tone": 127 }, "Lead 3 (Calliope)": { - "index": 82 + "index": 82, + "min_tone": 0, + "max_tone": 127 }, "Lead 4 (Chiff)": { - "index": 83 + "index": 83, + "min_tone": 0, + "max_tone": 127 }, "Lead 5 (Charang)": { - "index": 84 + "index": 84, + "min_tone": 0, + "max_tone": 127 }, "Lead 6 (Voice)": { - "index": 85 + "index": 85, + "min_tone": 0, + "max_tone": 127 }, "Lead 7 (Fifths)": { - "index": 86 + "index": 86, + "min_tone": 0, + "max_tone": 127 }, "Lead 8 (Bass + Lead)": { - "index": 87 + "index": 87, + "min_tone": 0, + "max_tone": 127 }, "Pad 1 (New Age)": { - "index": 88 + "index": 88, + "min_tone": 0, + "max_tone": 127 }, "Pad 2 (Warm)": { - "index": 89 + "index": 89, + "min_tone": 0, + "max_tone": 127 }, "Pad 3 (Polysynth)": { - "index": 90 + "index": 90, + "min_tone": 0, + "max_tone": 127 }, "Pad 4 (Choir)": { - "index": 91 + "index": 91, + "min_tone": 0, + "max_tone": 127 }, "Pad 5 (Bowed)": { - "index": 92 + "index": 92, + "min_tone": 0, + "max_tone": 127 }, "Pad 6 (Metallic)": { - "index": 93 + "index": 93, + "min_tone": 0, + "max_tone": 127 }, "Pad 7 (Halo)": { - "index": 94 + "index": 94, + "min_tone": 0, + "max_tone": 127 }, "FX 1 (Rain)": { - "index": 96 + "index": 96, + "min_tone": 0, + "max_tone": 127 }, "FX 2 (Soundtrack)": { - "index": 97 + "index": 97, + "min_tone": 0, + "max_tone": 127 }, "FX 3 (Crystal)": { - "index": 98 + "index": 98, + "min_tone": 0, + "max_tone": 127 }, "FX 4 (Atmosphere)": { - "index": 99 + "index": 99, + "min_tone": 0, + "max_tone": 127 }, "FX 5 (Brightness)": { - "index": 100 + "index": 100, + "min_tone": 0, + "max_tone": 127 }, "FX 6 (Goblins)": { - "index": 101 + "index": 101, + "min_tone": 0, + "max_tone": 127 }, "FX 7 (Echoes)": { - "index": 102 + "index": 102, + "min_tone": 0, + "max_tone": 127 }, "FX 8 (Sci-Fi)": { - "index": 103 + "index": 103, + "min_tone": 0, + "max_tone": 127 }, "Sitar": { "index": 104, - "min_tone": "C2", - "max_tone": "E5", + "min_tone": 0, + "max_tone": 127, "voices": 7 }, "Banjo": { "index": 105, - "min_tone": "C3", - "max_tone": "C6", + "min_tone": 48, + "max_tone": 69, "voices": 5 }, "Shamisen": { "index": 106, - "min_tone": "D4", - "max_tone": "F6", - "voices": 3 + "voices": 3, + "min_tone": 0, + "max_tone": 127 }, "Koto": { "index": 107, - "min_tone": "A1", - "max_tone": "A7", - "voices": 17 + "voices": 17, + "min_tone": 0, + "max_tone": 127 }, "Kalimba": { "index": 108, - "min_tone": "G3", - "max_tone": "D6" + "min_tone": 0, + "max_tone": 127 }, "Bag Pipe": { "index": 109, - "min_tone": "A4", - "max_tone": "A#5" + "min_tone": 0, + "max_tone": 127 }, "Fiddle": { "index": 110, - "min_tone": "G3", - "max_tone": "G7" + "min_tone": 0, + "max_tone": 127 }, "Shanai": { "index": 111, - "min_tone": "A3", - "max_tone": "A5" + "min_tone": 0, + "max_tone": 127 }, "Tinkle Bell": { "index": 112, - "min_tone": "C#4", - "max_tone": "A6" + "min_tone": 0, + "max_tone": 127 }, "Agogo": { - "index": 113 + "index": 113, + "min_tone": 0, + "max_tone": 127 }, "Steel Drums": { "index": 114, - "min_tone": "F1", - "max_tone": "G6" + "min_tone": 0, + "max_tone": 127 }, "Woodblock": { - "index": 115 + "index": 115, + "min_tone": 0, + "max_tone": 127 }, "Taiko Drum": { - "index": 116 + "index": 116, + "min_tone": 0, + "max_tone": 127 }, "Melodic Tom": { - "index": 117 + "index": 117, + "min_tone": 0, + "max_tone": 127 }, "Synth Drum": { - "index": 118 + "index": 118, + "min_tone": 0, + "max_tone": 127 }, "Reverse Cymbal": { - "index": 119 + "index": 119, + "min_tone": 0, + "max_tone": 127 }, "Guitar Fret Noise": { - "index": 120 + "index": 120, + "min_tone": 0, + "max_tone": 127 }, "Breath Noise": { - "index": 121 + "index": 121, + "min_tone": 0, + "max_tone": 127 }, "Seashore": { - "index": 122 + "index": 122, + "min_tone": 0, + "max_tone": 127 }, "Bird Tweet": { - "index": 123 + "index": 123, + "min_tone": 0, + "max_tone": 127 }, "Telephone Ring": { - "index": 124 + "index": 124, + "min_tone": 0, + "max_tone": 127 }, "Helicopter": { - "index": 125 + "index": 125, + "min_tone": 0, + "max_tone": 127 }, "Applause": { - "index": 126 + "index": 126, + "min_tone": 0, + "max_tone": 127 }, "Gunshot": { - "index": 127 + "index": 127, + "min_tone": 0, + "max_tone": 127 } } } diff --git a/scripts/midi/safe.json b/scripts/midi/safe.json index 43fe18e56..73b59a4c4 100644 --- a/scripts/midi/safe.json +++ b/scripts/midi/safe.json @@ -1,6 +1,6 @@ { "min_tempo": 80, - "max_tempo": 100, + "max_tempo": 120, "time_signatures": { "2/2":{}, "2/4":{}, "3/4":{}, "3/8": {}, "4/4":{}, "5/4":{}, "6/4":{}, "6/8":{}, "7/4":{}, "9/8":{}, "12/8": {} }, @@ -138,28 +138,34 @@ "tones": [2,4,5,7,9,11] }, "Harmonic Major": { - "tones": [2,4,5,7,8,11] + "tones": [2,4,5,7,8,11], + "whitelist": true }, "Minor": { "tones": [2,3,5,7,8,10] }, "Harmonic Minor": { - "tones": [2,3,5,7,8,11] + "tones": [2,3,5,7,8,11], + "whitelist": true }, "Melodic Minor": { "tones": [2,3,5,7,9,11] }, "Pentatonic Major": { - "tones": [2,4,7,9] + "tones": [2,4,7,9], + "whitelist": true }, "Pentatonic Minor": { - "tones": [3,5,7,10] + "tones": [3,5,7,10], + "whitelist": true }, "Major Blues": { - "tones": [2,3,4,7,9] + "tones": [2,3,4,7,9], + "whitelist": true }, "Minor Blues": { - "tones": [3,5,6,7,10] + "tones": [3,5,6,7,10], + "whitelist": true }, "Mixolydian": { "tones": [2,4,5,7,9,10] @@ -186,7 +192,7 @@ "max_count": 0 }, "Bass": { - "min_count": 2, + "min_count": 1, "max_count": 3 }, "Chords": { @@ -194,11 +200,11 @@ "max_count": 0 }, "Drums": { - "min_count": 1, + "min_count": 0, "max_count": 1 }, "Melody": { - "min_count": 2, + "min_count": 1, "max_count": 3 } }, @@ -231,613 +237,691 @@ "instruments": { "Acoustic Grand Piano": { "index": 0, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 21, + "max_tone": 108, "voices": 10 }, "Bright Acoustic Piano": { "index": 1, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 21, + "max_tone": 108, "voices": 10 }, "Electric Grand Piano": { "index": 2, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 21, + "max_tone": 108, "voices": 10 }, "Honky Tonk Piano": { "index": 3, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 21, + "max_tone": 108, "voices": 10 }, "Electric Piano 1": { "index": 4, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 21, + "max_tone": 108, "voices": 10 }, "Electric Piano 2": { "index": 5, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 21, + "max_tone": 108, "voices": 10 }, "Harpsichord": { "index": 6, - "min_tone": "F1", - "max_tone": "F6", + "min_tone": 29, + "max_tone": 89, "voices": 10 }, "Clavinet": { "index": 7, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 29, + "max_tone": 89, "voices": 10 }, "Celesta": { "index": 8, - "min_tone": "C4", - "max_tone": "C8", + "min_tone": 60, + "max_tone": 108, "voices": 10 }, "Glockenspiel": { "index": 9, - "min_tone": "G5", - "max_tone": "C8" + "min_tone": 79, + "max_tone": 108 }, "Music Box": { "index": 10, - "min_tone": "A0", - "max_tone": "C8", + "min_tone": 79, + "max_tone": 108, "voices": 10 }, "Vibraphone": { "index": 11, - "min_tone": "F3", - "max_tone": "F6" + "min_tone": 53, + "max_tone": 89 }, "Marimba": { "index": 12, - "min_tone": "C2", - "max_tone": "C7" + "min_tone": 36, + "max_tone": 96 }, "Xylophone": { "index": 13, - "min_tone": "F3", - "max_tone": "C8" + "min_tone": 79, + "max_tone": 108 }, "Tubular Bells": { "index": 14, - "min_tone": "F3", - "max_tone": "G5" + "min_tone": 72, + "max_tone": 91 }, "Dulcimer": { "index": 15, - "min_tone": "A2", - "max_tone": "A6" + "min_tone": 40, + "max_tone": 76 }, "Drawbar Organ": { "index": 16, - "min_tone": "C2", - "max_tone": "C7", + "min_tone": 36, + "max_tone": 96, "voices": 10 }, "Percussive Organ": { "index": 17, - "min_tone": "C2", - "max_tone": "C7", + "min_tone": 36, + "max_tone": 96, "voices": 10 }, "Rock Organ": { "index": 18, - "min_tone": "C2", - "max_tone": "C7", + "min_tone": 36, + "max_tone": 96, "voices": 10 }, "Church Organ": { "index": 19, - "min_tone": "C-1", - "max_tone": "G9", + "min_tone": 36, + "max_tone": 96, "voices": 10 }, "Reed Organ": { "index": 20, - "min_tone": "C2", - "max_tone": "C7", + "min_tone": 36, + "max_tone": 96, "voices": 10 }, "Accordion": { "index": 21, - "min_tone": "D2", - "max_tone": "D8", + "min_tone": 36, + "max_tone": 96, "voices": 5 }, "Harmonica": { "index": 22, - "min_tone": "C2", - "max_tone": "C7" + "min_tone": 36, + "max_tone": 96 }, "Tango Accordion": { "index": 23, - "min_tone": "C2", - "max_tone": "C7", + "min_tone": 36, + "max_tone": 96, "voices": 5 }, "Acoustic Guitar (Nylon)": { "index": 24, - "min_tone": "E2", - "max_tone": "C6", + "min_tone": 40, + "max_tone": 76, "voices": 6 }, "Acoustic Guitar (Steel)": { "index": 25, - "min_tone": "E2", - "max_tone": "C6", + "min_tone": 40, + "max_tone": 76, "voices": 6 }, "Electric Guitar (Jazz)": { "index": 26, - "min_tone": "E2", - "max_tone": "C6", + "min_tone": 40, + "max_tone": 76, "voices": 6 }, "Electric Guitar (Clean)": { "index": 27, - "min_tone": "E2", - "max_tone": "C6", - "voices": 6 + "min_tone": 40, + "max_tone": 76, + "voices": 6, + "whitelist": true }, "Electric Guitar (Muted)": { "index": 28, - "min_tone": "E2", - "max_tone": "C6", - "voices": 6 + "min_tone": 40, + "max_tone": 76, + "voices": 6, + "whitelist": true }, "Overdriven Guitar": { "index": 29, - "min_tone": "E2", - "max_tone": "C6", - "voices": 6 + "min_tone": 40, + "max_tone": 76, + "voices": 6, + "whitelist": true }, "Distorted Guitar": { "index": 30, - "min_tone": "E2", - "max_tone": "C6", - "voices": 6 + "min_tone": 40, + "max_tone": 76, + "voices": 6, + "whitelist": true }, "Guitar Harmonics": { "index": 31, - "min_tone": "E2", - "max_tone": "C6", + "min_tone": 40, + "max_tone": 76, "voices": 6, - "blacklist": true + "whitelist": true }, "Acoustic Bass": { "index": 32, - "min_tone": "E1", - "max_tone": "G4", - "voices": 1 + "min_tone": 24, + "max_tone": 60, + "voices": 1, + "whitelist": true }, "Electric Fingered Bass": { "index": 33, - "min_tone": "E1", - "max_tone": "G4", - "voices": 1 + "min_tone": 24, + "max_tone": 60, + "voices": 1, + "whitelist": true }, "Electric Picked Bass": { "index": 34, - "min_tone": "E1", - "max_tone": "G4", - "voices": 1 + "min_tone": 24, + "max_tone": 60, + "voices": 1, + "whitelist": true }, "Fretless Bass": { "index": 35, - "min_tone": "E1", - "max_tone": "G4", - "voices": 1 + "min_tone": 24, + "max_tone": 60, + "voices": 1, + "whitelist": true }, "Slap Bass 1": { "index": 36, - "min_tone": "E1", - "max_tone": "G4", - "voices": 1 + "min_tone": 24, + "max_tone": 60, + "voices": 1, + "whitelist": true }, "Slap Bass 2": { "index": 37, - "min_tone": "E1", - "max_tone": "G4", - "voices": 1 + "min_tone": 24, + "max_tone": 60, + "voices": 1, + "whitelist": true }, "Syn Bass 1": { "index": 38, - "min_tone": "E1", - "max_tone": "G4", - "voices": 1 + "min_tone": 24, + "max_tone": 60, + "voices": 1, + "whitelist": true }, "Syn Bass 2": { "index": 39, - "min_tone": "E1", - "max_tone": "G4", - "voices": 1 + "min_tone": 24, + "max_tone": 60, + "voices": 1, + "whitelist": true }, "Violin": { "index": 40, - "min_tone": "G3", - "max_tone": "G7" + "min_tone": "G2", + "max_tone": "A6" }, "Viola": { "index": 41, - "min_tone": "C3", - "max_tone": "C7" + "min_tone": 55, + "max_tone": 105 }, "Cello": { "index": 42, - "min_tone": "C2", - "max_tone": "C6" + "min_tone": 36, + "max_tone": 84 }, "Contrabass": { "index": 43, - "min_tone": "E1", - "max_tone": "D4" + "min_tone": 24, + "max_tone": 60 }, "Tremolo Strings": { "index": 44, - "min_tone": "C3", - "max_tone": "C6" + "min_tone": 36, + "max_tone": 105 }, "Pizzicato Strings": { "index": 45, - "min_tone": "C3", - "max_tone": "C6" + "min_tone": 36, + "max_tone": 105 }, "Orchestral Harp": { "index": 46, - "min_tone": "B0", - "max_tone": "G7" + "min_tone": 23, + "max_tone": 104 }, "Timpani": { "index": 47, - "min_tone": "D2", - "max_tone": "A3" + "min_tone": 36, + "max_tone": 57 }, "String Ensemble": { "index": 48, - "min_tone": "G3", - "max_tone": "C5" + "min_tone": 36, + "max_tone": 105, + "whitelist": true }, "String Ensemble 2 (Slow)": { "index": 49, - "min_tone": "G3", - "max_tone": "C5" + "min_tone": 36, + "max_tone": 105, + "whitelist": true }, "Syn Strings 1": { "index": 50, - "min_tone": "G3", - "max_tone": "C5" + "min_tone": 36, + "max_tone": 105 }, "Syn Strings 2": { "index": 51, - "min_tone": "G3", - "max_tone": "C5" + "min_tone": 36, + "max_tone": 105 }, "Choir Aahs": { "index": 52, - "min_tone": "E2", - "max_tone": "A#5" + "min_tone": 41, + "max_tone": 84 }, "Voice Oohs": { "index": 53, - "min_tone": "E2", - "max_tone": "A#5" + "min_tone": 41, + "max_tone": 84 }, "Syn Choir": { "index": 54, - "min_tone": "E2", - "max_tone": "A#5" + "min_tone": 41, + "max_tone": 84 }, "Orchestral Hit": { "index": 55, - "min_tone": "C3", - "max_tone": "C6" + "min_tone": 24, + "max_tone": 108 }, "Trumpet": { "index": 56, - "min_tone": "E2", - "max_tone": "C6" + "min_tone": 54, + "max_tone": 86 }, "Trombone": { "index": 57, - "min_tone": "B1", - "max_tone": "A#4" + "min_tone": 40, + "max_tone": 77 }, "Tuba": { "index": 58, - "min_tone": "E1", - "max_tone": "F4" + "min_tone": 19, + "max_tone": 72 }, "Muted Trumpet": { "index": 59, - "min_tone": "E2", - "max_tone": "C6" + "min_tone": 54, + "max_tone": 86 }, "French Horn": { "index": 60, - "min_tone": "B1", - "max_tone": "F5" + "min_tone": 38, + "max_tone": 60 }, "Brass Section": { "index": 61, - "min_tone": "E2", - "max_tone": "E4" + "min_tone": 38, + "max_tone": 86 }, "Synth Brass 1": { "index": 62, - "min_tone": 28, - "max_tone": 67 + "min_tone": 38, + "max_tone": 86 }, "Synth Brass 2": { "index": 63, - "min_tone": 28, - "max_tone": 67 + "min_tone": 38, + "max_tone": 86 }, "Soprano Sax": { "index": 64, - "min_tone": "G#3", - "max_tone": "E6" + "min_tone": 56, + "max_tone": 89 }, "Alto Sax": { "index": 65, - "min_tone": "C#3", - "max_tone": "G#5" + "min_tone": 52, + "max_tone": 88 }, "Tenor Sax": { "index": 66, - "min_tone": "G#2", - "max_tone": "E5" + "min_tone": 46, + "max_tone": 77 }, "Baritone Sax": { "index": 67, - "min_tone": "C2", - "max_tone": "A4" + "min_tone": 40, + "max_tone": 74 }, "Oboe": { "index": 68, - "min_tone": "A#3", - "max_tone": "G6" + "min_tone": 58, + "max_tone": 93 }, "English Horn": { "index": 69, - "min_tone": "E3", - "max_tone": "C6" + "min_tone": 58, + "max_tone": 93 }, "Bassoon": { "index": 70, - "min_tone": "A#1", - "max_tone": "E5" + "min_tone": 34, + "max_tone": 75 }, "Clarinet": { "index": 71, - "min_tone": "C#2", - "max_tone": "G6" + "min_tone": 50, + "max_tone": 106 }, "Piccolo": { "index": 72, - "min_tone": "D5", - "max_tone": "C8" + "min_tone": 74, + "max_tone": 110 }, "Flute": { "index": 73, - "min_tone": "C4", - "max_tone": "C7" + "min_tone": 60, + "max_tone": 98 }, "Recorder": { "index": 74, - "min_tone": "F3", - "max_tone": "G7" + "min_tone": 60, + "max_tone": 98 }, "Pan Flute": { "index": 75, - "min_tone": "B3", - "max_tone": "G7" + "min_tone": 60, + "max_tone": 98 }, "Bottle Blow": { "index": 76, - "min_tone": 36, - "max_tone": 95, - "blacklist": true + "min_tone": 60, + "max_tone": 98 }, "Shakuhachi": { "index": 77, - "min_tone": "D4", - "max_tone": "E6" + "min_tone": 60, + "max_tone": 98 }, "Whistle": { "index": 78, "min_tone": 60, - "max_tone": 84, - "blacklist": true + "max_tone": 98 }, "Ocarina": { "index": 79, - "min_tone": "C4", - "max_tone": "C7" + "min_tone": 60, + "max_tone": 98 }, "Lead 1 (Square)": { - "index": 80 + "index": 80, + "min_tone": 0, + "max_tone": 127 }, "Lead 2 (Sawtooth)": { - "index": 81 + "index": 81, + "min_tone": 0, + "max_tone": 127 }, "Lead 3 (Calliope)": { - "index": 82 + "index": 82, + "min_tone": 0, + "max_tone": 127 }, "Lead 4 (Chiff)": { - "index": 83 + "index": 83, + "min_tone": 0, + "max_tone": 127 }, "Lead 5 (Charang)": { - "index": 84 + "index": 84, + "min_tone": 0, + "max_tone": 127 }, "Lead 6 (Voice)": { - "index": 85 + "index": 85, + "min_tone": 0, + "max_tone": 127 }, "Lead 7 (Fifths)": { - "index": 86 + "index": 86, + "min_tone": 0, + "max_tone": 127 }, "Lead 8 (Bass + Lead)": { - "index": 87 + "index": 87, + "min_tone": 0, + "max_tone": 127 }, "Pad 1 (New Age)": { - "index": 88 + "index": 88, + "min_tone": 0, + "max_tone": 127 }, "Pad 2 (Warm)": { - "index": 89 + "index": 89, + "min_tone": 0, + "max_tone": 127 }, "Pad 3 (Polysynth)": { - "index": 90 + "index": 90, + "min_tone": 0, + "max_tone": 127 }, "Pad 4 (Choir)": { - "index": 91 + "index": 91, + "min_tone": 0, + "max_tone": 127 }, "Pad 5 (Bowed)": { - "index": 92 + "index": 92, + "min_tone": 0, + "max_tone": 127 }, "Pad 6 (Metallic)": { - "index": 93 + "index": 93, + "min_tone": 0, + "max_tone": 127 }, "Pad 7 (Halo)": { - "index": 94 + "index": 94, + "min_tone": 0, + "max_tone": 127 }, "FX 1 (Rain)": { - "index": 96 + "index": 96, + "min_tone": 0, + "max_tone": 127 }, "FX 2 (Soundtrack)": { - "index": 97 + "index": 97, + "min_tone": 0, + "max_tone": 127 }, "FX 3 (Crystal)": { - "index": 98 + "index": 98, + "min_tone": 0, + "max_tone": 127 }, "FX 4 (Atmosphere)": { - "index": 99 + "index": 99, + "min_tone": 0, + "max_tone": 127 }, "FX 5 (Brightness)": { - "index": 100 + "index": 100, + "min_tone": 0, + "max_tone": 127 }, "FX 6 (Goblins)": { - "index": 101 + "index": 101, + "min_tone": 0, + "max_tone": 127 }, "FX 7 (Echoes)": { - "index": 102 + "index": 102, + "min_tone": 0, + "max_tone": 127 }, "FX 8 (Sci-Fi)": { - "index": 103 + "index": 103, + "min_tone": 0, + "max_tone": 127 }, "Sitar": { "index": 104, - "min_tone": "C2", - "max_tone": "E5", + "min_tone": 0, + "max_tone": 127, "voices": 7 }, "Banjo": { "index": 105, - "min_tone": "C3", - "max_tone": "C6", + "min_tone": 48, + "max_tone": 69, "voices": 5 }, "Shamisen": { "index": 106, - "min_tone": "D4", - "max_tone": "F6", - "voices": 3 + "voices": 3, + "min_tone": 0, + "max_tone": 127 }, "Koto": { "index": 107, - "min_tone": "A1", - "max_tone": "A7", - "voices": 17 + "voices": 17, + "min_tone": 0, + "max_tone": 127 }, "Kalimba": { "index": 108, - "min_tone": "G3", - "max_tone": "D6" + "min_tone": 0, + "max_tone": 127 }, "Bag Pipe": { "index": 109, - "min_tone": "A4", - "max_tone": "A#5" + "min_tone": 0, + "max_tone": 127 }, "Fiddle": { "index": 110, - "min_tone": "G3", - "max_tone": "G7" + "min_tone": 0, + "max_tone": 127 }, "Shanai": { "index": 111, - "min_tone": "A3", - "max_tone": "A5" + "min_tone": 0, + "max_tone": 127 }, "Tinkle Bell": { "index": 112, - "min_tone": "C#4", - "max_tone": "A6" + "min_tone": 0, + "max_tone": 127 }, "Agogo": { - "index": 113 + "index": 113, + "min_tone": 0, + "max_tone": 127 }, "Steel Drums": { "index": 114, - "min_tone": "F1", - "max_tone": "G6" + "min_tone": 0, + "max_tone": 127 }, "Woodblock": { - "index": 115 + "index": 115, + "min_tone": 0, + "max_tone": 127 }, "Taiko Drum": { - "index": 116 + "index": 116, + "min_tone": 0, + "max_tone": 127 }, "Melodic Tom": { - "index": 117 + "index": 117, + "min_tone": 0, + "max_tone": 127 }, "Synth Drum": { - "index": 118 + "index": 118, + "min_tone": 0, + "max_tone": 127, + "whitelist": true }, "Reverse Cymbal": { "index": 119, - "blacklist": true + "min_tone": 0, + "max_tone": 127 }, "Guitar Fret Noise": { "index": 120, - "blacklist": true + "min_tone": 0, + "max_tone": 127 }, "Breath Noise": { "index": 121, - "blacklist": true + "min_tone": 0, + "max_tone": 127 }, "Seashore": { "index": 122, - "blacklist": true + "min_tone": 0, + "max_tone": 127 }, "Bird Tweet": { "index": 123, - "blacklist": true + "min_tone": 0, + "max_tone": 127 }, "Telephone Ring": { "index": 124, - "blacklist": true + "min_tone": 0, + "max_tone": 127 }, "Helicopter": { "index": 125, - "blacklist": true + "min_tone": 0, + "max_tone": 127 }, "Applause": { "index": 126, - "blacklist": true + "min_tone": 0, + "max_tone": 127 }, "Gunshot": { "index": 127, - "blacklist": true + "min_tone": 0, + "max_tone": 127 } } }