Jump to content
IGNORED

programming music in Basic / EB - half note calculation


digdugnate

Recommended Posts

I've been refining my programming knowledge with Basic and Extended Basic before tackling Assembly (plus it's a little easier while I'm studying for a certification, too)- i love music so I've been looking at program code and ways I can make my own music programs better.

 

The Extended Basic manual gives some really great info on the frequencies for notes/etc, but I was wanting an easy way to compute additional frequencies based on a half-step between notes.

 

Here's what I came up with:

 

10 LET F=110

20 FOR I=1 TO 91

30 PRINT F

40 LET F=F*92^(1/12))

50 NEXT I

60 END

 

I had also started lists for different scales (chromatic, pentatonic) to make things a little easier as I code through written music. :)

 

Pretty neat stuff!

Link to comment
Share on other sites

I've been refining my programming knowledge with Basic and Extended Basic before tackling Assembly (plus it's a little easier while I'm studying for a certification, too)- i love music so I've been looking at program code and ways I can make my own music programs better.

 

The Extended Basic manual gives some really great info on the frequencies for notes/etc, but I was wanting an easy way to compute additional frequencies based on a half-step between notes.

 

Here's what I came up with:

 

10 LET F=110

20 FOR I=1 TO 91

30 PRINT F

40 LET F=F*92^(1/12))

50 NEXT I

60 END

 

I had also started lists for different scales (chromatic, pentatonic) to make things a little easier as I code through written music. :)

 

Pretty neat stuff!

 

That's a fun project. I am a musician and producer myself but have been programming for almost as long.

 

Another exercise for you could be to open a file and have your note frequency calculator program print the values out

to a file as BASIC DATA statements. Sort of like below. BUT please read the manual on the OPEN

statement, I have not used TI BASIC for many years so my memory is faulty.

 5 OPEN #1:"FILENAME" BLAH BLAH (check your manual)
10 LET F=110
20 FOR I=1 TO 91
30 PRINT #1: I * 100;" DATA "; F
40 LET F=F*92^(1/12))
50 NEXT I 
60 END

But if you make the text file you could use it like a prefab building block for future music programs.

Just an idea.

  • Like 1
Link to comment
Share on other sites

In Classic99, you can open the “CLIP” device and PRINT to it if you are developing on a PC.

 

...lee

The funny thing is up to this point I'm doing everything the hard way and messing around with my TI :) I guess it would make sense to dork around with Classic99/etc on my PC.

Link to comment
Share on other sites

While certain specialized applications like interfacing require coding on real hardware, everything else is so much easier and faster when done in emulation first.

I absolutely get the special nostalgic feeling of coding on real hardware, and some of us create amazing stuff doing just that like Marc Hull for example, but there comes a point where the aggravation of aging and flaky hardware is counterproductive in my view...

  • Like 3
Link to comment
Share on other sites

While certain specialized applications like interfacing require coding on real hardware, everything else is so much easier and faster when done in emulation first.

I absolutely get the special nostalgic feeling of coding on real hardware, and some of us create amazing stuff doing just that like Marc Hull for example, but there comes a point where the aggravation of aging and flaky hardware is counterproductive in my view...

Have you tried Tidbit? Allows programming BASIC with labels in place of line numbers which really improves the BASIC experience.

 

Editing on a modern PC + Tidbit = a delight!

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...