Scripts
title: Casio Notes VMM
author: VMM Team
date: 2010-01-02
description:
Mapping and defining note numbers to constants, very useful for vintage Casio. There is an example in the fooBar.vmm, and another in RZ1progam.vmm
Credits: James S. Elkins.
code
//-----------------------------
// File: "casioNotes.vmm"
//-----------------------------
// MIDI Note Numbers
const C2 = 36;
const CS2 = 37;
const D2 = 38;
const DS2 = 39;
const E2 = 40;
const F2 = 41;
const FS2 = 42;
const G2 = 43;
const GS2 = 44;
const A2 = 45;
const AS2 = 46;
const B2 = 47;
const C3 = 48;
const CS3 = 49;
const D3 = 50;
const DS3 = 51;
const E3 = 52;
const F3 = 53;
const FS3 = 54;
const G3 = 55;
const GS3 = 56;
const A3 = 57;
const AS3 = 58;
const B3 = 59;
const C4 = 60;
const CS4 = 61;
const D4 = 62;
const DS4 = 63;
const E4 = 64;
const F4 = 65;
const FS4 = 66;
const G4 = 67;
const GS4 = 68;
const A4 = 69;
const AS4 = 70;
const B4 = 71;
const C5 = 72;
const CS5 = 73;
const D5 = 74;
const DS5 = 75;
const E5 = 76;
const F5 = 77;
const FS5 = 78;
const G5 = 79;
const GS5 = 80;
const A5 = 81;
const AS5 = 82;
const B5 = 83;
const C6 = 84;
const CS6 = 85;
const D6 = 86;
const DS6 = 87;
const E6 = 88;
const F6 = 89;
const FS6 = 90;
const G6 = 91;
const GS6 = 92;
const A6 = 93;
const AS6 = 94;
const B6 = 95;
// Casio RZ-1 note numbers
const RZ_BASS = 36;
const RZ_RIM = 37;
const RZ_SNARE = 38;
const RZ_TOM_1 = 41;
const RZ_TOM_2 = 45;
const RZ_TOM_3 = 48;
const RZ_HH_CLOSED = 42;
const RZ_HH_OPEN = 46;
const RZ_CRASH = 49;
const RZ_RIDE = 51;
const RZ_COWBELL = 56;
const RZ_CLAP = 39;
const RZ_SAMPLE_1 = 52;
const RZ_SAMPLE_2 = 53;
const RZ_SAMPLE_3 = 59;
const RZ_SAMPLE_4 = 62;
// Casio RZ-1 velocities
const RZ_MUTE = 1;
const RZ_NORMAL = 49;
const RZ_ACCENT = 127;
// Casio CZ-101 program numbers
// Factory presets
const CZ_BRASS_ENS_1 = 0;
const CZ_TRUMPET = 1;
const CZ_VIOLIN = 2;
const CZ_STRING_ENS_1 = 3;
const CZ_ELEC_PIANO = 4;
const CZ_ELEC_ORGAN = 5;
const CZ_FLUTE = 6;
const CZ_SYNTH_BASS = 7;
const CZ_BRASS_ENS_2 = 8;
const CZ_VIBRAPHONE = 9;
const CZ_XYLOPHONE = 10;
const CZ_SYNTH_STRINGS = 11;
const CZ_FAIRY_TALE = 12;
const CZ_ACCORDION = 13;
const CZ_WHISTLE = 14;
const CZ_PERCUSSION = 15;
// User presets ("internal")
const CZ_USER_1 = 16;
const CZ_USER_2 = 17;
const CZ_USER_3 = 18;
const CZ_USER_4 = 19;
const CZ_USER_5 = 20;
const CZ_USER_6 = 21;
const CZ_USER_7 = 22;
const CZ_USER_8 = 23;
const CZ_USER_9 = 24;
const CZ_USER_10 = 25;
const CZ_USER_11 = 26;
const CZ_USER_12 = 27;
const CZ_USER_13 = 28;
const CZ_USER_14 = 29;
const CZ_USER_15 = 30;
const CZ_USER_16 = 31;
// Casio HT-700 program numbers
// Factory presets
const HT_PIANO = 0;
const HT_HARPSICHORD = 1;
const HT_JAZZ_ORGAN = 2;
const HT_BRASS_ENS = 3;
const HT_SYMPHONIC_ENS = 4;
const HT_SYNTH_BELLS = 5;
const HT_MAGICAL_WIND = 6;
const HT_BLUES_HARMONICA = 7;
const HT_LIGHT_HARP = 8;
const HT_PLUNK_EXTEND = 9;
const HT_ELEC_PIANO = 10;
const HT_VIBRAPHONE = 11;
const HT_SYNTH_CLAVI = 12;
const HT_STRINGS = 13;
const HT_SYNTH_BASS = 14;
const HT_SYNTH_CELESTA = 15;
const HT_PEARL_DROP = 16;
const HT_SYNTH_REED = 17;
const HT_FANTASY = 18;
const HT_TYPHOON_SOUND = 19;
// User presets ("internal")
const HT_USER_1 = 20;
const HT_USER_2 = 21;
const HT_USER_3 = 22;
const HT_USER_4 = 23;
const HT_USER_5 = 24;
const HT_USER_6 = 25;
const HT_USER_7 = 26;
const HT_USER_8 = 27;
const HT_USER_9 = 28;
const HT_USER_10 = 29;
const HT_USER_11 = 30;
const HT_USER_12 = 31;
const HT_USER_13 = 32;
const HT_USER_14 = 33;
const HT_USER_15 = 34;
const HT_USER_16 = 35;
const HT_USER_17 = 36;
const HT_USER_18 = 37;
const HT_USER_19 = 38;
const HT_USER_20 = 39;
// Channel numbers (Must match device channel assignments!)
const CASIO_RZ1 = 1;
const CASIO_CZ101 = 1;
const CASIO_HT700 = 1;
//---------------------------------------------------------------------
// File: "fooBar.vmm"
//
// This example is based on a thread usage example.
//---------------------------------------------------------------------
#include "stdmidi.vmm"
#include "casioNotes.vmm"
proc foo()
{
while (1) {
NoteOn(CASIO_CZ101,C4,127);
sleep(500);
NoteOff(CASIO_CZ101,CS5);
sleep(200);
}
}
proc bar()
{
while (1) {
NoteOn(CASIO_CZ101,CS5,127);
sleep(550);
NoteOff(CASIO_CZ101,C4);
sleep(150);
}
}
proc main()
{
ProgramChange(CASIO_CZ101,CZ_XYLOPHONE);
thread foo();
thread bar();
}
//----------------------------------------------------
//
// File: RZ1progam.vmm
//
// Another example, which is much better than the
// RZ-1's programming interface for creating rhythms.
//
//----------------------------------------------------
#include "stdmidi.vmm"
#include "casioNotes.vmm"
proc BassAndSnare()
{
while (1) {
NoteOn(CASIO_RZ1,RZ_BASS,RZ_NORMAL);
sleep(125);
NoteOff(CASIO_RZ1,RZ_BASS);
sleep(250);
NoteOn(CASIO_RZ1,RZ_SNARE,RZ_ACCENT);
sleep(125);
NoteOff(CASIO_RZ1,RZ_SNARE);
sleep(250);
}
}
proc HighHat()
{
while (1) {
sleep(200);
NoteOn(CASIO_RZ1,RZ_HH_OPEN,RZ_NORMAL);
sleep(50);
NoteOff(CASIO_RZ1,RZ_HH_OPEN);
sleep(75);
NoteOn(CASIO_RZ1,RZ_HH_CLOSED,RZ_NORMAL);
sleep(50);
NoteOff(CASIO_RZ1,RZ_HH_CLOSED);
sleep(75);
NoteOn(CASIO_RZ1,RZ_HH_CLOSED,RZ_NORMAL);
sleep(50);
NoteOff(CASIO_RZ1,RZ_HH_CLOSED);
sleep(200);
}
}
proc Ride()
{
while (1) {
NoteOn(CASIO_RZ1,RZ_RIDE,RZ_ACCENT);
sleep(75);
NoteOff(CASIO_RZ1,RZ_RIDE);
sleep(75);
NoteOn(CASIO_RZ1,RZ_RIDE,RZ_MUTE);
sleep(75);
NoteOff(CASIO_RZ1,RZ_RIDE);
sleep(450);
}
}
proc Clap()
{
while (1) {
sleep(1350);
NoteOn(CASIO_RZ1,RZ_CLAP,RZ_ACCENT);
sleep(50);
NoteOff(CASIO_RZ1,RZ_CLAP);
sleep(50);
NoteOn(CASIO_RZ1,RZ_CLAP,RZ_NORMAL);
sleep(50);
NoteOff(CASIO_RZ1,RZ_CLAP);
}
}
proc main()
{
ProgramChange(CASIO_CZ101,CZ_SYNTH_BASS);
thread HighHat();
thread Clap();
thread BassAndSnare();
thread Ride();
}
There's no sound file available yet.