Search found 246 matches

by mark_c
Tue Nov 03, 2020 12:57 pm
Forum: Technical
Topic: study windows hooks, several problems of performances and keys detection
Replies: 5
Views: 755

Re: study windows hooks, several problems of performances and keys detection

thanks Remy as always. If you try this version you will see that if you always keep pressed the keys Z + C and only then press X without leaving Z + C, you will see as output on the Caption s = "ZC" and never s = "ZXC", as if keeping Z keys always pressed + C inhibits the reading of the X key (in ot...
by mark_c
Tue Nov 03, 2020 1:07 am
Forum: Technical
Topic: study windows hooks, several problems of performances and keys detection
Replies: 5
Views: 755

study windows hooks, several problems of performances and keys detection

wrote this code to study windows hooks but it has several problems. Some problems are of response speed, while others are of correctness of the output. For example, if I press the keys with code: (90="Z",67="C") together and holding them down I also press the key (88="X"), its pressure is not detect...
by mark_c
Mon Aug 31, 2020 12:11 pm
Forum: Technical
Topic: sound card read integers or float?
Replies: 0
Views: 1250

sound card read integers or float?

Hello, I ask someone who has already studied this kind of problems: generating a series of samples for the sound card in order to generate a sine wave. I am using the following function: but I did not understand if the sound card reads integer or floating point values. float *buffer = 0; buffer = (f...
by mark_c
Mon Jul 20, 2020 4:27 am
Forum: Technical
Topic: pointer to the first TList structure
Replies: 12
Views: 20475

Re: pointer to the first TList structure

thanks Remy,
really very strange that it is so complicated to use a simple timer even if it is as precise as you want.

https://www-user.tu-chemnitz.de/~heha/petzold/ch22d.htm
by mark_c
Tue Jul 14, 2020 10:43 am
Forum: Technical
Topic: pointer to the first TList structure
Replies: 12
Views: 20475

Re: pointer to the first TList structure

you're right Remy, I had missed how usleep () was made, I thought the author was referring to a Linux function. But how does that author of that article still say that Sleep () is not accurate? Does this mean that the Sleep () is not precise in the sense that, if Sleep (1000) ms is set, it could hap...
by mark_c
Mon Jul 13, 2020 12:03 pm
Forum: Technical
Topic: pointer to the first TList structure
Replies: 12
Views: 20475

Re: pointer to the first TList structure

sorry Remy, but do you think that the Sleep () function is a kind of closed loop that takes up a lot of CPU? We created our usleep() function to get mostly accurate MIDI timing which seemed to work well. Unfortunately, the usleep() function does not actually sleep but spins in a tight loop. This is ...
by mark_c
Thu Jul 09, 2020 12:20 am
Forum: Technical
Topic: A doubt about midi files
Replies: 1
Views: 3687

A doubt about midi files

Hello, but, isn't it strange that to play a "type 1" midi file you have to do all this work? 1) calculate abs-time of each track 2) reorder the events by abs-time 3) recalculate the delta times in respect of the original time invented example not working: ch, note, velocity, delta-time, abs-time tra...
by mark_c
Tue Jul 07, 2020 4:55 am
Forum: Technical
Topic: pointer to the first TList structure
Replies: 12
Views: 20475

Re: pointer to the first TList structure

thanks Remy as always.
I simply used your suggestion and everything works now.

Code: Select all

struct alignas(MIDIEVENT) MIDIEVENT_NOPARMS
{
    DWORD dwDeltaTime;
    DWORD dwStreamID;
    DWORD dwEvent;
    //DWORD dwParms[];
};
by mark_c
Mon Jul 06, 2020 1:39 pm
Forum: Technical
Topic: pointer to the first TList structure
Replies: 12
Views: 20475

Re: pointer to the first TList structure

thanks Remy. Here is my experiment. void __fastcall TForm1::Button1Click(TObject *Sender) { int num = MyList->Count; MIDIEVENT *MyArr = new MIDIEVENT[num]; MIDIHDR header = {}; MIDIEVENT *ev = NULL; int a=0; for(int i = 0; i < num; i++) { MyStruct *s = (MyStruct*) MyList->Items[i]; if(s->a >= 0x80 &...
by mark_c
Mon Jul 06, 2020 2:28 am
Forum: Technical
Topic: pointer to the first TList structure
Replies: 12
Views: 20475

Re: pointer to the first TList structure

I'm still studying these midi functions of windows but the darkest part of the code is in the calculation of the buffer to be passed to the appropriate function. If I write: header.dwBufferLength = header.dwBytesRecorded = (sizeof (MIDIEVENT) * 2) - (sizeof (ev-> dwParms) * 2); everything freezes. i...
by mark_c
Fri Jul 03, 2020 5:52 am
Forum: Technical
Topic: pointer to the first TList structure
Replies: 12
Views: 20475

Re: pointer to the first TList structure

thanks Remy.
I used a TList to take advantage of the Sort in case I needed it.
by mark_c
Thu Jul 02, 2020 6:18 am
Forum: Technical
Topic: pointer to the first TList structure
Replies: 12
Views: 20475

pointer to the first TList structure

Hello, I'm not sure if what I wrote is correct. I am using a TList as a container for pointers to MIDIEVENT structures and after filling the TList, I have to initialize the member (header.lpData) of the MIDIHDR structure with the start address of the first structure present in the TList. thank you T...
by mark_c
Tue May 12, 2020 12:42 pm
Forum: Technical
Topic: Sort TList of structures
Replies: 5
Views: 8821

Re: Sort TList of structures

thanks Remy
by mark_c
Mon May 11, 2020 12:17 pm
Forum: Technical
Topic: Sort TList of structures
Replies: 5
Views: 8821

Re: Sort TList of structures

how do you reorder a list for (c) and (e)?
by mark_c
Sat May 09, 2020 5:07 am
Forum: Technical
Topic: Sort TList of structures
Replies: 5
Views: 8821

Re: Sort TList of structures

exceptional as always, thanks Remy