0

Sound works now....Sorta
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Sound works now....Sorta

by Kroran on Tue Oct 08, 2019 10:26 am

So am glad Makercode and trinket M0 can now do sound correctly
but it sounds like high pitched screaming out of my piezo speaker
so my questions are this

1.is it the speakers fault?
2.if it is the speaker what speaker can I use instead?
3.is it my code?
4.if it is what am I doing wrong?

p.s am making a 3d printed skull play This is Halloween's music
Code: Select all | TOGGLE FULL SIZE
forever(function () {
    for (let index = 0; index < 4; index++) {
        music.playTone(392, music.beat(BeatFraction.Whole))
    }
    music.playTone(392, music.beat(BeatFraction.Half))
    music.playTone(415, music.beat(BeatFraction.Half))
    music.playTone(349, music.beat(BeatFraction.Whole))
    music.playTone(392, music.beat(BeatFraction.Double))
    for (let index = 0; index < 2; index++) {
        music.playTone(349, music.beat(BeatFraction.Whole))
    }
    for (let index = 0; index < 2; index++) {
        music.playTone(349, music.beat(BeatFraction.Half))
    }
    music.playTone(349, music.beat(BeatFraction.Whole))
    music.playTone(349, music.beat(BeatFraction.Half))
    music.playTone(392, music.beat(BeatFraction.Half))
    music.playTone(415, music.beat(BeatFraction.Half))
    music.playTone(392, music.beat(BeatFraction.Double))
    for (let index = 0; index < 3; index++) {
        music.playTone(392, music.beat(BeatFraction.Whole))
    }
    music.playTone(415, music.beat(BeatFraction.Whole))
    music.playTone(466, music.beat(BeatFraction.Whole))
})

Kroran
 
Posts: 5
Joined: Tue Nov 13, 2018 4:02 pm

Re: Sound works now....Sorta

by adafruit_support_mike on Wed Oct 09, 2019 12:59 am

[moved to the MakeCode forum]

adafruit_support_mike
 
Posts: 59131
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.