SynthMaker

how to give the sampleplayer prev/next buttons?

Archive · 2008 77 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

brok landers ·

hi all,

i`d like to enhance the stock sample module in 2 ways:

- i`d like to add a prev. and a next button next to the load button, so that, when a sample is loaded and the "next" button is pressed, the next sample from within the same folder is loaded, that the current sample is in ... same with the prev. button ... if the last sample of the folder is reached and you press "next", simply nothing should happen, if the first sample in that folder is currently selected and you press the "prev." button, again nothing should happen ...

- i`d like to add a "one shot" button, so that the sample plays to end no matter what ...then i`d like to use the amp env on that ...

how would i do possibly that?

thanks in advance to help a newbi again! 😀

MichaelBenjamin ·

you can do the next / prev functionality all in green, first find the place where the samplenumber of the current array is decided, then put a customized counter with 2 triggers for up/down before. for the one shot button you might try a trigger hooked to a midi note event with the lenght in samples that the current sample has.

Sasu Honka ·

I am trying to do something like this oneshot also. I would like to have some system to trigger a new shot at the end of sample playback to have a controlled looping in green data. Is there a way to create a trigger at the exact moment that the play of the previous sample ends? I have tried to get that info from the counter module, but since there is no way of getting the stream back to green data there is always the lag of 1/100s - 1/25s depending on the tick module.

Any help would be welcome since I have been wrestling with this for about a month!

MichaelBenjamin ·

for precise things like that you must use stream data. for sequencing i would suggest the fa2p module, with a float array containing the sample array indexes and a integer stream that controls which sample is played. you could use the step lfo to set the sample index.

brok landers ·

MichaelBenjamin wrote: you can do the next / prev functionality all in green, first find the place where the samplenumber of the current array is decided, then put a customized counter with 2 triggers for up/down before.

with "all in green" you mean the green written in the code block? MichaelBenjamin wrote: for the one shot button you might try a trigger hooked to a midi note event with the lenght in samples that the current sample has.

i don`t think that`s it, as different samples obviously have random sizes, just as you load them ... or is the module recognising the sample lengh and translates that into the lenght of a midi note accordingly?

exonerate ·

Here's a module for previous and next buttons.....**Deleted file**

Cheers 😉

Exo

brok landers ·

exonerate wrote: Here's a module for previous and next buttons.....

Cheers 😉

Exo

ahhh, exo, thanks, will try and report asap ...

exonerate ·

I neglected preset support in that example....

Here's an updated version....

Now you won't lose the current folder when saving a project in the host and reloading.....

Cheers 😉

Exo

AngularMomentum ·

Need some help as there seems to be a bug in this. When using with a preset manager, it all goes well when you are in one directory. When you load a sample from another directory, hit the next preset and back, it does not remember the sample anymore, just goes blank and other weird behaviour, like loading up the wrong sample and persistantly loading that wrong sample, or wanting to load a sample out of range. For instance 32 samples in the directory, select the last sample, change preset forth and back and the internal will show 32, 1 to many.

When I disconnect the counter from the selector I get better results with the selector.

I tried for hours to solve it as I thought it might be some vst parameter settings or something, but after testing the attached OSM I see that the behaviour is in the original module.

When I add to the internal sample and hold primitive, the one after the find primitive an After Preset Change trigger, it always loads the correct file if I loaded it from the file dialog when scrolling through presets, but there is something dodgy about the file selector or counter for some reason, and I just can't find out what it is.

tektoog ·

Hey, I solved an issue in this kind by placing the preset module at the end of the process.... so the full path is recorded in the preset manager...

AngularMomentum ·

Bump...anyone?

exonerate ·

AngularMomentum wrote: Bump...anyone?

Sorry I don't have much time at the minute to look into this, but my instinct says it's probably the preset module in the selector that is causing some problems. Try deleting that, I don't think it will be needed.

Then trigger the int sample and hold from the string preset to set the selector after preset change.

Just ideas! not tested!!

Cheers 😉

Exo

AngularMomentum ·

Thanks Exo for your replie.

Now when a sample is loaded from disc it loads the correct one every time and also shows the correct sample, the only problem now is when selecting a sample from the drop down menu or prev/next buttons it doesn't remember the setting.

I also have another weird bug emerging now...when hitting the next button, and then the preivous, it counts one up and then down and visa versa...

exonerate ·

AngularMomentum wrote: Now when a sample is loaded from disc it loads the correct one every time and also shows the correct sample, the only problem now is when selecting a sample from the drop down menu or prev/next buttons it doesn't remember the setting.

I also have another weird bug emerging now...when hitting the next button, and then the preivous, it counts one up and then down and visa versa...

Hmm...I've just done some testing with the "folder select bug" file you posted. And everything seems to work fine.

It remembers the selector setting on each preset. Are you testing with that file?

AngularMomentum ·

Yes I do, and it seems to work fine as long as you stay in the same dir, not if you change directory in my experience, both in the example and in my project, when hitting previous on the preset manager, the selector chooses a file outside the range.

exonerate ·

AngularMomentum wrote: Yes I do, and it seems to work fine as long as you stay in the same dir, not if you change directory in my experience, both in the example and in my project, when hitting previous on the preset manager, the selector chooses a file outside the range.

Ah yes I get the issue now. I'll take a closer look at the cause.....

AngularMomentum ·

I have less problems when connecting the split to split file name and dir, when connecting the filename to the trigger of the internal sample and hold I get rid of this. The only thing now is selecting the sample with the selector (drop down). It is not remembering, even with preset module.

AngularMomentum ·

One other thing I noticed is that the drop down menu always has an empty slot at the end.

exonerate ·

AngularMomentum wrote: One other thing I noticed is that the drop down menu always has an empty slot at the end.

Yeah, I've just fixed that 😉

AngularMomentum ·

😇

AngularMomentum ·

That VST string bug...could that be a problem?

VST-Preset String

exonerate ·

Ok I'm currently getting nowhere with this! 🙁

Need a rethink of the implementation.

I'm going out now, so will have to wait to tommorrow, in the mean time if anyone else wants to have a bash at fixing be my guest. 😀

Edit** That VST string bug...could that be a problem?

Possibily, I did notice some strange behaviour, haven't the time to look more closely now.

Cheers 😉

Exo

AngularMomentum ·

Cheers to you mate... 🙂

Edit:

I have been on this for days, and apart from the triggering, I cannot seem to figure out why this is not working...how you built it seems so logical, I suspected before it is something bugging in SM itself.

AngularMomentum ·

Ok, I think I solved the puzzle...the preset string needs to save also the data from the selector, so the preset string needs to be placed last like already suggested before...I have to test some more, but sofar now it remembers everything correct. I must get in trouble somewhere I still think...

Edit...nah...now it does not return the right file path...some more work to do...

AngularMomentum ·

So I have a new string preset for the path just after the split, the preset for the selector and a preset string for path and filename at the end...sofar it works, but...

When I make a new preset, load in the sample, it will not correctly remember the sample name when switching until I touched the selector or the prev next buttons, then it will remember everything I did in that preset correctly. I am getting closer!

tektoog ·

Hey, you need to use only one preset string during the whole process... get rid of the one in the selector.... it is not needed... if the full path is remembered, then, on load, the selector receives the right file to load....

AngularMomentum ·

I have tried, when selecting a asmple from the drop down menu, it is not remembered, at least, after changing the preset and back again will not set the correct sample in the selector.

For now I have this... and it works sort of.

tektoog ·

Also, you should check this: [old link]

AngularMomentum ·

Yeah I have thought about that, delaying the selector preset...I will try that. 🙂

Nu Audio Science ·

Let me have a look at this in a bit AM I think i may have solved this last week on my rompler

NAS

AngularMomentum ·

Thanks! For the end user I got it solved, but creating new presets in SM in a new created slot gives problems, then the selector needs to be "touched".

aliasant ·

AngularMomentum wrote: Thanks! For the end user I got it solved, but creating new presets in SM in a new created slot gives problems, then the selector needs to be "touched".

Isnt it so that it just needs a trigger somewere? Use a 1ms delay with a timer to delay a single trigger from some were and send it in to the selector?

AngularMomentum ·

Just trigger it into the green Int input in the selector?

aliasant ·

AngularMomentum wrote: Just trigger it into the green Int input in the selector?

O I dunno. 🙂 Possibly the output from the selector. I could help better if i had the osm but you should be able to find the place. Just set the osm in the state were it needs that "touch" then send 1 trigger do different places were you think it should go. Test 1 place and if it doesnt work set the selector in that state again and test somwere else till you find it.

AngularMomentum ·

OSM is posted...just a page back.

aliasant ·

Im looking at it and as usual in SM its trigger hell.

I placed trigger counters everywere. Then I loaded 1 new wave file and went back in to see what triggers were sent and were... Its just to many of them 😉 string splits usually creates an additional trigger and if you use two stringsplits 1 trigg will quickly become 4 and so on..

Ideal would be to have all trigger counters report only 1 trigger. That would mean its a fast schematic with no unneccessary computations going on. My suggestion is to build this from scratch and make sure theres only 1 trigger being sent out from each module.

Or you could try to optimize this one. I started and got most down to 1 trigger but I havnt found the smartest way to save the current wavefile for that preset. Looked some more and I still say build a new one. I think it will be quicker, smarter and more effective in the long run.

I did have something similar in my drummachine. I have 12 pads that all shared the same wavefile loader so I used arrays to save all the locations and wavefiles. Never got it to work 100% though but I didnt bother. I am gonna use the file list thing we made instead. Faster and simpler and very reliable.

Sorry for not helping much.

aliasant ·

I think I solved it.

I realised you were working on the selector from the tapeplayer or?

Anyways. i had a newer version of that that I optimized and it worked. almost. There was a problem with a trigger of course. After the "Find the wavefile" thing there is an integer s&h that received the wrong trigger. It actually received the trigger before it had even found the file so it would always output the wrong integer. I fixed that. Seems to work good now and uses less triggers.

Update: Ooops. it still doesnt quite work. It remembers if you have loaded a file from scratch but not if you change that slot with the selector. This selector doesnt have its own presets. Maybe it needs to. Ill have another look at it.

aliasant ·

Ok. This one actually works.

Pfeew.....

AngularMomentum ·

Yeah I think it needs that some sort of...I am now trying to read everything you did in the schematic and compare that with what I have in KickLab...If it uses less triggers, then it is all good! 🙂

AngularMomentum ·

Looks very neat...I noticed indeed the same behaviour when the selector selects a sample, but the rest looks very solid.

In your example, the string array also ouputs an empty string on the end of the list, you can see this when using the drop down menu...one empty slot.

aliasant ·

AngularMomentum wrote: Looks very neat...I noticed indeed the same behaviour when the selector selects a sample, but the rest looks very solid.

Hmm. Maybe I missed something what exactly is happening that shouldnt?

AngularMomentum wrote: In your example, the string array also ouputs an empty string on the end of the list, you can see this when using the drop down menu...one empty slot.

Yes. Right. Forgot that one. I guess the list needs a split to get rid of 2 extra invisible characters. Something I think came in one of the beta 1.3's? I also think you can get rid of moore triggers but thats a chase I dont like to do right now ;9 but it could probably save some un neccessary computations and speed things up.

AngularMomentum ·

It still has the error when hitting the back preset button...load a sample, preset up, then down, and it loads the wrong one. This is a real bugger 🙂

aliasant ·

AngularMomentum wrote: It still has the error when hitting the back preset button...load a sample, preset up, then down, and it loads the wrong one. This is a real bugger 🙂

I cant reproduce that here. Works like it should.... These are the steps I took.

I was currently on preset 5 so first thing was to step down to preset 4 using the down/back arrow. Then I hit load and loaded a new sample. Then hit preset arrow up to preset 5 again and finally back to preset 4. It loaded just fine.

I think I did it the wrong way. Started over like this. Went to preset 16 (empty) loaded a sample. stepped down to preset 15 (also empty) and loaded a new sample from a different folder. Stepped back up to 16 and yes. It loads the first file but from the correct folder. It loads index 0 instead of, in this case, 8.

I repeated this several times and the same thing. Bugger!. Tried exchanging the VST string preset to a VST Parameter but that didnt help.

There must be a bug here somewere?

aliasant ·

Lol. Just realized that this is exactly the problem I was having with my loader in my drummachine.

Pretty convinced that it is a bug. Probasbly in the droplsit primitive. Didnt someone else report a bug in it?

AngularMomentum ·

I am not sure if it has been brought to the attention of Malc...I think I have some of these problems as well in Wave Manager, when trying to use key codes.

Also I built in, when a sample is not found it will automatically look in the install dir...just to make it all even a bit more fun and confusing...heheh. 🙂

aliasant ·

Ok. This thread started by Myco could be the same. selector bug

Im sending one to Malc with reproducing steps so he should be able to fix this.

AngularMomentum ·

Thank you very much for your help man. 😍

tektoog ·

Hey, Except for the afterload latency bug, I don't think there is any other. Check this:

It took me nearly a month, days and nights, to get this to work correctly...I've rebuilt the whole thing from scratch (using some preexisting modules: thanks to Andrew for the triggerdelay module !!!)...[old link] VST string is at the begining and there is also one in the selector (sorry for the misleading...) TekTooG

AngularMomentum ·

It has the same kinda bug I see...here it again failes to remember samples when hitting the back button on the preset manager. Also, it doesn't like Minihost very much.

aliasant ·

Is there any performance difference between tektoogs and mine AM? From what I read his seems to be almost identical to mine or? Havnt had time to dl it and check for myself so Im posting this lazy question 😉

AngularMomentum ·

It crashes on me everytime...and it got the same bug, not wanting to remember everything correct.

aliasant ·

AngularMomentum wrote: It crashes on me everytime...and it got the same bug, not wanting to remember everything correct.

Ok. The "remebering bug" is sent to Malc and he mailed me back that he got it and is looking into it. Unfortunatly its not the only bug he is workin on :/

About the crashing. Right now with the latest official beta all my plugs seems to crash and always just after, or during, a mouseclick. So it might not be the shematic your having problems with.

tektoog ·

Hey, it might be version related, I'm still using 1.1.3beta1.5, and 1.1.2 on two different computers. The VST example has been rendered with Ver 1.1.3beta1.5 The crashes are weird and I am kind of surprised as I tested it in Cubase VST32, Cubase 4.5, Fruityloops 4.5 and in Acid 4 and 7 with absolutly no problem....the samples are remembered everytime and I never had any crash ...

AngularMomentum ·

Well it remembers it until you hit the back button on the preset manager...maybe later on I will make a screencapture movie from it showing that bug.

tektoog ·

Hey, I made a small movie showing the selector behavior...it seems to work fine for me...

AngularMomentum ·

Here is the screen cap....as you can see it does not even load the correct sample, let alone remembering it correct. I tested this on my laptop (with Windows 7) and Q6600, and all have the problem. 😠

tektoog ·

I beat you on the movie making though !!!! 🙂 LOL !!

AngularMomentum ·

🙂

tektoog ·

Well, I have no clue of what's really happening there..... but I'll keep it like that until something or someone comes up with a better solution... I've released all my commercial plugs with this selector, and I had no feedbacks about that.... so I cross my fingers...

AngularMomentum ·

This is what I am looking at at the moment....also I implemented a way if a sample is not found to look in the install dir....which does work visually, but does not work as well. 😠

AngularMomentum ·

tektoog wrote: Well, I have no clue of what's really happening there..... but I'll keep it like that until something or someone comes up with a better solution... I've released all my commercial plugs with this selector, and I had no feedbacks about that.... so I cross my fingers...

When having the presets already filled, at least with KickLab there is no problem...there is only one when creating new presets in a new slot where there hasn't been a full preset before in my experience.

aliasant ·

Malc responded today and sent me a FIXED sample finder selector thingie.

When you load the osm you will see the first little fix. A trigger sent. There is a second similar fix deep inside the selector. Malc marked it the same way. Seems to work when I tested it. Please report here if it works for you or not.

Thank you Malc 🙂

AngularMomentum ·

Selector selection still does not work for me...it loads fine, but it defaults to the loaded sample now everytime, instead of recalling the selectors value. This happens to me in both in KickLab and the new schematic.

aliasant ·

AngularMomentum wrote: Selector selection still does not work for me...it loads fine, but it defaults to the loaded sample now everytime, instead of recalling the selectors value. This happens to me in both in KickLab and the new schematic.

Argh Scheisse.

I think you should send it yourself to Malc then. Together with a step by step instruction how to get the error.

AngularMomentum ·

If the preset string after the selector is set to true...it really starts making a mess...it can even shift the values of the samples over all the presets...reahihily weird...

tektoog ·

The schematic uploaded last is empty for me..... What's going on? Do I need the last SM version to open it?

AngularMomentum ·

It is loading fine here...and yeah I guess you need the latest beta...

AngularMomentum ·

aliasant wrote: AngularMomentum wrote: Selector selection still does not work for me...it loads fine, but it defaults to the loaded sample now everytime, instead of recalling the selectors value. This happens to me in both in KickLab and the new schematic.

Argh Scheisse.

I think you should send it yourself to Malc then. Together with a step by step instruction how to get the error.

I think I do that, thanks again for your efforts man.

AngularMomentum ·

Solved it...

The VST string is triggering the set selector every time, while it should do that only once, or even, not at all...The file dialog should trigger the setting of the selector on load of the sample. So I removed any triggering from the VSTstring primitive. Now I completely threw out the old selector and replaced it with a new one and rebuild it.

Works solid now after some testing, loading, switching presets up and down with samples loadedd from different directories, selecting with drop down menu... 🙂

Edit: Up and down triggers where switched...fixed that. 😊

AngularMomentum ·

When it comes back from an unloaded preset space it still gives problems....grrrrr...but I do not use empty presets so it will work in KickLab now.

AngularMomentum ·

Now I implemented the stuff when the sample is not found it will look in the installation dir...I can drop KickLab in any dir and it will load the preset or user sample if the user sample is copied into the sample folder of KickLab XXL 🙂

AngularMomentum ·

Here is the folder select with another modification. When you distribute a library of samples with the VST, the problem is that the folder select needs to work with "hardcoded" filepaths, and also with the default library. If the sample is not found on the expected location, it will look automatically in the install folder. So...now you have best of both...and folder selection, and a default library that can be installed anywhere the user wants.

AngularMomentum ·

Doing the following made all my problems go away. Not feeding the data from the selector back into the counter.

tektoog ·

Not sleeping yet uh ?? So sometimes less is better uh? taking off is better than adding in ??? That's what I always say to my girlfriend !!! Good call AM !!!

AngularMomentum ·

I want to release KickLab, so I have been up all night getting it right (3:30 AM here)...finally finished. 🙂

AngularMomentum ·

TektooG requested the module from KickLab...here it is. Remember that you might have to change some stuff, like the up and down trigger buttons and the load button, I just ripped it out of KickLab as is, so test folder and filepaths are still there.

tektoog ·

Hey AM, Thanks a lot for that... I hope I'll be able to replace my old not so working well version with yours, without too much trouble... Cheers.

TekTooG

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.