Script: Khaled.js

By: timoshii

// Set the tempo
setTempo(120);

// Fit the drumbeat to track 1
fitMedia(KHALID_NORM_DRUMBEAT, 1, 6, 28);

// Define a variable for the guitar clip prefix
var guitar = "KHALID_NORM_GUITAR_";

// Loop through the guitar clips and fit them to tracks 2 to 6
for(var i=1; i<6; i++){
fitMedia(guitar + i, i+1, 1, 28)
}

// Define a variable for the harmony clip prefix
var harmony = "KHALID_NORM_VOX_HARMONY_";

// Loop through the harmony clips and fit them to track 7
for(var i=1; i<=5; i++){
fitMedia(harmony + i, 7, (i-1)*3 + 1, (i-1)*3 + 2)
}

// Define an array of clips for track 8
var clips_8 = [KHALID_NORM_VOX_BACKUP_1, KHALID_NORM_VOX_BACKUP_2,KHALID_NORM_VOX_BACKUP_3,KHALID_NORM_VOX_BACKUP_4, KHALID_NORM_VOX_BACKUP_5];

// Define an array of clips for track 9
var clips_9 = [KHALID_NORM_VOX_LEAD_VERSE_1, KHALID_NORM_VOX_LEAD_VERSE_2, KHALID_NORM_VOX_LEAD_VERSE_3, KHALID_NORM_VOX_LEAD_VERSE_4, KHALID_NORM_VOX_LEAD_VERSE_5, KHALID_NORM_VOX_LEAD_VERSE_6,KHALID_NORM_VOX_LEAD_BRIDGE];

// Define a variable for the start measure
var start = 9;

// // Loop through the clips for track 8
// for (var i=0; i<clips_8.length; i++) {
// // Get the current clip from the array
// var clip = clips_8[i];
// // Calculate the end measure by adding 4 to the start measure

Welcome Students and Teachers!

Welcome to EarSketch!

Teachers: View our new curriculum guide, and visit our EarSketch Teacher Site for additional resources.

Students: Continue below to learn more about EarSketch

Here you will learn computer science and music technology side by side. You will use either Python or JavaScript to create your own music.

Musicians and programmers write computer code to create new sounds, effects, and songs.

Learning to write computer code is a skill that will be useful to you in a variety of career paths.

Maybe you’ll become a legendary music producer or the industry’s most sought-after recording engineer! We wish you good luck on your EarSketch journey.

Click on the right arrow at the top of this text to get started.

Teachers, get access to free teacher materials and community here!