With Bytes and Beats, students will use MATLAB®, the programming platform used by scientists and engineers, to turn if-statements, for-loops, and functions into rhythms, melodies, and harmonies. Working with friends, they will compose and visualize their own music and invent their own symphonic creations.
This material contains interactive MATLAB® Live Scripts to assist instructors in teaching computer programming and musical concepts. They can be leveraged as demonstrations, activities, or interactive assignments.
Within this content, MATLAB Live Scripts (".MLX") are employed, which are interactive documents that combine MATLAB code with formatted text, equations, and images in a single environment called the Live Editor. Both “.M” files and “.MLX” files will execute the written code the same, but the Live Scripts are meant to be interacted with as an educational or visual tool.
https://www.mathworks.com/help/matlab/matlab_prog/what-is-a-live-script-or-function.html https://www.mathworks.com/help/matlab/live-scripts-and-functions.html
Note: Modules are also available in Word document format
Modules are numbered to show a recommended flow, but do not necessarily need to be completed sequentially. You may choose to complete whichever modules fit the experience level of your students. This means that modules can be leveraged as:
- Individual lessons/activities
- A combination of modules, either in order or mixed and matched
- A week-long course, consisting of a few modules per day:
Day 1 | Day 2 | Day 3 | Day 4 |
---|---|---|---|
1. Sound and Music | 5. Shopping for a Musical Party | 9. Understanding Loops | 13. Importing and Editing Sounds |
2. What is Programming? | 6. Practice with Indexing | 10. Tunable Parameters and “If” Statements | 14. Working with Sound Files |
3. Introduction to MATLAB | 7. Vectors, Variables, and Functions | 11. Figures and Callback Functions | 15. Creating a Melody |
4. Using Variables | 8. Using Functions to Create Music | 12. Creating a Virtual Theremin | 16. Music Mixer App and Performance |
Contact the MathWorks STEM Outreach team to provide feedback, or if you have questions.
There are no prerequisites for these modules, but instructors and students can use MATLAB Onramp or Learn to Code (for younger students) as a resource to become familiar with Live Scripts and MATLAB syntax.
Students will need laptops or Chromebooks with access to the Internet to use MATLAB® Online™. MATLAB Online provides access to MATLAB and Simulink through a web browser, eliminating the need to install the entire application on a device. For the best overall experience, Google Chrome® is recommended to access MATLAB Online.
For more information about MATLAB Online, please visit: https://www.mathworks.com/products/matlab-online.html
It is recommended to set up desks and tables such that students can move around to facilitate group work and can also see the screen where you project the MATLAB lesson plans. Students need laptops with access to power outlets. Internet access is required in order to use MATLAB® Online™
Each module has its own Instructor Guide in the form of a Live Script or Word document. These contain all the background information, course preparation, and lesson plans for the activities to cover with the students. Be sure to read them carefully as they contain the basic information you need to teach each module successfully. Tip: To effectively navigate the Instructor Guides, you can make use of the Table of Contents at the top.
While you use the Instructor Guides to direct the modules, students will be opening Live Scripts through the File Explorer or Command Window, as shown below:
>> open Vectors_Variables_Functions.mlx
They will follow along with these and are not given a set of Instructor Guides.
Included are worksheets and handouts that students fill out to reinforce concepts, the modules indicate when to print/distribute each worksheet. Handouts contain a list of vocabulary and common MATLAB commands the students need in the course. Encourage the students to refer to the handouts throughout the course. The 'Materials' section in each activity lists the Worksheets and/or Handouts required for that activity.
These instructions are for both instructors and students.
Use the link to download the module. You will be prompted to log in or create a MathWorks account. The project will be loaded, and you will see the file directory within the Current Folder pane.
Donwload of clone this repository. Open MATLAB and navigate to the folder containing the repository.
Within the Command Window, next to the >> symbol, enter the following:
>> setupBnB
This will start installing the course toolbox and the audio files. Note: This could take several minutes to complete. You only need to run ‘setupBnB.m’ once to install the course toolbox and the audio files.
There will be a message within the Command Window when all of the audio files are done installing.
From there, you can get started by opening the modules within the 'instructor_resources > instructor_guides' folder. The instructions inside these will guide you through the exercises and activities.
MS-ETS1-2. Evaluate competing design solutions using a systematic process to determine how well they meet the criteria and constraints of the problem.
MS-ETS1-3. Analyze data from tests to determine similarities and differences among several design solutions to identify the best characteristics of each that can be combined into a new solution to better meet the criteria for success.
Creativity and Innovation
- Apply existing knowledge to generate innovative ideas, products, or processes.
- Create original works as a means of personal or group expression.
Critical thinking, problem solving, and decision making
- Identify and define authentic problems and significant questions for investigation.
- Plan and manage activities to develop a solution or complete a project.
- Collect and analyze data to identify solutions and/or make informed decisions.
- Use multiple processes and diverse perspectives to explore alternative solutions.
Computational Thinking
- Use the basic steps in algorithmic problem-solving to design solutions (e.g., problem statement and exploration, examination of sample instances, design, implementing a solution, testing, evaluation).
Computing Practice & Programming
- Implement problem solutions using a programming language, including: looping, behavior, conditional statements, logic, expressions, variables, and functions.
- Demonstrate dispositions amenable to open-ended problem solving and programming (e.g., comfort with complexity, persistence, brainstorming, adaptability, patience, propensity to tinker, creativity, accepting challenge).
The license for this module is available in the LICENSE.txt file in this GitHub repository.
Music Clips are provided by The Philharmonia Orchestra. The license information can be found at https://philharmonia.co.uk/resources/sound-samples/
Copyright 2024 The MathWorks®, Inc.