@whale-av When I press the bang object in the cart8 patch this what I'm getting:
What I'm really try to understand is how to load a directory into [file glob] object with a path to folder that including spaces. Is that even possible? or I must change the path to that folder that it will contain no spaces? (as I did..)
@KMETE With spaces..... in the path and or file name....... cart9.zip
I mentioned a few posts ago that you will need to change the path to what you want inside the cart at the top left (right-click and open the GUI window).
I should have mentioned that again as it was a while ago.
I have tested it with spaces in the path and also in the file names.
The display is not pretty with \ everywhere that there is a space...... but it works.
I try to take some parts from the cart9 patch and place in my previous patch. It seems to work just fine except of the fact that I need to press twice on the number box that marked in red. first time of pressing some integer it won't start the track. Any idea why?
@KMETE I don't know what [zl filter] does so I cannot tell where your problem might be, but it must be an order of operations problem somewhere.
I would remove the [zl] objects and connect the output of [coll tracks] directly to [s trackname].
Actually, I think the toggle for pause/resume is probably the cause.... the first start message probably turns it off and only the second turns it on again?
When I first open the patch this is how my stereo file object arrays looks like:
I then press on some track number (pressing the number box). Arrays indeed filled but no sound out:
only when I press once again it will actually play the track.. I guess I could solve it with few loadmess ..
@KMETE So [vline~] receives "1 250"
Then [sf-play2~] receives "resume"
Then [sf-play2~] receives "all"
It must get the track name somehow from [stereofile myplayer] and I don't have that....... but probably it has not yet received the filename.
You have put 250 msec delays everywhere..... so hard to tell which messages will get there first.
So I think your patch should look like this at the bottom left......
......... with the [delay 250] removed and the order confirmed with the [t b b f] the trackname should get where it needs to go before the start is sent........ unless there are more delays in [stereofile myplayer].
Indeed now the track will play on the first push. The problem now is that when scrolling between track you hearing the previous track before the track you want is playing.. because the moment a number is send to Coll it will pass the track name to [stereofile] and will play it immediately before the previous track go back to zero .
Another thing I'm trying to do:
I setup rotary encoder and a button on the arduino and I'm using the rotary encoder to change the track which work just fine. I would like that the button will act as a pause play button.
the data I'm when pressing the button is transient between 1 >> 0 so I need to make toggling between two state of constant 1 and constant o (meaning 1 press will output 1 and another press will output 0)
I try to use [cycle 2] to toggling between states but it did not worked well. Any recommendations?
Send the button data into [sel 1]
Connect a bang to its left outlet.
It will only bang when the button is pressed (1)........ not when it is released (0)
Feed the bang into a [toggle] that will then output 1 or 0 for each bang it receives..
You can set the toggle to always be on or off as the patch opens using the "init" button in its properties window.....
If that is also unreliable then it will be because of switch bounce.
You can debounce using a [delay] to stop data within a time window.
There are a number of ways to do that....... https://forum.pdpatchrepo.info/topic/12092/debouncing-was-measure-time-between-two-bangs-events
Oops! Looks like something went wrong!