Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:00 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Musical notes in MMBASIC

Author Message
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 284
Posted: 09:37pm 14 Mar 2012
Copy link to clipboard 
Print this post

Hello, Just finished working out all the notes for use in the SOUND Command.

E=83,F=88,F#=93,G=98,G#=104,A=110,A#=117,B=124,C=131,C#=139, D=147,D#=156.

To play the next octave just times by 2 ie.C=131*2 is 262.
So a list of notes with five octaves would look like this-

E 83,165,330,660,1320
F 88,175,350,700,1400
F# 93,185,370,740,1480
G 98,196,392,785,1570
G# 104,208,416,832,1664
A 110,220,440,880,1760
A# 117,233,467,934,1868
B 124,247,495,990,1980
C 131,262,525,1050,2100
C# 139,277,555,1110,2220
D 147,294,558,1176,2352
D# 156,311,623,1246,2492

Hopefully this list will make it a lot easier when writing music in MMBASIC.

Dave.
 
Raros

Regular Member

Joined: 06/02/2012
Location: Italy
Posts: 55
Posted: 12:16am 15 Mar 2012
Copy link to clipboard 
Print this post

Hi Dave

If you can help, see the CircuitGizmos site
CircuitGizmos cgmmstick1
download begmax.pdf on page 43 there are all the musical notes.

bye
Edited by Raros 2012-03-16
 
rodent59
Newbie

Joined: 02/03/2012
Location: Australia
Posts: 7
Posted: 05:58am 15 Mar 2012
Copy link to clipboard 
Print this post

Hi Dave,

For the equally tempered scale, the frequency ratio of adjacent notes (one semitone) is the twelfth root of two. 2^(1/12) ~= 1.05946.

So, rather than enter note frequencies individually, they could be calculated by, for example (not tested!),

C1=32.703196 ' Frequency of C1 in Hz (Note: A4=440Hz, concert pitch)
dim freq(8,12)
for octave=1 to 8 ' octave 4 is middle C to B above it
for note=1 to 12 ' 1=C, 2=C#, 3=D,..., 12=B
freq(octave,note)=C1*(2^(octave-1))*2^((note-1)/12)
next
next


Perhaps write it as a subroutine 'PitchInit'

Rod.
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1425
Posted: 02:42pm 15 Mar 2012
Copy link to clipboard 
Print this post

  Raros said   Hi Dave

If you can help, see the CircuitGizmos site
CircuitGizmos cgmmstick1
download begmax.pdf on page 43 there are all the musical notes.

bye


Or via this link: Music on Maximite
Micromites and Maximites! - Beginning Maximite
 
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 284
Posted: 11:47pm 15 Mar 2012
Copy link to clipboard 
Print this post

Thanks for the info. I used a guitar tuner to get my notes, some look like they are a little off
I needed a list of notes as I'm trying to get my UBW32 to play (pseudo) polyphonic music using just one voice! So far I've got it playing a bass line and melody at the same(ish) time and the results arn't that bad, it sounds a bit like a Spectrum computer and works by quickly playing one note then the other. I'll post the results when I've done it.

Dave.
 
DuinoMiteMegaAn
Senior Member

Joined: 17/11/2011
Location: Australia
Posts: 231
Posted: 01:15am 16 Mar 2012
Copy link to clipboard 
Print this post

For the Maximite sound experts, here is a quick sound question.

I am using the Maximite sound output as an alert and warning indicator..
Is there a program that I can use to translate a wave file into Maximite sound commands? (wave files have a lot of useful sounds like firetruck, siren, etc.)
It is extremely hard, without a musical background, to create the needed sounds for my alerts.
Edited by DuinoMiteMegaAn 2012-03-17
 
crackerjack

Senior Member

Joined: 11/07/2011
Location: Australia
Posts: 164
Posted: 02:35am 16 Mar 2012
Copy link to clipboard 
Print this post

DuinoMiteMegaAn - not possible without (at least some) extra hardware. See this post for ideas on playing WAV files from a *Mite.
 
crackerjack

Senior Member

Joined: 11/07/2011
Location: Australia
Posts: 164
Posted: 02:13am 17 Mar 2012
Copy link to clipboard 
Print this post

For some interesting musical possibilities see this video and this one too. I'm not sure if the You Tube poster (skywodd) has ever been a member of this forum, but this is a fine effort and he has obviously spent a fair amount of time coding up not only the program, but the song files too.Edited by crackerjack 2012-03-18
 
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 284
Posted: 02:57pm 21 Mar 2012
Copy link to clipboard 
Print this post

I've finally got round to making a Youtube video of my UBW32 playing polyphonic sound. See what you think. The tune is Magic Roundabout. UBW32 playing polyphonic sound
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024