LoginSignup
0
0

More than 5 years have passed since last update.

俺言語 その23

Last updated at Posted at 2018-03-21

概要

俺言語をやってみた。
avrにアセンブラで実装してみた。
メロディを奏でる、前編。

環境

avr studio 4
attiny85 1mhz
tera term
usb-serial

調査1

ピアノの鍵盤の音階と周波数

調査2

MMLを読んでみた。

プロトタイピング

簡易MMLを実装してみた。

アセンブラ実装の方法検討

40usのデレィで255に収まる。

記号 周波数 1波 分解 
a 440.000 2273us 40us * 57
b 493.883 2025us 40us * 51
c 523.251 1911us 40us * 48
d 587.330 1703us 40us * 43
e 659.255 1517us 40us * 38
f 698.456 1432us 40us * 36
g 783.991 1276us 40us * 32
A 880.000 1137us 40us * 28

「PINBに1書き込むと、出力が反転する」を利用する。

俺言語での実装。

変数sを導入する。

s="ccggAAggffeeddccggffeeddggffeeddccggAAggffeeddcc"

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0