Jump to content
IGNORED

Variable file


James app-2008

Recommended Posts

Hello

 

can someone write out a simple example of connecting a program to a data file containing variables? 
 

I want to write music files and use variables. I think my programs re set the variables to zero.

 

could someone show me by using an example how to have and use a variable file? 
 

I could use the help

Link to comment
Share on other sites

8 minutes ago, James app-2008 said:

Hello

 

can someone write out a simple example of connecting a program to a data file containing variables? 
 

I want to write music files and use variables. I think my programs re set the variables to zero.

 

could someone show me by using an example how to have and use a variable file? 
 

I could use the help

 

What language? Basic, Extended Basic, Forth, Pascal, C, Assembler, ...?

 

...lee

  • Like 1
Link to comment
Share on other sites

Here is an example of writing, then reading, some music data to/from file for use by CALL SOUND in TI BASIC (or Extended BASIC), presuming you have a DSK1:

 

5 REM WRITING TO DISK
10 OPEN #1:"DSK1.MUSIC",INTERNAL
15 PRINT #1:224,370,12
20 PRINT #1:224,294,12
25 PRINT #1:224,247,12
30 PRINT #1:224,294,12
35 PRINT #1:224,370,12
40 PRINT #1:224,294,12
45 PRINT #1:224,220,12
50 CLOSE #1
55 REM READING FROM DISK
60 OPEN #1:"DSK1.MUSIC",INTERNAL
65 FOR BEAT=1 TO 7
70 INPUT #1:DUR,T,V
75 CALL SOUND(DUR,T,V)
80 NEXT BEAT
85 CLOSE #1

 

  • Like 4
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...