abram
New Member
Posts: 44
|
Post by abram on Sept 24, 2023 1:45:10 GMT
I have a few questions about open file.
I was wondering if there is a return code for the close command and if it is _easy to access_ OR is there a general rule of thumb to follow for timing of open / closed files. I was wondering if you can open a file for read multiple times on multiple programs as long as there is no write _without-breaking-anything_.
|
|
|
Post by bplus on Sept 24, 2023 3:10:31 GMT
Hi abram, No nothing is returned with Close keyword. If you have not worked with files before I recommend starting with sequential files (how I learned it) then Random then Binary. Sequential like the word means you access line by line until the end of file. Open for Output restarts an brand new file for writing to, open for Append adds to an existing file for writing to though you can use for new file also. Open for Input is to read lines in for processing often loading an array. Wiki probably has examples and Terry Ritchie has nice tutorial www.qb64tutorial.com/gamesRandom and Binary files are not or don't have to be accessed sequentially, random access. Random access is generally records by record number and binary is most flexible with byte sized chunks of any length.
|
|
abram
New Member
Posts: 44
|
Post by abram on Sept 24, 2023 3:49:56 GMT
Thank you for the timely response. I will check out those links! I might have to take the mp3 / jpeg approach.
|
|
|
Post by bplus on Sept 24, 2023 4:00:25 GMT
Hey abram do you want to load music or an image? That is different than opening a file.
|
|
abram
New Member
Posts: 44
|
Post by abram on Sept 24, 2023 21:55:25 GMT
I'm still flowcharing, and brainstorming. I am also taking some time to catch up on basic.
I was thinking about using three apps that shared data. For original sounds. That I could eventually export into Logic Pro. I was thinking three because _sndraw will not allow the use of _delay, sleep, of any timer based command to be used with it. I want a GUI and that needs a timer. I also want to control three sounds at once at different intervals, but I don't know how to accomplish that yet. I really want shared memory but I doubt that is possible in a modern os. So I was going to use files.
|
|
|
Post by marjagonzalves on Sept 25, 2023 3:59:33 GMT
If you want to program for music, BASIC less appropriate than Csound. csound.com/download.htmlBe sure to get the reference manual. It goes deep. I'm waiting for version 7.
|
|
|
Post by bplus on Sept 25, 2023 13:51:22 GMT
Yes! in any one field you can find lots of better apps than Basic. The beauty, the spirit, the point of Basic is you can also do it yourself, just a little (little ha!) more work (but is it work?) but you certainly can make the code, the app, your own.
|
|
abram
New Member
Posts: 44
|
Post by abram on Sept 25, 2023 17:51:53 GMT
I was not impressed by the type of sounds c sound makes. Every daw sounds the same to me. I was hoping to make a better sound.
It just sounds like every daw including c sound is using the same library or something.
|
|
|
Post by marjagonzalves on Sept 28, 2023 5:16:07 GMT
This is about you, not the application. You have high expectations. You will be disappointed if you try to do in QB64 what could be done in Csound. This is my opinion but Csound could use at least one audio driver "libportaudio.so". QB64 needs to do this as well. Otherwise will need thread libraries to handle audio and video separately. Creating music tracker program that plays MOD looks easy but it's not. Add automation on top of that and it must synchronize. Then try to mess around with MIDI. That was a monster in early Windows hard to tame. I had problems with one-core CPU computer running Ubuntu Studio 32-bit and using Qsynth. Note trigger was all over the place. But I couldn't afford a computer more powerful, less a Macintosh. If you are not satisfied with Csound, Faust, Supercollider or other it will be difficult to be able to do what you want with freeware.
|
|