EnzoF04

Forum Replies Created

Viewing 20 posts - 81 through 100 (of 102 total)
  • Author
    Posts
  • in reply to: receiving sysex and storing it in ram #72617
    EnzoF04
    Participant
      • Topics: 17
      • Replies: 102
      • Total: 119
      • ★★

      Success! By just randomly sending of Ack messages I get a bigger sysex message. The max bytes I get in the sysex message is 752.

      When I get the same sample from the sampler with the Atari I see the same 752 bytes passing! This is really great! No I can build the code for cleaning the received bytes into understandable / interpretable data. This is a giant leap for S700-kind… 😉
      @Human Fly: It would really be nice to store the samples via Midi into a CTRLR panel because almost all the QuickDisk-drives are dead in those samplers.


      @Possemo
      : The timer is now on 15. When it is slower i don’t get the whole message. I stop the timer after 250.

      in reply to: receiving sysex and storing it in ram #72600
      EnzoF04
      Participant
        • Topics: 17
        • Replies: 102
        • Total: 119
        • ★★

        OK i’ve got an other panel with the timer working. It’s not clean code but it works for now. I have to continue and build the sysex communication in it. See attached.

        My biggest question now is:
        Is there a way to count the incoming sysex bytes in a sysex message? Like real time? Not the amount being told after the sysex message is received but while incoming?

        Attachments:
        You must be logged in to view attached files.
        in reply to: receiving sysex and storing it in ram #72599
        EnzoF04
        Participant
          • Topics: 17
          • Replies: 102
          • Total: 119
          • ★★

          I just lost all data in my CTRLR project. I had some working code but now i have to redo all things I discovered.
          I was messing with timers but couldn’t get it to work, ctrlr quitted unexpected.

          I’ll start all over again soon.

          in reply to: receiving sysex and storing it in ram #72597
          EnzoF04
          Participant
            • Topics: 17
            • Replies: 102
            • Total: 119
            • ★★

            Thanks Possemo! I will work on this tonight. What I’ve been doing is sending ACK’s when the messageSize is 18, 17 or 19. No satisfying results up til now. I thought that the messageSize is evaluated after the message was received not while it is coming in.

            in reply to: receiving sysex and storing it in ram #72594
            EnzoF04
            Participant
              • Topics: 17
              • Replies: 102
              • Total: 119
              • ★★

              That would be worth a good test! But more efficiently; if I somehow manage to count the incoming sysex bytes and when an amount is reached, I can send the ACK. It all is predictable when the sampler expects a ACK.

              So is there a way of counting incoming bytes per message?
              I haven’t searched yet…

              Great input, Possemo, thanks!

              in reply to: receiving sysex and storing it in ram #72592
              EnzoF04
              Participant
                • Topics: 17
                • Replies: 102
                • Total: 119
                • ★★

                Well, exactly, Possemo. Consider it an incomplete message as such, as I consider it as complete with ack messages inbetween. Your approach gives me new perspectives. But still, I need to send an ack from the panel to the sampler within a certain timeframe wafer the fists 19 bytes are received. The sysex message will be completed with the EOX gyre.

                Nice find about this post from a forum. Where did you get this? Thanks a lot!

                in reply to: receiving sysex and storing it in ram #72588
                EnzoF04
                Participant
                  • Topics: 17
                  • Replies: 102
                  • Total: 119
                  • ★★

                  Thanks, Possemo, but it does send complete messages. When I request a sample dump from the Atari, the sampler send a sysex message of 500+ bytes. When I send a request for sample dump by ctrlr panel, the sampler awnsers with inkt 20 bits message.

                  What gives you the idea that the sampler does not send a full message?

                  The delay / sleep function is a work around I have to test.
                  Thanks!

                  in reply to: receiving sysex and storing it in ram #72581
                  EnzoF04
                  Participant
                    • Topics: 17
                    • Replies: 102
                    • Total: 119
                    • ★★

                    Or are you trying to say that with a timer activated, the sending of request for sample dump message to the sampler and the following ACK messages sending to the sampler are within a timer dictated timeframe?

                    • This reply was modified 6 years, 9 months ago by EnzoF04.
                    in reply to: receiving sysex and storing it in ram #72577
                    EnzoF04
                    Participant
                      • Topics: 17
                      • Replies: 102
                      • Total: 119
                      • ★★

                      Is a timer sync’ed to incoming bytes? Let’s say

                      if MidiMessage:getSize() = 18 then
                      timer = timer+1
                      end

                      I’m doing:

                      	msgSize = MidiMessage:getSize()
                      	msgAck = CtrlrMidiMessage({0xf0, 0x7e, 0x7f, 0xf7})
                      
                      	if msgSize == 19 then
                      		panel:sendMidiMessageNow(msgAck)
                      	end
                      

                      But i’m realising that the getSize is completed after the whole sysex msg is received? Am I right?

                      • This reply was modified 6 years, 9 months ago by EnzoF04.
                      in reply to: receiving sysex and storing it in ram #72575
                      EnzoF04
                      Participant
                        • Topics: 17
                        • Replies: 102
                        • Total: 119
                        • ★★

                        Ah I get it (assigning modulators on panel initialisation. In the “calles when panel has finished loading” you put a method called PanelLoaded. In this method you call a function called “AssignModulators”where all the variables are set with their corresponding on panel modulators.

                        This is clear and for a rebuild very handy. I’m thinking of making stuff more modular instead of coding it all 6 or 16 times (for the samples e.g.).

                        Further more on the load in different steps. This is quiet difficult, I’m afraid. Because of the fact that I send a request for sample dump to the S700. Then the S700 starts sending sysex bytes. While sending it the S700 needs to receive an ACKS byte after sending the first 19 bytes. See what the implementation documentation is telling about the communication outline. (attachement)
                        Fijne avond, insgelijks! :*)

                        Attachments:
                        You must be logged in to view attached files.
                        in reply to: receiving sysex and storing it in ram #72574
                        EnzoF04
                        Participant
                          • Topics: 17
                          • Replies: 102
                          • Total: 119
                          • ★★

                          I’m getting some results:
                          analyzing incoming sysex data and displaying it
                          and another request for a sample with different data received

                          in reply to: documentation SUCKS big time… #72572
                          EnzoF04
                          Participant
                            • Topics: 17
                            • Replies: 102
                            • Total: 119
                            • ★★

                            @Human Fly
                            First reply:
                            I realize that CTRLR is a living project with things added and solutions developed, enhancements embedded and work a rounds altered. That makes it an untameable creature with a quick developing character. I was disappointed about the documentation and the search-ability of it. For that i use Google.com and search:

                            "midiMessageReceived" site:ctrlr.org
                            "setPropertyString"+"("uiLabelText")" site:ctrlr.org

                            this kinda works for me. I’ve come this far and I am satisfied for now.

                            Would it be an idea to create a reference for a large amount of prefixed names and reserved words that Lua uses to construct routines and functions and methods?

                            thanks for listening to my frustration and taking it seriously!

                            in reply to: receiving sysex and storing it in ram #72568
                            EnzoF04
                            Participant
                              • Topics: 17
                              • Replies: 102
                              • Total: 119
                              • ★★

                              This helps to make the sysex message more readable! Very good explanation, goodweather, this is getting me closer!
                              – you told that you do all the declarations in a specific part, where and how? Those are global decelerations?

                              – I am coming to a realization that I need exact timing for sending a message back to the sampler as byte 18 is received in a longer sysex message of 319 bytes. When I do not awnser with a 4 byte acknowledge received data, the sampler sends an EOX, end of exclusive. I’ve tried something like if midiMessage get size < 17 or equal to 18, sendMidiMesage now. Console shows me that the condition is met and a midi monitor app shows sending of the acknowledge sysex message but sampler is not continuing sending the other bytes. It sends an EOX. Thanks for the great advises!

                              • This reply was modified 6 years, 9 months ago by EnzoF04.
                              in reply to: receiving sysex and storing it in ram #72561
                              EnzoF04
                              Participant
                                • Topics: 17
                                • Replies: 102
                                • Total: 119
                                • ★★

                                so i want to compute this but it won’t work…

                                 	wordPart01 = MidiMessage:getData():getByte(9)
                                		console (string.format (wordPart01))
                                	wordPart02 = MidiMessage:getData():getByte(10)
                                		console (string.format (wordPart02))
                                	wordPart03 = MidiMessage:getData():getByte(11)
                                		console (string.format (wordPart03))
                                 	wordPartLes = (tonumber(wordPart01) * 1)
                                 	wordPartMiS = (tonumber(wordPart02) * 128)
                                 	wordPartMoS = (tonumber(wordPart03) * 16384)
                                 	wordCount = ((wordPartLes + wordPartMis) + wordPartMos)
                                 		console (string.format(wordCount))
                                in reply to: receiving sysex and storing it in ram #72559
                                EnzoF04
                                Participant
                                  • Topics: 17
                                  • Replies: 102
                                  • Total: 119
                                  • ★★

                                  f0 7e 01 00 00 0c 31 63 07 48 01 00 48 01 00 48 01 00 00 f7
                                  byte 5 (0c) = bits per word = 012
                                  bytes 6,7,8 (31 63 07) = sampling period in nS

                                  
                                  HEX  DEC
                                   31  049 lsb  (    1 x 049 =    049)
                                   63  099      (  128 x 099 =  12672)
                                   07  007 msb  (16834 x 007 = 114688)
                                  049+12672+114688 = 127409
                                  

                                  bytes 9,10,11 (48,01,00) = total words in sample

                                  
                                  HEX  DEC
                                   48  072 lsb  (    1 x 072 = 072)
                                   01  001      (  128 x 001 = 128)
                                   00  000 msb  (16834 x 000 = 000)
                                  072+128+000 = 200 words in sample
                                  

                                  bytes 12,13,14 (48,01,00) = Loop start point

                                  
                                  HEX  DEC
                                   48  072 lsb  (    1 x 072 = 072)
                                   01  001      (  128 x 001 = 128)
                                   00  000 msb  (16834 x 000 = 000)
                                  072+128+000 = 200 words in sample
                                  

                                  bytes 15,16,17 (48,01,00) = Loop End Point

                                  
                                  HEX  DEC
                                   48  072 lsb  (    1 x 072 = 072)
                                   01  001      (  128 x 001 = 128)
                                   00  000 msb  (16834 x 000 = 000)
                                  072+128+000 = 200 words in sample
                                  

                                  byte 18 (00) = Scan type, 0=looping, 0=alternating (one shot if loop length <5).

                                  in reply to: receiving sysex and storing it in ram #72557
                                  EnzoF04
                                  Participant
                                    • Topics: 17
                                    • Replies: 102
                                    • Total: 119
                                    • ★★

                                    OK So i’ve received this sysex message.
                                    (in decimal)

                                    240 126 001 000 000 012 049 099  007 072 001 000 072 001 000 072
                                    001 000 000 247

                                    (in hexadecimal)

                                    f0 7e 01 00 00 0c 31 63  07 48 01 00 48 01 00 48
                                    01 00 00 f7

                                    I know bytes 9,10,11 represent the total words in sample. How do i convert decimal 007 072 001 (decimal) or 07 48 01 (in hexadecimal) to words.

                                    in reply to: receiving sysex and storing it in ram #72556
                                    EnzoF04
                                    Participant
                                      • Topics: 17
                                      • Replies: 102
                                      • Total: 119
                                      • ★★

                                      OK that helps! No i can receive a sysex message and pull info from the bytes. I use this code:

                                      
                                      function midiMessageReceived(MidiMessage)
                                      	s = MidiMessage:getSize()
                                      	msgAck = CtrlrMidiMessage({0xf0, 0x7e, 0x7f, 0xf7})
                                      
                                      	if MidiMessage:getData():getByte(3) == 0x00 then
                                      		console ("Sample Parameters for sample 01 received")
                                      	elseif MidiMessage:getData():getByte(3) == 0x01 then
                                      		console ("Sample Parameters for sample 02 received")
                                      	elseif MidiMessage:getData():getByte(3) == 0x02 then
                                      		console ("Sample Parameters for sample 03 received")
                                      	elseif MidiMessage:getData():getByte(3) == 0x03 then
                                      		console ("Sample Parameters for sample 04 received")
                                      	elseif MidiMessage:getData():getByte(3) == 0x04 then
                                      		console ("Sample Parameters for sample 05 received")
                                      	elseif MidiMessage:getData():getByte(3) == 0x05 then
                                      		console ("Sample Parameters for sample 06 received")
                                      	else
                                      		console ("message not recornized")
                                      	end
                                      	if MidiMessage:getData():getByte(18) ==0x00 then
                                      		panel:sendMidiMessageNow(msgAck)
                                      		console ("Acknowledge message sent")
                                      	end
                                      end
                                      

                                      This works for now! I now need to analyze the received midi message on bytes 6,7,8 (Sample period) and bytes 9,10,11 (total Words in sample).
                                      Thanks so far!

                                      in reply to: receiving sysex and storing it in ram #72551
                                      EnzoF04
                                      Participant
                                        • Topics: 17
                                        • Replies: 102
                                        • Total: 119
                                        • ★★

                                        I think i need someting like
                                        on midi message receive
                                        put bytes into an array of undefined size
                                        when 19 bytes are received (In a certain format)
                                        send acknowledge to device
                                        –then starts data block 0–
                                        when 120 bytes are received calculate checksum
                                        if checksum is OK
                                        send acknowledge to device
                                        if checksum is NOT OK
                                        send NOT acknowledged, request retransmission of block
                                        if byte received is F7 (EOX)
                                        transmission is complete

                                        I don’t know how to efficiently code this into lua. I’m affraid timing will be crucial to get the bi-directional communication exactly working.

                                        in reply to: receiving sysex and storing it in ram #72546
                                        EnzoF04
                                        Participant
                                          • Topics: 17
                                          • Replies: 102
                                          • Total: 119
                                          • ★★

                                          OK so I can send the request for information to my midi device. The device is sending data back to the panel. I can’t figure out how to store it but I THINK it is writen into an array. I can’t write the contents of this array to a UI element for now. That comes later.

                                          When my panel asks for data via sysex the device sends me 20 bytes. I need to acknowledge the received 19 bytes so the device continues sending the next part of sysex bytes.

                                          When my atari ask for the sysex info from the device i see a message sent to the device, a request for info. Then i see the atari sending ACKnowledge sysex messages to the device. (All coming “From port 1”).

                                          The device is sending a sysex message that builds up as the ACKnowledge messages are set by the atari.

                                          How do i build up this awnsering of acknowledge messages while storing the incomming sysex data into an array?

                                          second attachement is is the correct sysex message, when i send a request (first message in attachement 1) from my panel i only receive a 20 bytes message.

                                          • This reply was modified 6 years, 9 months ago by EnzoF04.
                                          Attachments:
                                          You must be logged in to view attached files.
                                          in reply to: documentation SUCKS big time… #72538
                                          EnzoF04
                                          Participant
                                            • Topics: 17
                                            • Replies: 102
                                            • Total: 119
                                            • ★★

                                            Proton, Human Fly, Peter_EP and Paul Scheidt, many thanks for the encouragement! That helps and useful pointers to get on enthusiastically! The point that i wanted to make is that it needs to be rewarding for all the starting developers. They need to make progress. If you won’t get any result despite the effort taken. People will drop CTRLR developing and Lua scripting. That’s the biggest loss the scene can take. So by writing a little bit more tutorialish doc’s on the site, you give newbees the kickstart.

                                            CTRLR and Lua do not suck, they are powerful but locked for the masses, i think.

                                            Thanks again and i’ll continu where i left last weekend!
                                            Best regards from The Netherlands

                                            • This reply was modified 6 years, 9 months ago by EnzoF04.
                                          Viewing 20 posts - 81 through 100 (of 102 total)
                                          Ctrlr