Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#returns true if the message represents a positive change of | |
# the given controller number, as will happen when depressing buttons a midi keyb. | |
# We ignore messages with value bytes 0, as those are sent on button releases. | |
on isMidiButtonPressed(msg, controllerNumber) | |
return (isControlChange(msg, controllerNumber) and (item 3 of msg > 0)) | |
end isMidiButtonPressed | |
on isControlChange(msg, controllerNumber) | |
return ((item 1 of msg = 191) and (item 2 of msg = controllerNumber)) | |
end isControlChange |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let passIx = 0 | |
let index = 0 | |
let pattern: neopixel.Strip = null | |
let firstColor = 0 | |
let secondColor = 0 | |
let fnNames: string[] = [] | |
let myBrightness = 0 | |
function wipe() { | |
for (let i = 0; i < 24; i++) { | |
pattern.shift(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import display, sleep, button_a | |
import audio | |
def frames_from_file(sndfile, frame): | |
while(sndfile.readinto(frame, 32) > 0): | |
yield frame | |
def play_snd(fname): | |
frame = audio.AudioFrame() | |
with open(fname, 'rb') as sndfile: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input.onButtonPressed(Button.A, () => { | |
PlayShapeOfYouBass() | |
}) | |
input.onButtonPressed(Button.AB, () => { | |
PlayNightwishStorytime() | |
}) | |
function PlayNightwishStorytime() { | |
music.setTempo(120) | |
music.rest(music.beat(BeatFraction.Half)) | |
music.playTone(698, music.beat(BeatFraction.Half)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Use this file to define custom functions and blocks. | |
* Read more at https://makecode.microbit.org/blocks/custom | |
*/ | |
enum Chord { | |
//% block="FMajor" | |
FMajor, | |
//% block="GMajor" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let passIx = 0 | |
let index = 0 | |
let numPixels = 0 | |
let firstColor = 0 | |
let pattern: neopixel.Strip = null | |
let secondColor = 0 | |
let fnNames: string[] = [] | |
let myBrightness = 0 | |
function glow() { | |
myBrightness = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let passIx = 0 | |
let index = 0 | |
let item = 0 | |
let numPixels = 0 | |
let firstColor = 0 | |
let pattern: neopixel.Strip = null | |
let myBrightness = 0 | |
let secondColor = 0 | |
let fnNames: string[] = [] | |
function rainbowRotate() { |