We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
センサーの値を100ミリ秒周期で読み出して音を出す楽器を作ろうとしたらエラーが発生しました。 エラーが発生した後は音が鳴らなくなりました。
loop関数の疑似コード
void loop() { int value = sensor.read(); if (value > 100) { inst.sendNoteOn(60, 64, 0); } inst.update(); delay(100); }
シリアルモニタのエラーメッセージ(一部)
Attention: module[1][0] attention id[2]/code[1] (dma_controller/audio_dma_drv.cpp L885)
The text was updated successfully, but these errors were encountered:
起票時の疑似コードではdelay関数が使われているため、音声出力モジュールへの音声データ供給が滞り、Attentionが発生しているようです。
delay
SDカードからの音声データ読み出しが間に合わないときには音声出力モジュールに無音データを供給するように修正しました。これによってAttentionが発生する問題はv0.7.0 以降で改善しますが、次の点には注意してください。
delay関数を実行している間はSDカードから音声データが読み込まれないため音が鳴りません。 適切に音を鳴らすためには、delay関数を使わずにセンサ読み取り周期を実現し、その周期とは関係なく inst.update() が実行されるようにしてください。
inst.update()
unsigned long next_millis = 0; void loop() { unsigned long now = millis(); if (next_millis <= now) { int value = sensor.read(); if (value > 100) { inst.sendNoteOn(60, 64, 0); } next_millis = now + 100; } inst.update(); }
Sorry, something went wrong.
TerukiKirihata
No branches or pull requests
センサーの値を100ミリ秒周期で読み出して音を出す楽器を作ろうとしたらエラーが発生しました。
エラーが発生した後は音が鳴らなくなりました。
loop関数の疑似コード
シリアルモニタのエラーメッセージ(一部)
The text was updated successfully, but these errors were encountered: