HOW has this been achieved!? I'm baffled!

24 replies [Last post]
spooky zoo
Offline
Joined: 05/07/2012

I have an .nsp project I download sometime ago, not sure where from, It's called "I dunno".

Well there is a pad on the TRG that is using a 40+ second long sample which I believe is a re sample of the whole track.

The thing is, when triggering the sample via the pad, it only plays for around 7 or 8 seconds then stops.

I have no idea how this is achieved.

Anybody give me a clue?

Thanks

( if it's allowed maybe I could post and share a link to the nsp from my Dropbox?)

EDIT: .nsp link below.

spooky zoo
Offline
Joined: 05/07/2012

Not too familiar with linking to Dropbox so hope this works.

The sample I 'm referring to is pad 15 of the 1st TRG.

I'm sure it's very simple, but I can't work it out. Thanks

https://www.dropbox.com/sh/m56fhouoptika6x/AAC6wKm6q6tqf9KrFr9-Kgnca?dl=0

Lee B
Offline
Joined: 09/23/2011

Nope! I can't work that out either.
If you tap on the empty pad 16 and load the 'I Dunno' sample from there, it plays full length.

spooky zoo
Offline
Joined: 05/07/2012

Hey Lee,

thanks for looking.

Slam-Cut
Offline
Joined: 09/07/2011

Yeah, I got this .nsp from the Community NSP & TRG thread years ago but never really looked at it. Until now. Nice build up. It seems that I now understand the title of the piece, because it's all I can say about the mysterious sudden end to pad 15. Maybe is was released to us so we would be baffled. Maybe try tracking down the post it came from and contact the poster. Maybe we will never solve this mystery...

spooky zoo
Offline
Joined: 05/07/2012

Hey Slam-Cut,

Thanks for checking and the extra info.

That might be my only way to find out.

I just assumed it would be an obvious answer and I was in a "can' t see the Forest for the trees" scenario.

It's gonna keep bugging me till I find out. :)

Galaxyexplorer (not verified)

Tryed that nsp too..... and........ can´t find the answer too. Seems to belong to the X-Files!

spooky zoo
Offline
Joined: 05/07/2012

I hear Mulder & Scully are back soon. :)

Thanks for checking.

syrupcore
Offline
Joined: 09/26/2010

That's a weird one. Doesn't seem to be starting in the correct spot either. I wonder if there are some extra attributes set by hand in the TRG file? On my phone so I can't check. That or a weird bug is all I got.

spooky zoo
Offline
Joined: 05/07/2012

@syrypcore Thanks for looking. Thats a good idea, I'll take a look at the files.

About the sample position, it's play mode is set to single reverse and seems like it's using the first 8 seconds of the sample.

I'll post if I find out. :)

syrupcore
Offline
Joined: 09/26/2010

Sleuthed! Yep, the TRG XML was either edited by hand or there was some bug introduced at some time that mis-set the sample's "End". The "End" as set in the XML isn't the length of the actual sample so it's getting cut off at what that "end" is set to.

To reproduce (on the desktop):

1. Copy pad 15 to pad 16. If you trigger 16, you'll hear it start at the actual end of the sample (like 15 should).
2. Save the project.
3. Navigate to your project folder via the Finder or Explorer.
4. In a plain text editor, load the Package.prg file.
5. Scroll down to around line 154. You'll see all of the TRG pads. they're numbered 0-15, not 1-16 so transpose by one in your mind.
6. The original pad (Pad14) has its End set to "302463"
7. Pad15 (which is pad 16 in the TRG) is our new copy and it's End is set to "1997055".

The lengths are set in samples so Pad14 is set to about 15% of the total length. Or ~7 seconds out of 45 seconds (thanks, Audacity).

I didn't actually try it but I think in the original pad, when you trigger it, it's starting at 7 seconds in and going in reverse from that point.

Here's the Package code to look for:

<Pad14 Nam="I dunno.wav" Vol="0.500000" Pan="0.500000" Tps="1" Pit="0" Bus="0" Grp="0" Sta="0" End="302463" Dir="Reverse" Trg="Trigger">
   <AmpEnv Version="1" Flags="3" A="0.000000" D="0.000000" S="1.000000" R="0.000000" Amount="1.000000" Invert="0"/>
</Pad14>
<Pad15 Nam="I dunno.wav" Vol="0.500000" Pan="0.500000" Tps="1" Pit="0" Bus="0" Grp="0" Sta="0" End="1997055" Dir="Reverse" Trg="Trigger">
   <AmpEnv Version="1" Flags="3" A="0.000000" D="0.000000" S="1.000000" R="0.000000" Amount="1.000000" Invert="0"/>
</Pad15>

And here are a couple of screenshots from Audacity with the sample length in time and samples.

Truncated Version

Full Version

spooky zoo
Offline
Joined: 05/07/2012

Sleuthed indeed! Awesome work, thank you.

Funny because after your initial suggestion I followed the first 4 or 5 steps and was viewing the prg file in SublimeText. It was the first time I'd viewed one of these so I wasn't entirely sure what I was looking for. Can't believe I was looking at the wrong Pad though (15)... should've known better! :)

And yeah that's sounds exactly right... about 7 seconds in played in reverse to the beginning.

Such a cool response, thanks for putting in the effort!

It really had me puzzled. :)

Galaxyexplorer (not verified)

I was thinking about it too it was a edited data. So could NS read also loop points in pre made samples?
However, sadly the mystery is destroyed X file closed ;)

syrupcore
Offline
Joined: 09/26/2010

Spooky zoo, no problem. It was sorta fun.

Galaxy, it won't read loop points but this does show how you could set an a manual start/end time for a given sample on a given pad. Also means with a little bit math (sample length/16) and a text editor you could create 16 slices of a given sample for the TRG. You could probably even swap out the source files if they were the same length and you named it exactly the same when putting it in the TRG folder.

Galaxyexplorer (not verified)

Text editor and Galaxy is a bad combination.

syrupcore
Offline
Joined: 09/26/2010

Today's coffee fueled experiment inspired by this thread:
http://codepen.io/willthemoor/full/yeEGOY/

Figure out how long your sample is (audacity works well), enter the file name and the total number of samples into that little tool and it'll generate a TRG file with each pad set to an even slice (you can set the number of slices).

FULL Disclosure: I haven't even tried this yet so it could totally fail! Just finished it and have to run out the door. If anyone is feeling bored/brave, let me know how it goes!

spooky zoo
Offline
Joined: 05/07/2012
spooky zoo
Offline
Joined: 05/07/2012

@syrupcore I've done an initial test of this and it's been quite fun.

1. I grabbed the first thing I saw in Audioshare which was a 4 bar, 90bpm loop from Launchpad App.
2. Sent that to Nanostudio via 'Open in' and pointed all 16 trg pads at that single sample.
3. I did some quick math and worked out that each beat was therefore 0.666 seconds and listed the beat sample values @ 44,100 samples per second. 29,400; 58,800; 89,200; etc...
4. Opened up the Project.prg in Sublime, slotted the above values on a split screen view to the right then copied over those values to the .prg file. Kinda quick with click, copy, paste and using each value twice for the End value and then the following sample's start value.

5.Saved the Package.prg file back to the project folder.
6.Nanosynced
7.Dropboxed.

I'll add more steps as I remember them

All the samples have same name. Pad 1 plays full sample, pads 2-15 the followings beats of 0.66 seconds each

https://www.dropbox.com/s/fwld14nnlnt0281/Slice-TEST-02.nsp?dl=0

spooky zoo
Offline
Joined: 05/07/2012

@syrupcore Hah...just saw your Sample Calculator....very Cool!

Wish I'd know 1hr ago :)

Edit: Ok wow, now I read your post properly and realise it's MUCH more.

Gotta test this!!

spooky zoo
Offline
Joined: 05/07/2012

I've had a few goes but my mind is 1am frazzled.

Definitely looking forward to trying this again in the morning. Very cool.

spooky zoo
Offline
Joined: 05/07/2012

ok, cool...it WORKS!!

I realised I needed the full path name of the sample (doh) to be put in the Name box of your CodePen.

i.e. /User/Samples/Launchpad-TEST- SLICE.wav

Great work.

Thanks

EDIT: I am finding a quirk with the last pad playing full sample from the beginning however. I'll test again tomorrow.

FURTHER EDIT: Having realised that turning on XML syntax on Sublime would make things clearer, I spotted strangely that my earlier self made example was showing 470399 as final end value as opposed to the 470400 from the Codepen. I can understand why this would make the full 470400 value play the sample from the beginning, I'm not sure if I entered 470399 on my earlier attempt ( I probably did) or that was converted by Nano? Either way, the end value will need a single sample deducted on the last pad.

Hope that makes some kinda sense.

syrupcore
Offline
Joined: 09/26/2010

Glad it kinda worked! I was thinking of it just for a TRG file in which case the sample locations are relative to the package.trg. You'd import the TRG into your project.

As far as the last pads sample end time, the whole thing is rounded (lots o numbers can't be evenly divided by 16) so I noticed in a few experiments that the final pads length could be off by a bit.

Please, feel free to fork the codepen and add any fixes (including to the instructions) you can think of. I'm on my phone so still haven't actually tried it. :)

Slam-Cut
Offline
Joined: 09/07/2011

EXCELLENT WORK syrupecore!!!!
The theory of it was well beyond my ability, but I'm impressed that you figured it out and capitolized on a way of making use of it.

spooky zoo
Offline
Joined: 05/07/2012

Hey Will,

Had another go with this earlier. I used the method you suggested with importing the TRG with sample. Worked very well. I found on my second experiment that the last 4 pads played from beginning. Probably my user error, didn't have time to dig further though.

Yeah that makes sense about being divisible by 16. Are the numbers rounded down or up?

Cool tool, will definitely be using it further.

syrupcore
Offline
Joined: 09/26/2010

They're rounded up but would only be by less than a sample for each slice. I haven't tested it hard but I think that means that worse case scenario it's off by max 15 samples. You lose more than that per second when listening to CD audio.